Skip to content

Commit

Permalink
v1.3.2.125 - address github issue #155, prevent double dropping of in…
Browse files Browse the repository at this point in the history
…ventory. Hope this does not break anything :P
  • Loading branch information
slipcor committed May 30, 2016
1 parent 20cb644 commit 2a0083d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/changelog.md
@@ -1,3 +1,4 @@
- v1.3.2.125 - address github issue #155, prevent double dropping of inventory. Hope this does not break anything :P
- v1.3.2.124 - address github issue #154 - just remove tick 4, it's not that important anyways. And remove the blocklist spam :)
- v1.3.2.122 - furthermore fix the uninstall routine
- v1.3.2.121 - address github issue #131 - I think I found the bug!
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Expand Up @@ -85,7 +85,7 @@ Users tutorials :

## Changelog

- v1.3.2.124 - address github issue #154 - just remove tick 4, it's not that important anyways. And remove the blocklist spam :)
- v1.3.2.125 - address github issue #155, prevent double dropping of inventory. Hope this does not break anything :P
- [read more](doc/changelog.md)

***
Expand Down
1 change: 1 addition & 0 deletions src/net/slipcor/pvparena/arena/Arena.java
Expand Up @@ -1387,6 +1387,7 @@ public void unKillPlayer(final Player player, final DamageCause cause, final Ent
aPlayer.setArenaClass(aPlayer.getNextArenaClass());
if (aPlayer.getArenaClass() != null) {
ArenaPlayer.givePlayerFightItems(this, aPlayer.get());
aPlayer.setMayDropInventory(true);
}
aPlayer.setNextArenaClass(null);
}
Expand Down
12 changes: 11 additions & 1 deletion src/net/slipcor/pvparena/arena/ArenaPlayer.java
Expand Up @@ -51,6 +51,7 @@ public class ArenaPlayer {
private boolean telePass;
private boolean ignoreAnnouncements;
private boolean teleporting;
private boolean mayDropInventory;

private Arena arena;
private ArenaClass aClass;
Expand Down Expand Up @@ -409,6 +410,7 @@ private void clearDump() {
*/
public void createState(final Player player) {
state = new PlayerState(player);
mayDropInventory = true;
}

public boolean didValidSelection() {
Expand All @@ -427,7 +429,7 @@ public void debugPrint() {
}
debug.i("------------------", name);
debug.i("Player: " + name, name);
debug.i("telepass: " + telePass + " | chatting: "
debug.i("telepass: " + telePass + " | mayDropInv: " + mayDropInventory + " | chatting: "
+ publicChatting, name);
debug.i("arena: " + (arena == null ? "null" : arena.getName()), name);
debug.i("aClass: " + (aClass == null ? "null" : aClass.getName()),
Expand Down Expand Up @@ -588,6 +590,10 @@ public boolean isTeleporting() {
return teleporting;
}

public boolean mayDropInventory() {
return this.mayDropInventory;
}

public Set<PermissionAttachment> getTempPermissions() {
return tempPermissions;
}
Expand Down Expand Up @@ -792,6 +798,10 @@ public void setBackupScoreboardTeam(Team team) {
backupBoardTeam = team;
}

public void setMayDropInventory(boolean value) {
mayDropInventory = value;
}

public void setNextArenaClass(ArenaClass aClass) {
this.naClass = aClass;
}
Expand Down
2 changes: 1 addition & 1 deletion src/net/slipcor/pvparena/classes/PACheck.java
Expand Up @@ -577,7 +577,7 @@ public static void handlePlayerDeath(final Arena arena,
player.getLastDamageCause());
arena.getDebugger().i("custom class active: " + arena.isCustomClassAlive());

if (!arena.getArenaConfig().getBoolean(CFG.PLAYER_DROPSINVENTORY)) {
if (!arena.getArenaConfig().getBoolean(CFG.PLAYER_DROPSINVENTORY) || !ArenaPlayer.parsePlayer(player.getName()).mayDropInventory()) {
event.getDrops().clear();
}
if (doesRespawn
Expand Down
1 change: 1 addition & 0 deletions src/net/slipcor/pvparena/managers/InventoryManager.java
Expand Up @@ -129,6 +129,7 @@ public static List<ItemStack> drop(final Player player) {
player.getWorld().dropItemNaturally(player.getLocation(), is);
}
player.getInventory().clear();
ap.setMayDropInventory(false);
return returned;
}

Expand Down

0 comments on commit 2a0083d

Please sign in to comment.