diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/damage/DamageModify.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/damage/DamageModify.java index b93beffef..298e92194 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/damage/DamageModify.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/damage/DamageModify.java @@ -43,11 +43,13 @@ public class DamageModify { RESOURCE_KEY, FUNCTION, ENTITY_ID, + ENTITY_TAG, ALL, } private transient TagKey sourceTagKey = null; private transient ResourceKey sourceKey = null; + private transient TagKey> entityTag = null; private transient Function condition = null; public DamageModify() { @@ -92,6 +94,9 @@ public class DamageModify { if (source.startsWith("#")) { sourceType = SourceType.TAG_KEY; this.sourceTagKey = TagKey.create(Registries.DAMAGE_TYPE, ResourceLocation.parse(source.substring(1))); + } else if (source.startsWith("@#")) { + sourceType = SourceType.ENTITY_TAG; + this.entityTag = TagKey.create(Registries.ENTITY_TYPE, ResourceLocation.parse(source.substring(2))); } else if (source.startsWith("@")) { sourceType = SourceType.ENTITY_ID; this.entityId = source.substring(1); @@ -133,6 +138,12 @@ public class DamageModify { yield false; } } + case ENTITY_TAG -> { + var directEntity = source.getDirectEntity(); + if (directEntity == null) yield false; + + yield directEntity.getType().is(entityTag); + } case ALL -> true; }; } diff --git a/src/main/resources/data/superbwarfare/vehicles/annihilator.json b/src/main/resources/data/superbwarfare/vehicles/annihilator.json index cd99dd36b..3c179d46a 100644 --- a/src/main/resources/data/superbwarfare/vehicles/annihilator.json +++ b/src/main/resources/data/superbwarfare/vehicles/annihilator.json @@ -73,7 +73,7 @@ { "Type": "Multiply", "Value": 8, - "Source": "#superbwarfare:aerial_bomb" + "Source": "@#superbwarfare:aerial_bomb" }, { "Type": "Multiply", diff --git a/src/main/resources/data/superbwarfare/vehicles/bmp_2.json b/src/main/resources/data/superbwarfare/vehicles/bmp_2.json index 2c91832e2..3dbd7cee0 100644 --- a/src/main/resources/data/superbwarfare/vehicles/bmp_2.json +++ b/src/main/resources/data/superbwarfare/vehicles/bmp_2.json @@ -77,7 +77,7 @@ { "Type": "Multiply", "Value": 2, - "Source": "#superbwarfare:aerial_bomb" + "Source": "@#superbwarfare:aerial_bomb" }, { "Type": "Multiply", diff --git a/src/main/resources/data/superbwarfare/vehicles/lav_150.json b/src/main/resources/data/superbwarfare/vehicles/lav_150.json index 9c962ea6c..6da348210 100644 --- a/src/main/resources/data/superbwarfare/vehicles/lav_150.json +++ b/src/main/resources/data/superbwarfare/vehicles/lav_150.json @@ -72,7 +72,7 @@ { "Type": "Multiply", "Value": 3, - "Source": "#superbwarfare:aerial_bomb" + "Source": "@#superbwarfare:aerial_bomb" }, { "Type": "Multiply", diff --git a/src/main/resources/data/superbwarfare/vehicles/prism_tank.json b/src/main/resources/data/superbwarfare/vehicles/prism_tank.json index 8800931ba..ea46cda86 100644 --- a/src/main/resources/data/superbwarfare/vehicles/prism_tank.json +++ b/src/main/resources/data/superbwarfare/vehicles/prism_tank.json @@ -77,7 +77,7 @@ { "Type": "Multiply", "Value": 2, - "Source": "#superbwarfare:aerial_bomb" + "Source": "@#superbwarfare:aerial_bomb" }, { "Type": "Multiply", diff --git a/src/main/resources/data/superbwarfare/vehicles/speedboat.json b/src/main/resources/data/superbwarfare/vehicles/speedboat.json index d12d145fe..67b9f610a 100644 --- a/src/main/resources/data/superbwarfare/vehicles/speedboat.json +++ b/src/main/resources/data/superbwarfare/vehicles/speedboat.json @@ -61,7 +61,7 @@ { "Type": "Multiply", "Value": 2, - "Source": "#superbwarfare:aerial_bomb" + "Source": "@#superbwarfare:aerial_bomb" }, { "Type": "Multiply", diff --git a/src/main/resources/data/superbwarfare/vehicles/yx_100.json b/src/main/resources/data/superbwarfare/vehicles/yx_100.json index ae3b11ec1..a21dfc758 100644 --- a/src/main/resources/data/superbwarfare/vehicles/yx_100.json +++ b/src/main/resources/data/superbwarfare/vehicles/yx_100.json @@ -32,7 +32,7 @@ { "Type": "Multiply", "Value": 3, - "Source": "#superbwarfare:aerial_bomb" + "Source": "@#superbwarfare:aerial_bomb" }, { "Type": "Immunity",