Add Bow Damge and Fire #261
@ -67,20 +67,17 @@ public class Recording implements Listener {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
RecordSystem.bowSpan(p, true, hand != EnumWrappers.Hand.MAIN_HAND);
|
RecordSystem.bowSpan(p, true, hand != EnumWrappers.Hand.MAIN_HAND);
|
||||||
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Client.BLOCK_DIG) {
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private static final PacketAdapter BOW_PACKET_DEDRAW_PROCESSOR = new PacketAdapter(FightSystem.getPlugin(), PacketType.Play.Client.BLOCK_DIG) {
|
||||||
@Override
|
@Override
|
||||||
public void onPacketReceiving(PacketEvent e) {
|
public void onPacketReceiving(PacketEvent e) {
|
||||||
if(e.getPlayer() != event.getPlayer())
|
|
||||||
return;
|
|
||||||
|
|
||||||
PacketContainer packetDig = e.getPacket();
|
PacketContainer packetDig = e.getPacket();
|
||||||
if(packetDig.getPlayerDigTypes().read(0) == EnumWrappers.PlayerDigType.RELEASE_USE_ITEM) {
|
if(packetDig.getPlayerDigTypes().read(0) == EnumWrappers.PlayerDigType.RELEASE_USE_ITEM) {
|
||||||
RecordSystem.bowSpan(e.getPlayer(), false, hand != EnumWrappers.Hand.MAIN_HAND);
|
RecordSystem.bowSpan(e.getPlayer(), false, false);
|
||||||
ProtocolLibrary.getProtocolManager().removePacketListener(this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public Recording() {
|
public Recording() {
|
||||||
@ -105,11 +102,13 @@ public class Recording implements Listener {
|
|||||||
@Override
|
@Override
|
||||||
public void enable() {
|
public void enable() {
|
||||||
ProtocolLibrary.getProtocolManager().addPacketListener(BOW_PACKET_PROCESSOR);
|
ProtocolLibrary.getProtocolManager().addPacketListener(BOW_PACKET_PROCESSOR);
|
||||||
|
ProtocolLibrary.getProtocolManager().addPacketListener(BOW_PACKET_DEDRAW_PROCESSOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disable() {
|
public void disable() {
|
||||||
ProtocolLibrary.getProtocolManager().removePacketListener(BOW_PACKET_PROCESSOR);
|
ProtocolLibrary.getProtocolManager().removePacketListener(BOW_PACKET_PROCESSOR);
|
||||||
|
ProtocolLibrary.getProtocolManager().removePacketListener(BOW_PACKET_DEDRAW_PROCESSOR);
|
||||||
}
|
}
|
||||||
}.register();
|
}.register();
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren