Skip to content

Commit

Permalink
Also properly setRegistryName
Browse files Browse the repository at this point in the history
  • Loading branch information
Andromander committed May 14, 2021
1 parent 61813ce commit 98e9400
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main/java/androsa/gaiadimension/registry/ModEntities.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.entity.monster.MonsterEntity;
import net.minecraft.fluid.FluidState;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.gen.Heightmap;
import net.minecraft.world.spawner.WorldEntitySpawner;
Expand Down Expand Up @@ -74,15 +75,15 @@ public static <E extends Entity> EntityType<E> registerProjectile(String name, E
.setTrackingRange(range)
.setUpdateInterval(interval)
.build(name);
entitytype.setRegistryName(name);
entitytype.setRegistryName(new ResourceLocation(GaiaDimensionMod.MODID, name));
return RegistryHelper.registerEntity(entitytype);
}

public static <E extends Entity> EntityType<E> registerEntity(String name, EntityType.IFactory<E> entity, EntityClassification classification, float width, float height, boolean fireproof) {
EntityType.Builder<E> type = makeBuilder(entity, classification, width, height);
if (fireproof) type.fireImmune();
EntityType<E> entitytype = type.build(name);
entitytype.setRegistryName(name);
entitytype.setRegistryName(new ResourceLocation(GaiaDimensionMod.MODID, name));
return RegistryHelper.registerEntity(entitytype);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.particles.ParticleType;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.gen.carver.ConfiguredCarver;
import net.minecraft.world.gen.feature.*;
import net.minecraft.world.gen.surfacebuilders.ConfiguredSurfaceBuilder;
Expand Down Expand Up @@ -33,7 +34,7 @@ public static <E extends Entity> EntityType<E> registerEntity(EntityType<E> enti
}

public static <T extends ParticleType<?>> T registerParticle(String name, T particle) {
particle.setRegistryName(name);
particle.setRegistryName(new ResourceLocation(GaiaDimensionMod.MODID, name));
PARTICLE_TYPES.add(particle);
return particle;
}
Expand Down

0 comments on commit 98e9400

Please sign in to comment.