SteamWar/FightSystem
Archiviert
13
1

Merge branch 'hide_sign_content' of SteamWar/FightSystem into master

Dieser Commit ist enthalten in:
Lixfel 2020-01-27 06:47:13 +01:00 committet von Gitea
Commit 67ad92bc90

Datei anzeigen

@ -66,6 +66,7 @@ public class TechHider {
blockActionHider();
blockHider();
multiBlockHider();
updateBlockEntity();
switch(Core.getVersion()){
case 15:
TechHider_15.start();
@ -167,6 +168,29 @@ public class TechHider {
});
}
private static void updateBlockEntity(){
if(Core.getVersion() < 9)
return;
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Server.TILE_ENTITY_DATA) {
@Override
public void onPacketSending(PacketEvent event) {
PacketContainer packet = event.getPacket();
BlockPosition pos = packet.getBlockPositionModifier().read(0);
Player p = event.getPlayer();
if(bypass(p, ITechHider.posToChunk(pos.getX()), ITechHider.posToChunk(pos.getZ())))
return;
// 9 == Set sign text
if(packet.getBytes().read(0) != 9)
return;
event.setCancelled(true);
}
});
}
public static List<ITechHider.ChunkPos> prepareChunkReload(Player p){
if(disabled())
return Collections.emptyList();