mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-12-21 16:47:57 +01:00
Pass VB plugin instance for listener creation
This commit is contained in:
parent
46577b4396
commit
99482b611f
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user