https://github.com/mcparkournet/impass
Gain access to unavailable members using dynamic proxy classes
https://github.com/mcparkournet/impass
accessor craftbukkit dynamic-proxy implementation-access java nms unavailable-members
Last synced: 9 days ago
JSON representation
Gain access to unavailable members using dynamic proxy classes
- Host: GitHub
- URL: https://github.com/mcparkournet/impass
- Owner: mcparkournet
- License: mit
- Created: 2019-05-28T19:26:02.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-18T22:28:30.000Z (over 5 years ago)
- Last Synced: 2025-11-11T10:02:50.763Z (4 months ago)
- Topics: accessor, craftbukkit, dynamic-proxy, implementation-access, java, nms, unavailable-members
- Language: Java
- Homepage:
- Size: 249 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://bintray.com/mcparkour/maven-public/impass-core/_latestVersion)
# Impass
Impass allows you to access unavailable members using dynamic proxy classes. It is used mainly to access implementation members, which are not exposed in the API, such as some CraftBukkit or NMS methods.
## Usage
Add dependency to project:
```kotlin
repositories {
jcenter()
}
dependencies {
implementation("net.mcparkour:impass-bukkit:1.0.8")
}
```
Create accessor interface:
```java
import net.mcparkour.impass.annotation.method.Method;
import net.mcparkour.impass.annotation.type.CraftBukkitType;
import net.mcparkour.impass.instance.InstanceAccessor;
@CraftBukkitType("CraftPlayer") //Refers to org.bukkit.craftbukkit..CraftPlayer
public interface CraftPlayerAccessor extends InstanceAccessor {
@Method("refreshPlayer")
void refreshPlayer();
}
```
Create accessor factory:
```java
org.bukkit.Server server = ...
AccessorFactory accessorFactory = new BukkitAccessorFactory(server);
```
Create instance of accessor and invoke defined there method:
```java
AccessorFactory accessorFactory = ...
org.bukkit.entity.Player player = ...
CraftPlayerAccessor accessor = accessorFactory.createInstanceAccessor(CraftPlayerAccessor.class, player);
accessor.refreshPlayer(); //Invokes CraftPlayer#refreshPlayer()
```