3838import net .minecraft .world .item .ItemDisplayContext ;
3939import net .minecraft .world .item .ItemStack ;
4040import net .minecraft .world .level .BlockAndTintGetter ;
41- import net .minecraft .world .level .block .entity .BlockEntity ;
4241import net .minecraft .world .level .block .entity .BlockEntityType ;
4342import net .minecraft .world .level .block .state .BlockState ;
4443import net .minecraft .world .phys .AABB ;
6160import java .util .stream .Collectors ;
6261
6362public final class MachineModel extends BaseBakedModel implements ICoverableRenderer ,
64- IBlockEntityRendererBakedModel <BlockEntity > {
63+ IBlockEntityRendererBakedModel <MetaMachine > {
6564
6665 public static final ResourceLocation PIPE_OVERLAY = GTCEu .id ("block/overlay/machine/overlay_pipe" );
6766 public static final ResourceLocation FLUID_OUTPUT_OVERLAY = GTCEu .id ("block/overlay/machine/overlay_fluid_output" );
@@ -432,10 +431,9 @@ public boolean isCustomRenderer() {
432431
433432 @ SuppressWarnings ({ "rawtypes" , "unchecked" })
434433 @ Override
435- public void render (BlockEntity blockEntity , float partialTick ,
434+ public void render (MetaMachine machine , float partialTick ,
436435 PoseStack poseStack , MultiBufferSource buffer ,
437436 int packedLight , int packedOverlay ) {
438- if (!(blockEntity instanceof MetaMachine machine )) return ;
439437 if (machine .getDefinition () != getDefinition ()) return ;
440438 ICoverableRenderer .super .renderDynamicCovers (machine , partialTick , poseStack , buffer ,
441439 packedLight ,
@@ -463,10 +461,9 @@ public void renderByItem(ItemStack stack, ItemDisplayContext displayContext,
463461
464462 @ SuppressWarnings ({ "rawtypes" , "unchecked" })
465463 @ Override
466- public AABB getRenderBoundingBox (BlockEntity blockEntity ) {
467- AABB bounds = IBlockEntityRendererBakedModel .super .getRenderBoundingBox (blockEntity );
464+ public AABB getRenderBoundingBox (MetaMachine machine ) {
465+ AABB bounds = IBlockEntityRendererBakedModel .super .getRenderBoundingBox (machine );
468466
469- if (!(blockEntity instanceof MetaMachine machine )) return bounds ;
470467 if (machine .getDefinition () != getDefinition ()) return bounds ;
471468 if (dynamicRenders .isEmpty ()) return bounds ;
472469
@@ -478,8 +475,7 @@ public AABB getRenderBoundingBox(BlockEntity blockEntity) {
478475
479476 @ SuppressWarnings ({ "rawtypes" , "unchecked" })
480477 @ Override
481- public boolean shouldRenderOffScreen (BlockEntity blockEntity ) {
482- if (!(blockEntity instanceof MetaMachine machine )) return false ;
478+ public boolean shouldRenderOffScreen (MetaMachine machine ) {
483479 if (machine .getDefinition () != getDefinition ()) return false ;
484480 if (dynamicRenders .isEmpty ()) return false ;
485481
@@ -491,8 +487,7 @@ public boolean shouldRenderOffScreen(BlockEntity blockEntity) {
491487
492488 @ SuppressWarnings ({ "rawtypes" , "unchecked" })
493489 @ Override
494- public boolean shouldRender (BlockEntity blockEntity , Vec3 cameraPos ) {
495- if (!(blockEntity instanceof MetaMachine machine )) return false ;
490+ public boolean shouldRender (MetaMachine machine , Vec3 cameraPos ) {
496491 if (machine .getDefinition () != getDefinition ()) return false ;
497492 if (machine .getCoverContainer ().hasDynamicCovers ()) return true ;
498493 if (dynamicRenders .isEmpty ()) return false ;
@@ -515,7 +510,7 @@ public int getViewDistance() {
515510 }
516511
517512 @ Override
518- public BlockEntityType <? extends BlockEntity > getBlockEntityType () {
513+ public BlockEntityType <? extends MetaMachine > getBlockEntityType () {
519514 return getDefinition ().getBlockEntityType ();
520515 }
521516}
0 commit comments