SteamWar/BauSystem2.0
Archiviert
12
0

Add NoClipCommand spectate

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-06-04 11:16:33 +02:00
Ursprung 535d8f497b
Commit c6b6ce3abd

Datei anzeigen

@ -70,7 +70,7 @@ public class NoClipCommand extends SWCommand implements Listener {
}
}
});
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(BauSystem.getInstance(), PacketType.Play.Client.USE_ITEM, PacketType.Play.Client.BLOCK_DIG, PacketType.Play.Client.WINDOW_CLICK, PacketType.Play.Client.SPECTATE) {
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(BauSystem.getInstance(), PacketType.Play.Client.USE_ITEM, PacketType.Play.Client.BLOCK_DIG, PacketType.Play.Client.WINDOW_CLICK) {
@Override
public void onPacketReceiving(PacketEvent event) {
if (NOCLIPS.contains(event.getPlayer())) {
@ -79,6 +79,14 @@ public class NoClipCommand extends SWCommand implements Listener {
}
}
});
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(BauSystem.getInstance(), PacketType.Play.Client.SPECTATE) {
@Override
public void onPacketReceiving(PacketEvent event) {
if (NOCLIPS.contains(event.getPlayer())) {
event.setCancelled(true);
}
}
});
}
@Register(help = true)