Fix reward inventory exploit in dungeons

This commit is contained in:
Daniel Saukel 2017-02-20 01:47:56 +01:00
parent 843491937a
commit de5cfee76a

View File

@ -105,6 +105,9 @@ public class RewardListener implements Listener {
@EventHandler @EventHandler
public void onPlayerMove(PlayerMoveEvent event) { public void onPlayerMove(PlayerMoveEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();
if (DungeonsXL.getDWorlds().getInstanceByWorld(player.getWorld()) != null) {
return;
}
DLootInventory inventory = DLootInventory.getByPlayer(player); DLootInventory inventory = DLootInventory.getByPlayer(player);
if (inventory != null && player.getLocation().getBlock().getRelative(0, 1, 0).getType() != Material.PORTAL && player.getLocation().getBlock().getRelative(0, -1, 0).getType() != Material.PORTAL if (inventory != null && player.getLocation().getBlock().getRelative(0, 1, 0).getType() != Material.PORTAL && player.getLocation().getBlock().getRelative(0, -1, 0).getType() != Material.PORTAL
&& player.getLocation().getBlock().getRelative(1, 0, 0).getType() != Material.PORTAL && player.getLocation().getBlock().getRelative(-1, 0, 0).getType() != Material.PORTAL && player.getLocation().getBlock().getRelative(1, 0, 0).getType() != Material.PORTAL && player.getLocation().getBlock().getRelative(-1, 0, 0).getType() != Material.PORTAL