use of net.minecraft.server.v1_11_R1.RegistryMaterials in project MyPet by xXKeyleXx.
the class EntityRegistry method registerEntityTypes.
@Override
@SuppressWarnings("unchecked")
public void registerEntityTypes() {
RegistryMaterials registry = getRegistry();
Object[] backup = backupRegistryID(registry);
for (MyPetType type : entityClasses.keySet()) {
try {
registry.a(type.getTypeID(), null, entityClasses.get(type));
} catch (NullPointerException ignored) {
// NPE means that the entity was registered successfully but the key was not
}
}
restoreRegistryID(registry, backup);
}
Aggregations