优化TNT爆炸保护

This commit is contained in:
zhangyuheng 2024-08-11 08:12:23 +08:00
parent ee470c6cad
commit e6cea57dfe
3 changed files with 3 additions and 9 deletions

View File

@ -4,7 +4,7 @@ plugins {
}
group = "cn.lunadeer"
version = "2.1.3-beta"
version = "2.1.4-beta"
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))

View File

@ -159,13 +159,10 @@ public class EnvironmentEvents implements Listener {
});
}
@EventHandler(priority = EventPriority.HIGHEST) // tnt_explode - armor stand
@EventHandler(priority = EventPriority.HIGHEST) // tnt_explode - entity
public void onArmorStandExplodedByTnt(EntityDamageByEntityEvent event) {
Entity entity = event.getEntity();
Entity harmer = event.getDamager();
if (entity.getType() != EntityType.ARMOR_STAND) {
return;
}
if (harmer.getType() != EntityType.MINECART_TNT && harmer.getType() != EntityType.PRIMED_TNT) {
return;
}

View File

@ -159,13 +159,10 @@ public class EnvironmentEvents implements Listener {
});
}
@EventHandler(priority = EventPriority.HIGHEST) // tnt_explode - armor stand
@EventHandler(priority = EventPriority.HIGHEST) // tnt_explode - entity
public void onArmorStandExplodedByTnt(EntityDamageByEntityEvent event) {
Entity entity = event.getEntity();
Entity harmer = event.getDamager();
if (entity.getType() != EntityType.ARMOR_STAND) {
return;
}
if (harmer.getType() != EntityType.TNT_MINECART && harmer.getType() != EntityType.TNT) {
return;
}