From 0e557d525258c1bf4994b067d21d4655722684ac Mon Sep 17 00:00:00 2001 From: OliverSchlueter Date: Sun, 20 Oct 2024 13:30:07 +0200 Subject: [PATCH] Clear teams when npc is created (for all versions) --- .../src/main/java/de/oliver/fancynpcs/v1_19_4/Npc_1_19_4.java | 1 + .../src/main/java/de/oliver/fancynpcs/v1_20_1/Npc_1_20_1.java | 1 + .../src/main/java/de/oliver/fancynpcs/v1_20_2/Npc_1_20_2.java | 1 + .../src/main/java/de/oliver/fancynpcs/v1_20_4/Npc_1_20_4.java | 1 + .../src/main/java/de/oliver/fancynpcs/v1_20_6/Npc_1_20_6.java | 1 + 5 files changed, 5 insertions(+) diff --git a/implementation_1_19_4/src/main/java/de/oliver/fancynpcs/v1_19_4/Npc_1_19_4.java b/implementation_1_19_4/src/main/java/de/oliver/fancynpcs/v1_19_4/Npc_1_19_4.java index 8e1bd7e8..06dd06bd 100644 --- a/implementation_1_19_4/src/main/java/de/oliver/fancynpcs/v1_19_4/Npc_1_19_4.java +++ b/implementation_1_19_4/src/main/java/de/oliver/fancynpcs/v1_19_4/Npc_1_19_4.java @@ -72,6 +72,7 @@ public void create() { EntityType nmsType = BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(data.getType().getKey())); EntityType.EntityFactory factory = (EntityType.EntityFactory) ReflectionUtils.getValue(nmsType, MappingKeys1_19_4.ENTITY_TYPE__FACTORY.getMapping()); // EntityType.factory npc = factory.create(nmsType, serverLevel); + isTeamCreated.clear(); } } diff --git a/implementation_1_20_1/src/main/java/de/oliver/fancynpcs/v1_20_1/Npc_1_20_1.java b/implementation_1_20_1/src/main/java/de/oliver/fancynpcs/v1_20_1/Npc_1_20_1.java index cf00fefc..b12e9824 100644 --- a/implementation_1_20_1/src/main/java/de/oliver/fancynpcs/v1_20_1/Npc_1_20_1.java +++ b/implementation_1_20_1/src/main/java/de/oliver/fancynpcs/v1_20_1/Npc_1_20_1.java @@ -73,6 +73,7 @@ public void create() { EntityType nmsType = BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(data.getType().getKey())); EntityType.EntityFactory factory = (EntityType.EntityFactory) ReflectionUtils.getValue(nmsType, MappingKeys1_20_1.ENTITY_TYPE__FACTORY.getMapping()); // EntityType.factory npc = factory.create(nmsType, serverLevel); + isTeamCreated.clear(); } } diff --git a/implementation_1_20_2/src/main/java/de/oliver/fancynpcs/v1_20_2/Npc_1_20_2.java b/implementation_1_20_2/src/main/java/de/oliver/fancynpcs/v1_20_2/Npc_1_20_2.java index 497d97ce..25bcadde 100644 --- a/implementation_1_20_2/src/main/java/de/oliver/fancynpcs/v1_20_2/Npc_1_20_2.java +++ b/implementation_1_20_2/src/main/java/de/oliver/fancynpcs/v1_20_2/Npc_1_20_2.java @@ -75,6 +75,7 @@ public void create() { EntityType nmsType = BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(data.getType().getKey())); EntityType.EntityFactory factory = (EntityType.EntityFactory) ReflectionUtils.getValue(nmsType, MappingKeys1_20_2.ENTITY_TYPE__FACTORY.getMapping()); // EntityType.factory npc = factory.create(nmsType, serverLevel); + isTeamCreated.clear(); } } diff --git a/implementation_1_20_4/src/main/java/de/oliver/fancynpcs/v1_20_4/Npc_1_20_4.java b/implementation_1_20_4/src/main/java/de/oliver/fancynpcs/v1_20_4/Npc_1_20_4.java index 88e9ac0f..83a21caa 100644 --- a/implementation_1_20_4/src/main/java/de/oliver/fancynpcs/v1_20_4/Npc_1_20_4.java +++ b/implementation_1_20_4/src/main/java/de/oliver/fancynpcs/v1_20_4/Npc_1_20_4.java @@ -74,6 +74,7 @@ public void create() { EntityType nmsType = BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(data.getType().getKey())); EntityType.EntityFactory factory = (EntityType.EntityFactory) ReflectionUtils.getValue(nmsType, MappingKeys1_20_4.ENTITY_TYPE__FACTORY.getMapping()); // EntityType.factory npc = factory.create(nmsType, serverLevel); + isTeamCreated.clear(); } } diff --git a/implementation_1_20_6/src/main/java/de/oliver/fancynpcs/v1_20_6/Npc_1_20_6.java b/implementation_1_20_6/src/main/java/de/oliver/fancynpcs/v1_20_6/Npc_1_20_6.java index 94e3ed1c..bec29330 100644 --- a/implementation_1_20_6/src/main/java/de/oliver/fancynpcs/v1_20_6/Npc_1_20_6.java +++ b/implementation_1_20_6/src/main/java/de/oliver/fancynpcs/v1_20_6/Npc_1_20_6.java @@ -77,6 +77,7 @@ public void create() { EntityType nmsType = BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(data.getType().getKey())); EntityType.EntityFactory factory = (EntityType.EntityFactory) ReflectionUtils.getValue(nmsType, MappingKeys1_20_6.ENTITY_TYPE__FACTORY.getMapping()); // EntityType.factory npc = factory.create(nmsType, serverLevel); + isTeamCreated.clear(); } }