Skip to content

Commit

Permalink
Fix inspectable pigs
Browse files Browse the repository at this point in the history
  • Loading branch information
apple502j committed Aug 29, 2024
1 parent 41758c5 commit d7e0868
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import net.minecraft.entity.passive.PigEntity;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;

Expand All @@ -33,6 +35,7 @@
import net.fabricmc.fabric.test.lookup.api.Inspectable;

public class FabricEntityApiLookupTest {
public static final RegistryKey<EntityType<?>> INSPECTABLE_PIG_KEY = RegistryKey.of(RegistryKeys.ENTITY_TYPE, Identifier.of(FabricApiLookupTest.MOD_ID, "inspectable_pig"));
public static final EntityApiLookup<Inspectable, Void> INSPECTABLE =
EntityApiLookup.get(Identifier.of(FabricApiLookupTest.MOD_ID, "inspectable"), Inspectable.class, Void.class);

Expand All @@ -41,10 +44,10 @@ public class FabricEntityApiLookupTest {
.entityFactory(InspectablePigEntity::new)
.dimensions(EntityDimensions.changing(0.9F, 0.9F))
.trackRangeChunks(10)
.build();
.build(INSPECTABLE_PIG_KEY);

public static void onInitialize() {
Registry.register(Registries.ENTITY_TYPE, Identifier.of(FabricApiLookupTest.MOD_ID, "inspectable_pig"), INSPECTABLE_PIG);
Registry.register(Registries.ENTITY_TYPE, INSPECTABLE_PIG_KEY, INSPECTABLE_PIG);
FabricDefaultAttributeRegistry.register(INSPECTABLE_PIG, PigEntity.createPigAttributes());

INSPECTABLE.registerSelf(INSPECTABLE_PIG);
Expand Down

0 comments on commit d7e0868

Please sign in to comment.