Skip to content

Commit

Permalink
chore: random cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
CallMeEchoCodes committed Dec 12, 2024
1 parent e58f282 commit 7d9a720
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 20 deletions.
41 changes: 29 additions & 12 deletions src/client/java/dev/spiritstudios/hollow/HollowClient.java
Original file line number Diff line number Diff line change
@@ -1,42 +1,55 @@
package dev.spiritstudios.hollow;

import dev.spiritstudios.hollow.particle.FireflyJarParticle;
import dev.spiritstudios.hollow.registry.*;
import dev.spiritstudios.hollow.registry.HollowBlockEntityTypes;
import dev.spiritstudios.hollow.registry.HollowBlocks;
import dev.spiritstudios.hollow.registry.HollowEntityTypes;
import dev.spiritstudios.hollow.registry.HollowItems;
import dev.spiritstudios.hollow.registry.HollowParticleTypes;
import dev.spiritstudios.hollow.render.block.EchoingPotBlockEntityRenderer;
import dev.spiritstudios.hollow.render.entity.FireflyEntityRenderer;
import dev.spiritstudios.hollow.render.entity.JarBlockEntityRenderer;
import dev.spiritstudios.specter.api.config.ModMenuHelper;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
import net.minecraft.block.Blocks;
import net.minecraft.client.color.world.BiomeColors;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.client.render.block.entity.BlockEntityRendererFactories;
import net.minecraft.client.render.entity.model.EntityModelLayer;
import net.minecraft.util.Identifier;
import net.minecraft.world.biome.GrassColors;

public class HollowClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
ModMenuHelper.addConfig(Hollow.MODID, HollowConfig.HOLDER.id());

EntityRendererRegistry.register(HollowEntityTypes.FIREFLY, FireflyEntityRenderer::new);

ParticleFactoryRegistry.getInstance().register(
HollowParticleTypes.FIREFLY_JAR,
FireflyJarParticle.Factory::new
);

ModelPredicateProviderRegistry.register(
HollowItems.COPPER_HORN,
Identifier.ofVanilla("tooting"),
(stack, world, entity, seed) -> entity != null && entity.isUsingItem() && entity.getActiveItem() == stack ? 1.0F : 0.0F
);

BlockEntityRendererFactories.register(HollowBlockEntityTypes.JAR_BLOCK_ENTITY, JarBlockEntityRenderer::new);
// region Color Providers
ColorProviderRegistry.ITEM.register(
(stack, tintIndex) -> tintIndex == 0 ? 0x71C35C : -1,
HollowItems.GIANT_LILYPAD, HollowItems.LOTUS_LILYPAD
);

ColorProviderRegistry.BLOCK.register((state, world, pos, tintIndex) -> world != null && pos != null ? 0x208030 : 0x71C35C, HollowBlocks.LOTUS_LILYPAD);
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex == 0 ? 0x71C35C : -1, HollowItems.LOTUS_LILYPAD);
ColorProviderRegistry.BLOCK.register(
(state, world, pos, tintIndex) ->
world != null && pos != null ? 0x208030 : 0x71C35C,
HollowBlocks.GIANT_LILYPAD, HollowBlocks.LOTUS_LILYPAD
);

ColorProviderRegistry.BLOCK.register((state, world, pos, tintIndex) -> world != null && pos != null ? 0x208030 : 0x71C35C, HollowBlocks.GIANT_LILYPAD);
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex == 0 ? 0x71C35C : -1, HollowItems.GIANT_LILYPAD);

ColorProviderRegistry.BLOCK.register((state, world, pos, tintIndex) ->
tintIndex != 0 ?
Expand All @@ -47,14 +60,18 @@ public void onInitializeClient() {
HollowBlocks.PURPLE_WILDFLOWER,
HollowBlocks.PINK_WILDFLOWER
);
// endregion

ParticleFactoryRegistry.getInstance().register(HollowParticleTypes.FIREFLY_JAR, FireflyJarParticle.Factory::new);

ModMenuHelper.addConfig(Hollow.MODID, HollowConfig.HOLDER.id());
// region Block Entity Renderers
BlockEntityRendererFactories.register(
HollowBlockEntityTypes.JAR_BLOCK_ENTITY,
JarBlockEntityRenderer::new
);

BlockEntityRendererFactories.register(
HollowBlockEntityTypes.ECHOING_POT_BLOCK_ENTITY,
EchoingPotBlockEntityRenderer::new
);
// endregion
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
package dev.spiritstudios.hollow.registry;

import dev.spiritstudios.hollow.Hollow;
import dev.spiritstudios.specter.api.registry.annotations.Name;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;

import static dev.spiritstudios.hollow.Hollow.MODID;

public final class HollowSoundEvents {
@Name("music_disc.postmortem")
public static final SoundEvent MUSIC_DISC_POSTMORTEM = SoundEvent.of(Identifier.of(MODID, "music_disc.postmortem"));
public static final SoundEvent MUSIC_DISC_POSTMORTEM = SoundEvent.of(Hollow.id("music_disc.postmortem"));

@Name("music.birch_forest")
public static final SoundEvent MUSIC_BIRCH_FOREST = SoundEvent.of(Identifier.of(MODID, "music.birch_forest"));
public static final SoundEvent MUSIC_BIRCH_FOREST = SoundEvent.of(Hollow.id("music.birch_forest"));

@Name("music.swamp")
public static final SoundEvent MUSIC_SWAMP = SoundEvent.of(Identifier.of(MODID, "music.swamp"));
public static final SoundEvent MUSIC_SWAMP = SoundEvent.of(Hollow.id("music.swamp"));

@Name("music.deep_dark")
public static final SoundEvent MUSIC_DEEP_DARK = SoundEvent.of(Identifier.of(MODID, "music.deep_dark"));
public static final SoundEvent MUSIC_DEEP_DARK = SoundEvent.of(Hollow.id("music.deep_dark"));

@Name("block.sculk_jaw.bite")
public static final SoundEvent SCULK_JAW_BITE = SoundEvent.of(Identifier.of(MODID, "block.sculk_jaw.bite"));
public static final SoundEvent SCULK_JAW_BITE = SoundEvent.of(Hollow.id("block.sculk_jaw.bite"));
}

0 comments on commit 7d9a720

Please sign in to comment.