Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

Commit

Permalink
Fixed NetherEX #18
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexeption committed Nov 22, 2019
1 parent b8b2029 commit 4ade92a
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
@@ -84,6 +84,10 @@
@@ -84,6 +84,11 @@
return String.valueOf(EntityRegistration.this.getRegistryName());
}
};
+ // Magma NMS Custom Entity
+ if (EntityList.REGISTRY.getNameForObject(entityClass) == null) {
+ if(id == -1) return; // Dont Register Forge Mods. // May change to generate id for mods.
+ EntityList.REGISTRY.register(id, registryName, entityClass);
+ }
}
public ResourceLocation getRegistryName()
{
@@ -148,6 +152,9 @@
@@ -148,6 +153,9 @@
private final BiMap<Class<? extends Entity>, EntityRegistration> entityClassRegistrations = HashBiMap.create();
private final Map<Class<? extends Entity>, EntityEntry> entityClassEntries = GameData.getEntityClassMap();

Expand All @@ -37,23 +38,23 @@
public static EntityRegistry instance()
{
return INSTANCE;
@@ -171,6 +178,7 @@
@@ -171,6 +179,7 @@
public static void registerModEntity(ResourceLocation registryName, Class<? extends Entity> entityClass, String entityName, int id, Object mod, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates)
{
instance().doModEntityRegistration(registryName, entityClass, entityName, id, mod, trackingRange, updateFrequency, sendsVelocityUpdates);
+ registerBukkitType(entityClass, entityName);
}

/**
@@ -191,6 +199,7 @@
@@ -191,6 +200,7 @@
{
instance().doModEntityRegistration(registryName, entityClass, entityName, id, mod, trackingRange, updateFrequency, sendsVelocityUpdates);
EntityRegistry.registerEgg(registryName, eggPrimary, eggSecondary);
+ registerBukkitType(entityClass, entityName);
}

private void doModEntityRegistration(ResourceLocation registryName, Class<? extends Entity> entityClass, String entityName, int id, Object mod, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates)
@@ -385,4 +394,30 @@
@@ -385,4 +395,30 @@
this.entityClassRegistrations.put(entity, registration);
this.entityRegistrations.put(registration.container, registration);
}
Expand Down

0 comments on commit 4ade92a

Please sign in to comment.