Skip to content

Commit

Permalink
feat: client stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed May 25, 2024
1 parent 35c7a86 commit ecad5db
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ aether_version=1.20.4-1.4.1-neoforge
nitrogen_version=1.20.4-1.1.4-neoforge
cumulus_version=1.20.4-1.0.1-neoforge
curios_version=7.3.4
zenith_version=1.0.13
zenith_version=1.0.15
aeroblender_version=5271794
terrablender_version=1.20.4-3.3.0.12
terrablender_version_minimum=1.20.4-3.3.0.0
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/net/zepalesque/redux/blockset/BaseWoodSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.aetherteam.aether.AetherTags;
import com.aetherteam.aether.block.natural.AetherLogBlock;
import com.aetherteam.aether.mixin.mixins.common.accessor.FireBlockAccessor;
import net.minecraft.client.renderer.blockentity.HangingSignRenderer;
import net.minecraft.client.renderer.blockentity.SignRenderer;
import net.minecraft.core.Direction;
import net.minecraft.data.loot.BlockLootSubProvider;
import net.minecraft.data.recipes.RecipeCategory;
Expand Down Expand Up @@ -40,6 +42,7 @@
import net.minecraft.world.level.block.state.properties.WoodType;
import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.material.PushReaction;
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
import net.neoforged.neoforge.client.model.generators.BlockStateProvider;
import net.neoforged.neoforge.client.model.generators.ItemModelProvider;
import net.neoforged.neoforge.common.Tags;
Expand All @@ -50,6 +53,7 @@
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredItem;
import net.neoforged.neoforge.registries.DeferredRegister;
import net.zepalesque.redux.Redux;
import net.zepalesque.redux.block.ReduxBlocks;
import net.zepalesque.redux.block.natural.NaturalLog;
import net.zepalesque.redux.data.ReduxTags;
Expand All @@ -68,6 +72,7 @@
import net.zepalesque.zenith.block.ZenithSignBlock;
import net.zepalesque.zenith.block.ZenithWallHangingSignBlock;
import net.zepalesque.zenith.block.ZenithWallSignBlock;
import net.zepalesque.zenith.client.render.entity.ZenithBoatRenderer;
import net.zepalesque.zenith.entity.misc.ZenithBoat;
import net.zepalesque.zenith.entity.misc.ZenithChestBoat;
import net.zepalesque.zenith.item.ZenithBoatItem;
Expand Down Expand Up @@ -887,6 +892,14 @@ public void flammables() {
accessor.callSetFlammable(this.slab().get(), 5, 20);
}

@Override
public void registerRenderers(EntityRenderersEvent.RegisterRenderers event) {
event.registerBlockEntityRenderer(this.signEntity().get(), SignRenderer::new);
event.registerBlockEntityRenderer(this.hangingSignEntity().get(), HangingSignRenderer::new);
event.registerEntityRenderer(this.boatEntity().get(), (context) -> new ZenithBoatRenderer(context, false, Redux.MODID, this.id));
event.registerEntityRenderer(this.chestBoatEntity().get(), (context) -> new ZenithBoatRenderer(context, true, Redux.MODID, this.id));
}


@Override
@Nullable
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/net/zepalesque/redux/client/ReduxClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package net.zepalesque.redux.client;

public class ReduxClient {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package net.zepalesque.redux.client.renderer;

import net.minecraft.client.renderer.blockentity.HangingSignRenderer;
import net.minecraft.client.renderer.blockentity.SignRenderer;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
import net.zepalesque.redux.Redux;
import net.zepalesque.redux.blockset.BaseWoodSet;
import net.zepalesque.redux.blockset.ReduxWoodSets;

@Mod.EventBusSubscriber(modid = Redux.MODID, value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD)
public class ReduxRenderers {

@SubscribeEvent
public static void registerEntityRenderers(EntityRenderersEvent.RegisterRenderers event) {
Redux.WOOD_SETS.forEach(set -> set.registerRenderers(event));
}
}

0 comments on commit ecad5db

Please sign in to comment.