mirror of
https://github.com/TotalFreedomMC/TF-WorldGuardExtraFlagsPlugin.git
synced 2024-12-31 19:42:52 +00:00
Fixed build flag & block-place and block-break incompatiblity
This commit is contained in:
parent
a3b551a512
commit
368f96c51e
1 changed files with 22 additions and 24 deletions
|
@ -91,8 +91,7 @@ public class BlockListener implements Listener
|
||||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = false)
|
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = false)
|
||||||
public void onBlockBreakEvent(BreakBlockEvent event)
|
public void onBlockBreakEvent(BreakBlockEvent event)
|
||||||
{
|
{
|
||||||
if (event.getResult() == Result.DEFAULT)
|
Result originalResult = event.getResult();
|
||||||
{
|
|
||||||
Object cause = event.getCause().getRootCause();
|
Object cause = event.getCause().getRootCause();
|
||||||
|
|
||||||
if (cause instanceof Player)
|
if (cause instanceof Player)
|
||||||
|
@ -120,7 +119,7 @@ public class BlockListener implements Listener
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
event.setResult(Result.DEFAULT);
|
event.setResult(originalResult);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,5 +127,4 @@ public class BlockListener implements Listener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue