mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-09-28 22:57:29 +02:00
Creeper explosions with a player target cause should no longer be ignored.
Also fixed primed tnt being checked twice for tnt flags. TNT Minecarts are not included, as was prior behavior. Fixes WORLDGUARD-3344
This commit is contained in:
parent
869ead63bc
commit
0f4e7b5061
@ -129,6 +129,17 @@ public Entity getFirstEntity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Entity getFirstNonPlayerEntity() {
|
||||
for (Object object : causes) {
|
||||
if (object instanceof Entity && !(object instanceof Player)) {
|
||||
return (Entity) object;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Block getFirstBlock() {
|
||||
for (Object object : causes) {
|
||||
|
@ -87,7 +87,7 @@ public void onBreakBlock(final BreakBlockEvent event) {
|
||||
}
|
||||
|
||||
Entity entity;
|
||||
if ((entity = event.getCause().getFirstEntity()) != null) {
|
||||
if ((entity = event.getCause().getFirstNonPlayerEntity()) != null) {
|
||||
// ================================================================
|
||||
// CREEPER_EXPLOSION flag
|
||||
// ================================================================
|
||||
|
@ -215,9 +215,9 @@ public boolean apply(Location target) {
|
||||
String what;
|
||||
|
||||
/* TNT */
|
||||
if (event.getCause().find(EntityType.PRIMED_TNT, EntityType.PRIMED_TNT) != null) {
|
||||
if (event.getCause().find(EntityType.PRIMED_TNT, EntityType.MINECART_TNT) != null) {
|
||||
canBreak = query.testBuild(target, associable, combine(event, DefaultFlag.BLOCK_BREAK, DefaultFlag.TNT));
|
||||
what = "dynamite blocks";
|
||||
what = "use dynamite";
|
||||
|
||||
/* Everything else */
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user