From 441d8113ef1c5976cda26dde215079698fc01463 Mon Sep 17 00:00:00 2001 From: astoria Date: Mon, 3 Apr 2023 10:13:01 -0500 Subject: [PATCH] Rendering --- .../net/brokenmoon/afloydwiremod/api/AbstractWireTile.java | 4 ---- .../afloydwiremod/api/AbstractWireTileSided.java | 5 +++++ .../brokenmoon/afloydwiremod/mixin/MixinBlockRenderer.java | 7 +------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/net/brokenmoon/afloydwiremod/api/AbstractWireTile.java b/src/main/java/net/brokenmoon/afloydwiremod/api/AbstractWireTile.java index 0be15e6..476aa66 100644 --- a/src/main/java/net/brokenmoon/afloydwiremod/api/AbstractWireTile.java +++ b/src/main/java/net/brokenmoon/afloydwiremod/api/AbstractWireTile.java @@ -54,8 +54,4 @@ public abstract class AbstractWireTile extends BlockContainer { //Singleplayer ((IEntityPlayer)player).displayGuiSettings(chip); } - @Override - public int getRenderType(){ - return 28; - } } diff --git a/src/main/java/net/brokenmoon/afloydwiremod/api/AbstractWireTileSided.java b/src/main/java/net/brokenmoon/afloydwiremod/api/AbstractWireTileSided.java index 3869de6..759f552 100644 --- a/src/main/java/net/brokenmoon/afloydwiremod/api/AbstractWireTileSided.java +++ b/src/main/java/net/brokenmoon/afloydwiremod/api/AbstractWireTileSided.java @@ -135,4 +135,9 @@ public abstract class AbstractWireTileSided extends AbstractWireTile{ public boolean renderAsNormalBlock() { return false; } + + @Override + public int getRenderType(){ + return 28; + } } diff --git a/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinBlockRenderer.java b/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinBlockRenderer.java index b494d71..8d80ae5 100644 --- a/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinBlockRenderer.java +++ b/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinBlockRenderer.java @@ -26,12 +26,7 @@ public class MixinBlockRenderer { @Inject(method = "Lnet/minecraft/src/RenderBlocks;renderBlockByRenderType(Lnet/minecraft/src/Block;III)Z", at = @At("HEAD"), cancellable = true) public void injectMethod(Block block, int i, int j, int k, CallbackInfoReturnable cir){ if(block.getRenderType() == 28){ - if(block instanceof AbstractWireTileSided) { - this.renderSidedBlock(block, i, j, k); - } else { - this.renderStandardBlock(block, i, j, k); - } - cir.setReturnValue(true); + cir.setReturnValue(this.renderSidedBlock(block, i, j, k)); } }