Starting Techhider delayed while schematicpasting
Dieser Commit ist enthalten in:
Ursprung
8a1aa18ace
Commit
a3331788d4
@ -292,6 +292,7 @@ public class FightTeam {
|
|||||||
if(Config.test())
|
if(Config.test())
|
||||||
pasteSchematic();
|
pasteSchematic();
|
||||||
else if(Fight.getOpposite(this).hasSchematic()){
|
else if(Fight.getOpposite(this).hasSchematic()){
|
||||||
|
TechHider.start();
|
||||||
pasteSchematic();
|
pasteSchematic();
|
||||||
Fight.getOpposite(this).pasteSchematic();
|
Fight.getOpposite(this).pasteSchematic();
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,8 @@ public class TechHider {
|
|||||||
private static short obfuscateShift4;
|
private static short obfuscateShift4;
|
||||||
private static final short BITMASK = 0x1FF;
|
private static final short BITMASK = 0x1FF;
|
||||||
private static Material obfuscateMaterial;
|
private static Material obfuscateMaterial;
|
||||||
|
private static boolean running = false;
|
||||||
|
private static int threadMultiplier = 1;
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
if(disabled())
|
if(disabled())
|
||||||
@ -72,10 +74,39 @@ public class TechHider {
|
|||||||
obfuscateShift4 = (short)(Config.ObfuscateWith << 4);
|
obfuscateShift4 = (short)(Config.ObfuscateWith << 4);
|
||||||
obfuscateMaterial = Material.getMaterial(Config.ObfuscateWith);
|
obfuscateMaterial = Material.getMaterial(Config.ObfuscateWith);
|
||||||
|
|
||||||
int threadMultiplier = 1;
|
|
||||||
if(Config.event())
|
if(Config.event())
|
||||||
threadMultiplier = 4;
|
threadMultiplier = 4;
|
||||||
|
|
||||||
|
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Client.USE_ITEM) {
|
||||||
|
@Override
|
||||||
|
public void onPacketReceiving(PacketEvent e) {
|
||||||
|
Player p = e.getPlayer();
|
||||||
|
|
||||||
|
if(p.getGameMode() == GameMode.SPECTATOR){
|
||||||
|
e.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start(threadMultiplier);
|
||||||
|
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Client.USE_ENTITY) {
|
||||||
|
@Override
|
||||||
|
public void onPacketReceiving(PacketEvent e) {
|
||||||
|
Player p = e.getPlayer();
|
||||||
|
|
||||||
|
if(p.getGameMode() == GameMode.SPECTATOR){
|
||||||
|
e.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start(threadMultiplier);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void start(){
|
||||||
|
if(running)
|
||||||
|
return;
|
||||||
|
running = true;
|
||||||
|
|
||||||
|
if(disabled())
|
||||||
|
return;
|
||||||
|
|
||||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Server.MAP_CHUNK) {
|
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Server.MAP_CHUNK) {
|
||||||
@Override
|
@Override
|
||||||
public void onPacketSending(PacketEvent e) {
|
public void onPacketSending(PacketEvent e) {
|
||||||
@ -243,26 +274,6 @@ public class TechHider {
|
|||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Client.USE_ITEM) {
|
|
||||||
@Override
|
|
||||||
public void onPacketReceiving(PacketEvent e) {
|
|
||||||
Player p = e.getPlayer();
|
|
||||||
|
|
||||||
if(p.getGameMode() == GameMode.SPECTATOR){
|
|
||||||
e.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).start(threadMultiplier);
|
|
||||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Client.USE_ENTITY) {
|
|
||||||
@Override
|
|
||||||
public void onPacketReceiving(PacketEvent e) {
|
|
||||||
Player p = e.getPlayer();
|
|
||||||
|
|
||||||
if(p.getGameMode() == GameMode.SPECTATOR){
|
|
||||||
e.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).start(threadMultiplier);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean bypass(Player p, int chunkX, int chunkZ){
|
private static boolean bypass(Player p, int chunkX, int chunkZ){
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren