From 99482b611fc6021608c4afb0c454b09515e817b7 Mon Sep 17 00:00:00 2001 From: KennyTV Date: Tue, 14 Apr 2020 19:01:19 +0200 Subject: [PATCH] Pass VB plugin instance for listener creation --- .../src/main/java/nl/matsv/viabackwards/BukkitPlugin.java | 2 +- .../viabackwards/listener/LecternInteractListener.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bukkit/src/main/java/nl/matsv/viabackwards/BukkitPlugin.java b/bukkit/src/main/java/nl/matsv/viabackwards/BukkitPlugin.java index f761e9e4..9f7f4091 100644 --- a/bukkit/src/main/java/nl/matsv/viabackwards/BukkitPlugin.java +++ b/bukkit/src/main/java/nl/matsv/viabackwards/BukkitPlugin.java @@ -29,7 +29,7 @@ public class BukkitPlugin extends JavaPlugin implements ViaBackwardsPlatform { private void onServerLoaded() { if (ProtocolRegistry.SERVER_PROTOCOL >= ProtocolVersion.v1_14.getId()) { BukkitViaLoader loader = (BukkitViaLoader) Via.getManager().getLoader(); - loader.storeListener(new LecternInteractListener()).register(); + loader.storeListener(new LecternInteractListener(this)).register(); } } diff --git a/bukkit/src/main/java/nl/matsv/viabackwards/listener/LecternInteractListener.java b/bukkit/src/main/java/nl/matsv/viabackwards/listener/LecternInteractListener.java index 36aa6ed7..63e4df97 100644 --- a/bukkit/src/main/java/nl/matsv/viabackwards/listener/LecternInteractListener.java +++ b/bukkit/src/main/java/nl/matsv/viabackwards/listener/LecternInteractListener.java @@ -1,5 +1,6 @@ package nl.matsv.viabackwards.listener; +import nl.matsv.viabackwards.BukkitPlugin; import nl.matsv.viabackwards.protocol.protocol1_13_2to1_14.Protocol1_13_2To1_14; import org.bukkit.Material; import org.bukkit.block.Block; @@ -10,13 +11,12 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.BookMeta; -import us.myles.ViaVersion.ViaVersionPlugin; import us.myles.ViaVersion.bukkit.listeners.ViaBukkitListener; public class LecternInteractListener extends ViaBukkitListener { - public LecternInteractListener() { - super(ViaVersionPlugin.getInstance(), Protocol1_13_2To1_14.class); + public LecternInteractListener(BukkitPlugin plugin) { + super(plugin, Protocol1_13_2To1_14.class); } @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)