Skip to content

Commit

Permalink
fixed trinkets layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellpeck committed Sep 26, 2024
1 parent 226eefc commit ea6ab5a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/java/de/ellpeck/naturesaura/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemBlockRenderTypes;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRenderers;
import net.minecraft.client.renderer.entity.ThrownItemRenderer;
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
Expand All @@ -35,18 +34,24 @@
import net.minecraft.world.level.block.Block;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent;
import net.neoforged.neoforge.common.NeoForge;

public class ClientProxy implements IProxy {

// TODO check ender crate registry functions
@SubscribeEvent
public void registerMenuScreens(RegisterMenuScreensEvent event) {
event.register(ModContainers.ENDER_CRATE, GuiEnderCrate::new);
event.register(ModContainers.ENDER_ACCESS, GuiEnderCrate::new);
}

@SubscribeEvent
public void registerRenderLayers(EntityRenderersEvent.AddLayers event) {
for (var render : new PlayerRenderer[]{event.getSkin(PlayerSkin.Model.WIDE), event.getSkin(PlayerSkin.Model.SLIM)})
render.addLayer(new PlayerLayerTrinkets(render));
}

@Override
public void preInit(FMLCommonSetupEvent event) {
NeoForge.EVENT_BUS.register(new ClientEvents());
Expand All @@ -64,11 +69,6 @@ public void preInit(FMLCommonSetupEvent event) {

@Override
public void init(FMLCommonSetupEvent event) {
var skinMap = Minecraft.getInstance().getEntityRenderDispatcher().getSkinMap();
for (var render : new EntityRenderer[]{skinMap.get(PlayerSkin.Model.WIDE), skinMap.get(PlayerSkin.Model.SLIM)}) {
if (render instanceof PlayerRenderer living)
living.addLayer(new PlayerLayerTrinkets(living));
}
new SupporterFancyHandler();

for (var item : ModRegistry.ALL_ITEMS) {
Expand Down

0 comments on commit ea6ab5a

Please sign in to comment.