Skip to content

Commit

Permalink
fixed loot drops showing for everyone
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo B committed Aug 8, 2021
1 parent 5693555 commit 61ee268
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public PandeLootChannelHandler_v1_17_R1(EntityPlayer player) {
public void write(ChannelHandlerContext ctx, Object packet, ChannelPromise promise) throws Exception {

if (packet instanceof PacketPlayOutSpawnEntity) {
int id = (int) PacketPlayOutSpawnEntity.a;
int id = ((PacketPlayOutSpawnEntity) packet).b();
if (NMSManager.hideItemFromPlayerMap.containsKey(id)) {
List<Player> players = NMSManager.hideItemFromPlayerMap.get(id);
if (!players.contains(player.getBukkitEntity())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ public void onCall(Reward reward, String value) {
if (value.equalsIgnoreCase("player") && reward.player != null) {
List<Player> players = Collections.singletonList(reward.player);
hideEntity((Entity)reward.item, players);
NMSManager.hideItemFromPlayerMap.put(Integer.valueOf(reward.item.getEntityId()), players);
NMSManager.hideItemFromPlayerMap.put(reward.item.getEntityId(), players);
} else if (value.equalsIgnoreCase("fight")) {
List<Player> dropPlayers = new ArrayList<>();
for (UUID playerUUID : reward.damageUtil.getPlayers())
dropPlayers.add(Bukkit.getPlayer(playerUUID));
if (dropPlayers.size() > 0) {
hideEntity((Entity)reward.item, dropPlayers);
NMSManager.hideItemFromPlayerMap.put(Integer.valueOf(reward.item.getEntityId()), dropPlayers);
NMSManager.hideItemFromPlayerMap.put(reward.item.getEntityId(), dropPlayers);
}
}
}
Expand Down

0 comments on commit 61ee268

Please sign in to comment.