Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-12-27 00:22:53 +01:00
Pass VB plugin instance for listener creation
Dieser Commit ist enthalten in:
Ursprung
46577b4396
Commit
99482b611f
@ -29,7 +29,7 @@ public class BukkitPlugin extends JavaPlugin implements ViaBackwardsPlatform {
|
|||||||
private void onServerLoaded() {
|
private void onServerLoaded() {
|
||||||
if (ProtocolRegistry.SERVER_PROTOCOL >= ProtocolVersion.v1_14.getId()) {
|
if (ProtocolRegistry.SERVER_PROTOCOL >= ProtocolVersion.v1_14.getId()) {
|
||||||
BukkitViaLoader loader = (BukkitViaLoader) Via.getManager().getLoader();
|
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;
|
package nl.matsv.viabackwards.listener;
|
||||||
|
|
||||||
|
import nl.matsv.viabackwards.BukkitPlugin;
|
||||||
import nl.matsv.viabackwards.protocol.protocol1_13_2to1_14.Protocol1_13_2To1_14;
|
import nl.matsv.viabackwards.protocol.protocol1_13_2to1_14.Protocol1_13_2To1_14;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@ -10,13 +11,12 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.BookMeta;
|
import org.bukkit.inventory.meta.BookMeta;
|
||||||
import us.myles.ViaVersion.ViaVersionPlugin;
|
|
||||||
import us.myles.ViaVersion.bukkit.listeners.ViaBukkitListener;
|
import us.myles.ViaVersion.bukkit.listeners.ViaBukkitListener;
|
||||||
|
|
||||||
public class LecternInteractListener extends ViaBukkitListener {
|
public class LecternInteractListener extends ViaBukkitListener {
|
||||||
|
|
||||||
public LecternInteractListener() {
|
public LecternInteractListener(BukkitPlugin plugin) {
|
||||||
super(ViaVersionPlugin.getInstance(), Protocol1_13_2To1_14.class);
|
super(plugin, Protocol1_13_2To1_14.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren