Skip to content

Commit

Permalink
Clean up code slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
seaneoo committed Oct 14, 2024
1 parent cfe2c6f commit 91ca953
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
7 changes: 3 additions & 4 deletions src/client/java/dev/seano/creeplets/CreepletsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@
@Environment(EnvType.CLIENT)
public class CreepletsClient implements ClientModInitializer {

public static final EntityModelLayer CREEPLET_LAYER = new EntityModelLayer(Creeplets.id(Entities.CREEPLET_ID),
"main");
public static final EntityModelLayer CREEPLET_LAYER = new EntityModelLayer(Creeplets.id("creeplet"), "main");

@Override
public void onInitializeClient() {
Creeplets.LOGGER.info("Initializing Creeplets (Client)");
Creeplets.LOGGER.debug("Initializing client-sided Creeplets mod");

initModelsRenders();
}

private void initModelsRenders() {
Creeplets.LOGGER.info("Initializing entity models, renderers");
Creeplets.LOGGER.debug("Initializing entity models, renderers");

EntityRendererRegistry.register(Entities.CREEPLET, ctx -> new CreepletEntityRenderer(ctx, CREEPLET_LAYER));
EntityModelLayerRegistry.registerModelLayer(CREEPLET_LAYER, CreepletEntityModel::getTexturedModelData);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/seano/creeplets/Creeplets.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static Identifier id(String path) {

@Override
public void onInitialize() {
LOGGER.info("Initializing Creeplets");
LOGGER.debug("Initializing Creeplets mod");

AutoConfig.register(CreepletsConfig.class, JanksonConfigSerializer::new);
config = AutoConfig.getConfigHolder(CreepletsConfig.class).getConfig();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/seano/creeplets/registry/Blocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public class Blocks {
Creeplets.id("unstable_tnt"), new UnstableTntBlock(AbstractBlock.Settings.create()));

public static void init() {
Creeplets.LOGGER.info("Initializing blocks");
Creeplets.LOGGER.debug("Initializing mod blocks");
}
}
8 changes: 3 additions & 5 deletions src/main/java/dev/seano/creeplets/registry/Entities.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@

public class Entities {

public static final String CREEPLET_ID = "creeplet";

public static final EntityType<CreepletEntity> CREEPLET = Registry.register(Registries.ENTITY_TYPE,
Creeplets.id(CREEPLET_ID),
Creeplets.id("creeplet"),
FabricEntityType.Builder.createMob(CreepletEntity::new, SpawnGroup.MONSTER, (mob) -> mob)
.dimensions(0.5f, 1.15f)
.build());
Expand All @@ -31,14 +29,14 @@ public class Entities {
EntityType.Builder.<UnstableTntEntity>create(UnstableTntEntity::new, SpawnGroup.MISC).build());

public static void init() {
Creeplets.LOGGER.info("Initializing entities");
Creeplets.LOGGER.debug("Initializing mod entities");

FabricDefaultAttributeRegistry.register(CREEPLET, CreepletEntity.createAttributes());
registerSpawns();
}

private static void registerSpawns() {
Creeplets.LOGGER.info("Registering entity spawns");
Creeplets.LOGGER.debug("Registering entity spawns");

SpawnRestriction.register(CREEPLET, SpawnLocationTypes.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES,
HostileEntity::canSpawnInDark);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/seano/creeplets/registry/Items.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Items {
new BlockItem(Blocks.UNSTABLE_TNT, new Item.Settings()));

public static void init() {
Creeplets.LOGGER.info("Initializing items");
Creeplets.LOGGER.debug("Initializing mod items");

ItemGroupEvents.modifyEntriesEvent(ItemGroups.SPAWN_EGGS)
.register(
Expand Down

0 comments on commit 91ca953

Please sign in to comment.