Pass VB plugin instance for listener creation

This commit is contained in:
KennyTV 2020-04-14 19:01:19 +02:00
parent 46577b4396
commit 99482b611f
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 4 additions and 4 deletions

View File

@ -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();
}
}

View File

@ -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)