Use getter here
This commit is contained in:
parent
364d9dbaca
commit
9af92fa1e5
@ -45,7 +45,11 @@ public class Chairs extends JavaPlugin {
|
|||||||
{
|
{
|
||||||
return psitdata;
|
return psitdata;
|
||||||
}
|
}
|
||||||
protected Class<?> vehiclearrowclass;
|
private Class<?> vehiclearrowclass;
|
||||||
|
protected Class<?> getVehicleArrowClass()
|
||||||
|
{
|
||||||
|
return vehiclearrowclass;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
@ -98,7 +98,7 @@ public class PlayerSitData {
|
|||||||
Object nmsarrow = getHandleMethod.invoke(arrow);
|
Object nmsarrow = getHandleMethod.invoke(arrow);
|
||||||
Field bukkitEntityField = nmsarrow.getClass().getSuperclass().getDeclaredField("bukkitEntity");
|
Field bukkitEntityField = nmsarrow.getClass().getSuperclass().getDeclaredField("bukkitEntity");
|
||||||
bukkitEntityField.setAccessible(true);
|
bukkitEntityField.setAccessible(true);
|
||||||
Constructor<?> ctor = plugin.vehiclearrowclass.getDeclaredConstructor(Bukkit.getServer().getClass(), nmsarrow.getClass());
|
Constructor<?> ctor = plugin.getVehicleArrowClass().getDeclaredConstructor(Bukkit.getServer().getClass(), nmsarrow.getClass());
|
||||||
ctor.setAccessible(true);
|
ctor.setAccessible(true);
|
||||||
Object vehiclearrow = ctor.newInstance(Bukkit.getServer(), nmsarrow);
|
Object vehiclearrow = ctor.newInstance(Bukkit.getServer(), nmsarrow);
|
||||||
bukkitEntityField.set(nmsarrow, vehiclearrow);
|
bukkitEntityField.set(nmsarrow, vehiclearrow);
|
||||||
|
Loading…
Reference in New Issue
Block a user