Skip to content

Commit 41abf7f

Browse files
[fix] Fix Render Crash issue with cobblemon
1 parent 597c616 commit 41abf7f

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

src/main/java/plus/dragons/createenchantmentindustry/client/CEIClient.java

+7-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import net.createmod.ponder.foundation.PonderIndex;
2222
import net.neoforged.api.distmarker.Dist;
2323
import net.neoforged.bus.api.IEventBus;
24-
import net.neoforged.bus.api.SubscribeEvent;
2524
import net.neoforged.fml.common.Mod;
2625
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
2726
import plus.dragons.createenchantmentindustry.client.model.CEIPartialModels;
@@ -31,12 +30,15 @@
3130
@Mod(value = CEICommon.ID, dist = Dist.CLIENT)
3231
public class CEIClient {
3332
public CEIClient(IEventBus modBus) {
34-
modBus.register(this);
33+
// CEIPartialModels must be registered here,
34+
// or when PartialModelEventHandler#onRegisterAdditional triggered,
35+
// PartialModel.ALL won't include all partial model in 'some cases'
36+
// AllPartialModels#ini does not do this since AllPartialModels is already triggered at AllBlocks.TRACK
37+
CEIPartialModels.register();
38+
modBus.addListener(CEIClient::setup);
3539
}
3640

37-
@SubscribeEvent
38-
public void setup(final FMLClientSetupEvent event) {
39-
CEIPartialModels.register();
41+
public static void setup(final FMLClientSetupEvent event) {
4042
PonderIndex.addPlugin(new CEIPonderPlugin());
4143
}
4244
}

src/main/java/plus/dragons/createenchantmentindustry/client/model/CEIPartialModels.java

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public class CEIPartialModels {
2727
public static final PartialModel PRINTER_NOZZLE_TOP = block("printer/nozzle_top");
2828
public static final PartialModel PRINTER_NOZZLE_BOTTOM = block("printer/nozzle_bottom");
2929
public static final PartialModel PRINTER_PISTON = block("printer/piston");
30-
public static final PartialModel BLAZE_ITEM = PartialModel.of(Create.asResource("block/blaze_burner/block_with_blaze"));
3130
public static final PartialModel BLAZE_ENCHANTER_HAT = block("blaze/enchanter_hat");
3231
public static final PartialModel BLAZE_ENCHANTER_HAT_SMALL = block("blaze/enchanter_hat_small");
3332
public static final PartialModel BLAZE_FORGER_HAT = block("blaze/forger_hat");

src/main/java/plus/dragons/createenchantmentindustry/common/processing/enchanter/BlazeEnchanterItemRenderer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static void register(RegisterClientExtensionsEvent event) {
4646

4747
@Override
4848
protected void render(ItemStack stack, CustomRenderedItemModel model, PartialItemModelRenderer renderer, ItemDisplayContext transformType, PoseStack poseStack, MultiBufferSource bufferSource, int light, int overlay) {
49-
renderer.render(CEIPartialModels.BLAZE_ITEM.get(), light);
49+
renderer.render(model.getOriginalModel(), light);
5050
poseStack.pushPose();
5151
poseStack.translate(.5f, .75f, .5f);
5252
renderer.render(CEIPartialModels.BLAZE_ENCHANTER_HAT.get(), light);

src/main/java/plus/dragons/createenchantmentindustry/common/processing/forger/BlazeForgerItemRenderer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static void register(RegisterClientExtensionsEvent event) {
4646

4747
@Override
4848
protected void render(ItemStack stack, CustomRenderedItemModel model, PartialItemModelRenderer renderer, ItemDisplayContext transformType, PoseStack poseStack, MultiBufferSource bufferSource, int light, int overlay) {
49-
renderer.render(CEIPartialModels.BLAZE_ITEM.get(), light);
49+
renderer.render(model.getOriginalModel(), light);
5050
poseStack.pushPose();
5151
poseStack.translate(.5f, .75f, .5f);
5252
renderer.render(CEIPartialModels.BLAZE_FORGER_HAT.get(), light);

0 commit comments

Comments
 (0)