mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-25 03:55:22 +01:00
Fix secure objects
This commit is contained in:
parent
eaa198493b
commit
dd6eed6d93
@ -371,9 +371,6 @@ public class DGamePlayer extends DInstancePlayer {
|
|||||||
getSavePlayer().reset(rules.getKeepInventoryOnEscape());
|
getSavePlayer().reset(rules.getKeepInventoryOnEscape());
|
||||||
}
|
}
|
||||||
|
|
||||||
GameWorld gameWorld = GameWorld.getByWorld(getWorld());
|
|
||||||
DGroup dGroup = DGroup.getByPlayer(getPlayer());
|
|
||||||
|
|
||||||
// Permission bridge
|
// Permission bridge
|
||||||
if (plugin.getPermissionProvider() != null) {
|
if (plugin.getPermissionProvider() != null) {
|
||||||
for (String permission : rules.getGamePermissions()) {
|
for (String permission : rules.getGamePermissions()) {
|
||||||
@ -381,12 +378,13 @@ public class DGamePlayer extends DInstancePlayer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Game game = Game.getByGameWorld(gameWorld);
|
DGroup dGroup = DGroup.getByPlayer(getPlayer());
|
||||||
if (dGroup != null) {
|
if (dGroup != null) {
|
||||||
dGroup.removePlayer(getPlayer());
|
dGroup.removePlayer(getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Belohnung
|
GameWorld gameWorld = GameWorld.getByWorld(getWorld());
|
||||||
|
Game game = Game.getByGameWorld(gameWorld);
|
||||||
if (game != null) {
|
if (game != null) {
|
||||||
if (finished) {
|
if (finished) {
|
||||||
if (game.getType().hasRewards()) {
|
if (game.getType().hasRewards()) {
|
||||||
@ -424,7 +422,7 @@ public class DGamePlayer extends DInstancePlayer {
|
|||||||
if (groupPlayer != null) {
|
if (groupPlayer != null) {
|
||||||
for (ItemStack itemStack : getPlayer().getInventory()) {
|
for (ItemStack itemStack : getPlayer().getInventory()) {
|
||||||
if (itemStack != null) {
|
if (itemStack != null) {
|
||||||
if (gameWorld.getSecureObjects().contains(itemStack.getType())) {
|
if (gameWorld.getSecureObjects().contains(itemStack)) {
|
||||||
groupPlayer.getInventory().addItem(itemStack);
|
groupPlayer.getInventory().addItem(itemStack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user