From 9af92fa1e5901b50c1edff80416d36daaa9312c7 Mon Sep 17 00:00:00 2001 From: Shevchik Date: Mon, 16 Dec 2013 23:04:33 +0400 Subject: [PATCH] Use getter here --- src/com/cnaude/chairs/Chairs.java | 6 +++++- src/com/cnaude/chairs/PlayerSitData.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/cnaude/chairs/Chairs.java b/src/com/cnaude/chairs/Chairs.java index 9a9b423..691120a 100644 --- a/src/com/cnaude/chairs/Chairs.java +++ b/src/com/cnaude/chairs/Chairs.java @@ -45,7 +45,11 @@ public class Chairs extends JavaPlugin { { return psitdata; } - protected Class vehiclearrowclass; + private Class vehiclearrowclass; + protected Class getVehicleArrowClass() + { + return vehiclearrowclass; + } @Override public void onEnable() { diff --git a/src/com/cnaude/chairs/PlayerSitData.java b/src/com/cnaude/chairs/PlayerSitData.java index c6a9512..4ba52b8 100644 --- a/src/com/cnaude/chairs/PlayerSitData.java +++ b/src/com/cnaude/chairs/PlayerSitData.java @@ -98,7 +98,7 @@ public class PlayerSitData { Object nmsarrow = getHandleMethod.invoke(arrow); Field bukkitEntityField = nmsarrow.getClass().getSuperclass().getDeclaredField("bukkitEntity"); 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); Object vehiclearrow = ctor.newInstance(Bukkit.getServer(), nmsarrow); bukkitEntityField.set(nmsarrow, vehiclearrow);