Skip to content

Commit

Permalink
Clear teams when npc is created (for all versions)
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverSchlueter committed Oct 20, 2024
1 parent f484c01 commit 0e557d5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down

0 comments on commit 0e557d5

Please sign in to comment.