mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-14 14:25:30 +01:00
Remove deprecated reflection API usage
This commit is contained in:
parent
e99ae1eb1e
commit
93e2895645
@ -24,6 +24,7 @@ import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
@ -44,9 +45,9 @@ public class SignBreak implements Listener {
|
||||
public SignBreak() {
|
||||
try {
|
||||
Class.forName("com.destroystokyo.paper.event.block.BlockDestroyEvent");
|
||||
ChestShop.getPlugin().registerEvent((Listener) Class.forName("com.Acrobot.ChestShop.Listeners.Block.Break.Attached.PaperBlockDestroy").newInstance());
|
||||
ChestShop.getPlugin().registerEvent((Listener) Class.forName("com.Acrobot.ChestShop.Listeners.Block.Break.Attached.PaperBlockDestroy").getDeclaredConstructor().newInstance());
|
||||
ChestShop.getBukkitLogger().info("Using Paper's BlockDestroyEvent instead of the BlockPhysicsEvent!");
|
||||
} catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) {
|
||||
} catch (ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) {
|
||||
ChestShop.getPlugin().registerEvent(new PhysicsBreak());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user