diff --git a/Common/src/main/java/me/hypherionmc/hyperlighting/client/particles/ParticleRegistryHandler.java b/Common/src/main/java/me/hypherionmc/hyperlighting/client/particles/ParticleRegistryHandler.java index 91680f1..0f8198c 100644 --- a/Common/src/main/java/me/hypherionmc/hyperlighting/client/particles/ParticleRegistryHandler.java +++ b/Common/src/main/java/me/hypherionmc/hyperlighting/client/particles/ParticleRegistryHandler.java @@ -1,5 +1,6 @@ package me.hypherionmc.hyperlighting.client.particles; +import me.hypherionmc.hyperlighting.common.init.FlameParticles; import me.hypherionmc.hyperlighting.common.init.HLParticles; import net.minecraft.client.particle.ParticleEngine; import net.minecraft.core.particles.ParticleOptions; @@ -8,7 +9,9 @@ import net.minecraft.core.particles.ParticleType; public class ParticleRegistryHandler { public static void registerParticles(ParticleStrategy strategy) { - strategy.register(HLParticles.COLORED_FLAME.get(), ColoredFlameParticle.Factory::new); + for (FlameParticles value : FlameParticles.values()) { + strategy.register(value.getParticle().get(), ColoredFlameParticle.Factory::new); + } } public interface ParticleStrategy { diff --git a/Common/src/main/java/me/hypherionmc/hyperlighting/common/blocks/AdvancedTorchBlock.java b/Common/src/main/java/me/hypherionmc/hyperlighting/common/blocks/AdvancedTorchBlock.java index fe11ee2..48e8194 100644 --- a/Common/src/main/java/me/hypherionmc/hyperlighting/common/blocks/AdvancedTorchBlock.java +++ b/Common/src/main/java/me/hypherionmc/hyperlighting/common/blocks/AdvancedTorchBlock.java @@ -8,6 +8,7 @@ import me.hypherionmc.craterlib.util.BlockStateUtils; import me.hypherionmc.craterlib.util.RenderUtils; import me.hypherionmc.hyperlighting.api.LightableBlock; import me.hypherionmc.hyperlighting.common.init.CommonRegistration; +import me.hypherionmc.hyperlighting.common.init.FlameParticles; import me.hypherionmc.hyperlighting.common.init.HLItems; import me.hypherionmc.hyperlighting.common.init.HLSounds; import me.hypherionmc.hyperlighting.util.StackUtil; @@ -63,14 +64,11 @@ public class AdvancedTorchBlock extends HorizontalDirectionalBlock implements Dy Direction.UP, Block.box(6.0D, 0.0D, 6.0D, 10.0D, 10.0D, 10.0D) )); - private final Supplier particleType; - private DyeColor color; - public AdvancedTorchBlock(String name, DyeColor color, CreativeModeTab tab, Supplier type) { + public AdvancedTorchBlock(String name, DyeColor color, CreativeModeTab tab) { super(Properties.of(Material.WOOD).noCollission().instabreak().lightLevel(BlockStateUtils.createLightLevelFromLitBlockState(15))); this.registerDefaultState(this.defaultBlockState().setValue(FACING, Direction.NORTH).setValue(LIT, CommonRegistration.config.torchConfig.litByDefault).setValue(COLOR, color)); - this.particleType = type; this.color = color; HLItems.register(name, () -> new BlockItemDyable(this, new Item.Properties().tab(tab))); @@ -191,7 +189,7 @@ public class AdvancedTorchBlock extends HorizontalDirectionalBlock implements Dy double d1 = (double) pos.getY() + 0.7D; double d2 = (double) pos.getZ() + 0.5D; levelIn.addParticle(ParticleTypes.SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D); - levelIn.addParticle(particleType.get(), d0, d1, d2, 0D, 0D, 0D); + levelIn.addParticle(FlameParticles.getParticleByColor(color).get(), d0, d1, d2, 0D, 0D, 0D); } else { Direction direction = stateIn.getValue(FACING); double d0 = (double) pos.getX() + 0.5D; @@ -199,7 +197,7 @@ public class AdvancedTorchBlock extends HorizontalDirectionalBlock implements Dy double d2 = (double) pos.getZ() + 0.5D; Direction direction1 = direction.getOpposite(); levelIn.addParticle(ParticleTypes.SMOKE, d0 + 0.37D * (double) direction1.getStepX(), d1 + 0.15D, d2 + 0.37D * (double) direction1.getStepZ(), 0.0D, 0.0D, 0.0D); - levelIn.addParticle(particleType.get(), d0 + 0.37D * (double) direction1.getStepX(), d1 + 0.15D, d2 + 0.37D * (double) direction1.getStepZ(), 0D, 0D, 0D); + levelIn.addParticle(FlameParticles.getParticleByColor(color).get(), d0 + 0.37D * (double) direction1.getStepX(), d1 + 0.15D, d2 + 0.37D * (double) direction1.getStepZ(), 0D, 0D, 0D); } } } diff --git a/Common/src/main/java/me/hypherionmc/hyperlighting/common/init/FlameParticles.java b/Common/src/main/java/me/hypherionmc/hyperlighting/common/init/FlameParticles.java new file mode 100644 index 0000000..a89343d --- /dev/null +++ b/Common/src/main/java/me/hypherionmc/hyperlighting/common/init/FlameParticles.java @@ -0,0 +1,57 @@ +package me.hypherionmc.hyperlighting.common.init; + +import me.hypherionmc.craterlib.common.particles.WrappedSimpleParticleType; +import me.hypherionmc.craterlib.systems.reg.RegistrationProvider; +import me.hypherionmc.craterlib.systems.reg.RegistryObject; +import me.hypherionmc.hyperlighting.Constants; +import net.minecraft.core.Registry; +import net.minecraft.core.particles.ParticleType; +import net.minecraft.core.particles.SimpleParticleType; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.material.MaterialColor; + +import java.util.Arrays; +import java.util.function.Supplier; + +import static me.hypherionmc.hyperlighting.common.init.HLParticles.register; + +/** + * @author HypherionSA + * @date 05/08/2022 + */ +public enum FlameParticles { + WHITE(DyeColor.WHITE), + ORANGE(DyeColor.ORANGE), + MAGENTA(DyeColor.MAGENTA), + LIGHT_BLUE(DyeColor.LIGHT_BLUE), + YELLOW(DyeColor.YELLOW), + LIME(DyeColor.LIME), + PINK(DyeColor.PINK), + GRAY(DyeColor.GRAY), + LIGHT_GRAY(DyeColor.LIGHT_GRAY), + CYAN(DyeColor.CYAN), + PURPLE(DyeColor.PURPLE), + BLUE(DyeColor.BLUE), + BROWN(DyeColor.BROWN), + GREEN(DyeColor.GREEN), + RED(DyeColor.RED), + BLACK(DyeColor.BLACK); + + private final RegistryObject PARTICLE; + private final DyeColor color; + + private FlameParticles(DyeColor color) { + PARTICLE = register("flame_" + color.getName().toLowerCase(), () -> new WrappedSimpleParticleType(false)); + this.color = color; + } + + public RegistryObject getParticle() { + return PARTICLE; + } + + public static RegistryObject getParticleByColor(DyeColor color) { + return Arrays.stream(FlameParticles.values()).filter(p -> p.color == color).findFirst().get().getParticle(); + } + + public static void loadAll() {} +} diff --git a/Common/src/main/java/me/hypherionmc/hyperlighting/common/init/HLBlocks.java b/Common/src/main/java/me/hypherionmc/hyperlighting/common/init/HLBlocks.java index ed81494..a9e4ed9 100644 --- a/Common/src/main/java/me/hypherionmc/hyperlighting/common/init/HLBlocks.java +++ b/Common/src/main/java/me/hypherionmc/hyperlighting/common/init/HLBlocks.java @@ -16,7 +16,7 @@ public class HLBlocks { public static RegistrationProvider BLOCKS = RegistrationProvider.get(Registry.BLOCK_REGISTRY, Constants.MOD_ID); /* Torches */ - public static BlockRegistryObject ADVANCED_TORCH = register("advanced_torch", () -> new AdvancedTorchBlock("advanced_torch", DyeColor.ORANGE, CommonRegistration.LIGHTS_TAB, HLParticles.COLORED_FLAME)); + public static BlockRegistryObject ADVANCED_TORCH = register("advanced_torch", () -> new AdvancedTorchBlock("advanced_torch", DyeColor.ORANGE, CommonRegistration.LIGHTS_TAB)); public static void loadAll() {} diff --git a/Common/src/main/java/me/hypherionmc/hyperlighting/common/init/HLParticles.java b/Common/src/main/java/me/hypherionmc/hyperlighting/common/init/HLParticles.java index a2a7b94..75d821e 100644 --- a/Common/src/main/java/me/hypherionmc/hyperlighting/common/init/HLParticles.java +++ b/Common/src/main/java/me/hypherionmc/hyperlighting/common/init/HLParticles.java @@ -14,12 +14,12 @@ public class HLParticles { public static final RegistrationProvider> PARTICLES = RegistrationProvider.get(Registry.PARTICLE_TYPE_REGISTRY, Constants.MOD_ID); - public static RegistryObject COLORED_FLAME = register("colored_flame", () -> new WrappedSimpleParticleType(false)); - public static > RegistryObject register(String name, Supplier particle) { return PARTICLES.register(name, particle); } - public static void loadAll() {} + public static void loadAll() { + FlameParticles.loadAll(); + } } diff --git a/Common/src/main/resources/assets/hyperlighting/lang/en_us.json b/Common/src/main/resources/assets/hyperlighting/lang/en_us.json index f304140..bf46739 100644 --- a/Common/src/main/resources/assets/hyperlighting/lang/en_us.json +++ b/Common/src/main/resources/assets/hyperlighting/lang/en_us.json @@ -3,6 +3,8 @@ "subtitles.torch_ignite": "Torch Ignite Sound", + "entity.hyperlighting.firefly": "Neon Fly", + "cl.hyperlightingconfig.title": "Hyper Lighting Config", "cl.torchconfig.litbydefault": "Lit when Placed", "cl.torchconfig.requirestool": "Requires Torch Lighter" diff --git a/Common/src/main/resources/assets/hyperlighting/particles/colored_flame.json b/Common/src/main/resources/assets/hyperlighting/particles/colored_flame.json deleted file mode 100644 index 3fecae4..0000000 --- a/Common/src/main/resources/assets/hyperlighting/particles/colored_flame.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "textures": [ - "hyperlighting:flames/colored_flame_red" - ] -} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_black.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_black.json new file mode 100644 index 0000000..b00153e --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_black.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_black" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_blue.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_blue.json new file mode 100644 index 0000000..46af443 --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_blue.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_blue" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_brown.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_brown.json new file mode 100644 index 0000000..1c18377 --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_brown.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_brown" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_cyan.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_cyan.json new file mode 100644 index 0000000..43053a0 --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_cyan.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_cyan" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_gray.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_gray.json new file mode 100644 index 0000000..53025aa --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_gray.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_gray" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_green.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_green.json new file mode 100644 index 0000000..5f5392a --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_green.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_green" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_light_blue.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_light_blue.json new file mode 100644 index 0000000..9c6d868 --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_light_blue.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_light_blue" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_light_gray.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_light_gray.json new file mode 100644 index 0000000..d36fd30 --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_light_gray.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_light_gray" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_lime.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_lime.json new file mode 100644 index 0000000..bd8062d --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_lime.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_lime" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_magenta.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_magenta.json new file mode 100644 index 0000000..e13c003 --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_magenta.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_magenta" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_orange.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_orange.json new file mode 100644 index 0000000..d0ac047 --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_orange.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_orange" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_pink.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_pink.json new file mode 100644 index 0000000..e4ef56f --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_pink.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_pink" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_purple.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_purple.json new file mode 100644 index 0000000..9e2f8d0 --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_purple.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_purple" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_red.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_red.json new file mode 100644 index 0000000..9b88dc3 --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_red.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_red" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_white.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_white.json new file mode 100644 index 0000000..4379c3e --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_white.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_white" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/particles/flame_yellow.json b/Common/src/main/resources/assets/hyperlighting/particles/flame_yellow.json new file mode 100644 index 0000000..66e6d0b --- /dev/null +++ b/Common/src/main/resources/assets/hyperlighting/particles/flame_yellow.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hyperlighting:flames/flame_yellow" + ] +} diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/colored_flame_red.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/colored_flame_red.png deleted file mode 100644 index ab69792..0000000 Binary files a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/colored_flame_red.png and /dev/null differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_black.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_black.png new file mode 100644 index 0000000..545d4c9 Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_black.png differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_blue.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_blue.png new file mode 100644 index 0000000..c04ac1a Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_blue.png differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_brown.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_brown.png new file mode 100644 index 0000000..75ff573 Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_brown.png differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_cyan.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_cyan.png new file mode 100644 index 0000000..e57f98d Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_cyan.png differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_gray.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_gray.png new file mode 100644 index 0000000..ba48d0b Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_gray.png differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_green.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_green.png new file mode 100644 index 0000000..2f7dfa2 Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_green.png differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_light_blue.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_light_blue.png new file mode 100644 index 0000000..db53942 Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_light_blue.png differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_light_gray.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_light_gray.png new file mode 100644 index 0000000..9e339c6 Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_light_gray.png differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_lime.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_lime.png new file mode 100644 index 0000000..01521a3 Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_lime.png differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_magenta.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_magenta.png new file mode 100644 index 0000000..3369238 Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_magenta.png differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_orange.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_orange.png new file mode 100644 index 0000000..b97de21 Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_orange.png differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_pink.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_pink.png new file mode 100644 index 0000000..568552e Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_pink.png differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_purple.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_purple.png new file mode 100644 index 0000000..120b6bc Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_purple.png differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_white.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_white.png new file mode 100644 index 0000000..573ef19 Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_white.png differ diff --git a/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_yellow.png b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_yellow.png new file mode 100644 index 0000000..2513e85 Binary files /dev/null and b/Common/src/main/resources/assets/hyperlighting/textures/particle/flames/flame_yellow.png differ diff --git a/Fabric/src/main/java/me/hypherionmc/hyperlighting/HyperLightingFabric.java b/Fabric/src/main/java/me/hypherionmc/hyperlighting/HyperLightingFabric.java index 29825b0..a0ab425 100644 --- a/Fabric/src/main/java/me/hypherionmc/hyperlighting/HyperLightingFabric.java +++ b/Fabric/src/main/java/me/hypherionmc/hyperlighting/HyperLightingFabric.java @@ -1,12 +1,17 @@ package me.hypherionmc.hyperlighting; +import me.hypherionmc.hyperlighting.common.entities.NeonFlyEntity; import me.hypherionmc.hyperlighting.common.init.CommonRegistration; +import me.hypherionmc.hyperlighting.common.init.HLEntities; import net.fabricmc.api.ModInitializer; +import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry; public class HyperLightingFabric implements ModInitializer { @Override public void onInitialize() { CommonRegistration.registerAll(); + + FabricDefaultAttributeRegistry.register(HLEntities.FIREFLY.get(), NeonFlyEntity.prepareAttributes()); } } diff --git a/Fabric/src/main/java/me/hypherionmc/hyperlighting/client/HyperLightingFabricClient.java b/Fabric/src/main/java/me/hypherionmc/hyperlighting/client/HyperLightingFabricClient.java index cf445f9..edb28ea 100644 --- a/Fabric/src/main/java/me/hypherionmc/hyperlighting/client/HyperLightingFabricClient.java +++ b/Fabric/src/main/java/me/hypherionmc/hyperlighting/client/HyperLightingFabricClient.java @@ -1,9 +1,14 @@ package me.hypherionmc.hyperlighting.client; import me.hypherionmc.hyperlighting.client.init.ClientRegistration; +import me.hypherionmc.hyperlighting.client.model.NeonFlyModel; import me.hypherionmc.hyperlighting.client.particles.ParticleRegistryHandler; +import me.hypherionmc.hyperlighting.client.renderer.entity.NeonFlyRenderer; +import me.hypherionmc.hyperlighting.common.init.HLEntities; import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry; +import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry; +import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry; import net.minecraft.client.particle.ParticleEngine; import net.minecraft.core.particles.ParticleOptions; import net.minecraft.core.particles.ParticleType; @@ -20,5 +25,8 @@ public class HyperLightingFabricClient implements ClientModInitializer { ParticleFactoryRegistry.getInstance().register(particle, provider::create); } }); + + EntityRendererRegistry.register(HLEntities.FIREFLY.get(), NeonFlyRenderer::new); + EntityModelLayerRegistry.registerModelLayer(NeonFlyModel.LAYER_LOCATION, NeonFlyModel::createBodyLayer); } } diff --git a/Forge/src/main/java/me/hypherionmc/hyperlighting/HyperLightingForge.java b/Forge/src/main/java/me/hypherionmc/hyperlighting/HyperLightingForge.java index 264db15..9d758a0 100644 --- a/Forge/src/main/java/me/hypherionmc/hyperlighting/HyperLightingForge.java +++ b/Forge/src/main/java/me/hypherionmc/hyperlighting/HyperLightingForge.java @@ -2,11 +2,18 @@ package me.hypherionmc.hyperlighting; import me.hypherionmc.craterlib.client.gui.config.CraterConfigScreen; import me.hypherionmc.hyperlighting.client.init.ClientRegistration; +import me.hypherionmc.hyperlighting.client.renderer.entity.NeonFlyRenderer; +import me.hypherionmc.hyperlighting.common.entities.NeonFlyEntity; import me.hypherionmc.hyperlighting.common.init.CommonRegistration; +import me.hypherionmc.hyperlighting.common.init.HLEntities; +import net.minecraft.client.renderer.entity.EntityRenderers; +import net.minecraft.world.entity.SpawnPlacements; +import net.minecraft.world.level.levelgen.Heightmap; import net.minecraftforge.client.ConfigScreenHandler; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @Mod(Constants.MOD_ID) @@ -14,11 +21,18 @@ public class HyperLightingForge { public HyperLightingForge() { FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientInit); + FMLJavaModLoadingContext.get().getModEventBus().addListener(this::commonInit); CommonRegistration.registerAll(); } public void clientInit(FMLClientSetupEvent event) { new ClientRegistration().registerAll(); ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () -> new ConfigScreenHandler.ConfigScreenFactory((mc, screen) -> new CraterConfigScreen(CommonRegistration.config, screen))); + + EntityRenderers.register(HLEntities.FIREFLY.get(), NeonFlyRenderer::new); + } + + public void commonInit(FMLCommonSetupEvent event) { + } }