Handle setRightClicking for fake disguise items

This commit is contained in:
libraryaddict
2021-05-25 10:42:34 +12:00
parent 2fe8d46c61
commit 7935f65564
2 changed files with 23 additions and 26 deletions

View File

@@ -29,11 +29,11 @@ import java.util.Map;
*/
@Getter
@RequiredArgsConstructor
@Setter
public class LibsPackets {
private final ArrayList<PacketContainer> packets = new ArrayList<>();
private final HashMap<Integer, ArrayList<PacketContainer>> delayedPacketsMap = new HashMap<>();
private final Disguise disguise;
@Setter
private boolean unhandled;
public Disguise getDisguise() {
@@ -79,7 +79,8 @@ public class LibsPackets {
try {
for (PacketContainer packet : entry.getValue()) {
ProtocolLibrary.getProtocolManager().sendServerPacket(observer, packet, false);
// To have right click handled properly, equip packets sent are normal
ProtocolLibrary.getProtocolManager().sendServerPacket(observer, packet, packet.getType() == PacketType.Play.Server.ENTITY_EQUIPMENT);
}
} catch (InvocationTargetException e) {
e.printStackTrace();