Hide sign contents with packet filter
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
11da798b4e
Commit
7c57b6251c
@ -67,6 +67,7 @@ public class TechHider {
|
||||
blockActionHider();
|
||||
blockHider();
|
||||
multiBlockHider();
|
||||
updateBlockEntity();
|
||||
switch(Core.getVersion()){
|
||||
case 15:
|
||||
TechHider_15.start();
|
||||
@ -168,6 +169,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<Pair<Integer, Integer>> prepareChunkReload(Player p){
|
||||
if(disabled())
|
||||
return Collections.emptyList();
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren