mirror of
https://github.com/TotalFreedomMC/TF-WorldGuardExtraFlagsPlugin.git
synced 2024-12-27 01:34:13 +00:00
Fixed keep-inventory & keep-exp has no effect is set to false
This commit is contained in:
parent
c4b229e137
commit
c2a0b0fd32
1 changed files with 14 additions and 6 deletions
|
@ -53,17 +53,25 @@ public class PlayerListener implements Listener
|
|||
ApplicableRegionSet regions = this.plugin.getWorldGuardCommunicator().getRegionContainer().createQuery().getApplicableRegions(player.getLocation());
|
||||
|
||||
Boolean keepInventory = WorldGuardUtils.queryValue(player, player.getWorld(), regions.getRegions(), Flags.KEEP_INVENTORY);
|
||||
if (Boolean.TRUE.equals(keepInventory))
|
||||
if (keepInventory != null)
|
||||
{
|
||||
event.setKeepInventory(true);
|
||||
event.getDrops().clear();
|
||||
event.setKeepInventory(keepInventory);
|
||||
|
||||
if (keepInventory)
|
||||
{
|
||||
event.getDrops().clear();
|
||||
}
|
||||
}
|
||||
|
||||
Boolean keepExp = WorldGuardUtils.queryValue(player, player.getWorld(), regions.getRegions(), Flags.KEEP_EXP);
|
||||
if (Boolean.TRUE.equals(keepExp))
|
||||
if (keepExp != null)
|
||||
{
|
||||
event.setKeepLevel(true);
|
||||
event.setDroppedExp(0);
|
||||
event.setKeepLevel(keepExp);
|
||||
|
||||
if (keepExp)
|
||||
{
|
||||
event.setDroppedExp(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue