Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Same TileEntity, different Renderer


Stjubit
 Share

Recommended Posts

Hello,

 

I have got 2 blocks which are accessing the same TileEntity. Now I want to have different TileEntitySpecialRenderers for this Block, but I can only register one TESR in the proxy like this:

 

ClientRegistry.bindTileEntitySpecialRenderer(WirelessTypeTileEntity.class, new WirelessTypeRenderer());

 

How can I achieve this?

 

~Julian

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • package ocean.chinacraft.common.block.decoration; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.FourWayBlock; import net.minecraft.block.PaneBlock; import net.minecraft.fluid.FluidState; import net.minecraft.fluid.Fluids; import net.minecraft.item.BlockItemUseContext; import net.minecraft.state.StateContainer; import net.minecraft.tags.BlockTags; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import ocean.chinacraft.common.block.properties.PropertiesMisc; /** * 木窗格 * * @author zhang * @since 2021/12/9 */ public class WoodWindow extends FourWayBlock { public WoodWindow() { super(1.0F, 1.0F, 16.0F, 16.0F, 16.0F, PropertiesMisc.defaultWindow()); this.registerDefaultState(this.stateDefinition.any().setValue(NORTH, Boolean.FALSE).setValue(EAST, Boolean.FALSE).setValue(SOUTH, Boolean.FALSE).setValue(WEST, Boolean.FALSE).setValue(WATERLOGGED, Boolean.FALSE)); } @Override public BlockState getStateForPlacement(BlockItemUseContext context) { IBlockReader iblockreader = context.getLevel(); BlockPos blockpos = context.getClickedPos(); FluidState fluidstate = context.getLevel().getFluidState(context.getClickedPos()); BlockPos blockpos1 = blockpos.north(); BlockPos blockpos2 = blockpos.south(); BlockPos blockpos3 = blockpos.west(); BlockPos blockpos4 = blockpos.east(); BlockState blockstate = iblockreader.getBlockState(blockpos1); BlockState blockstate1 = iblockreader.getBlockState(blockpos2); BlockState blockstate2 = iblockreader.getBlockState(blockpos3); BlockState blockstate3 = iblockreader.getBlockState(blockpos4); return this.defaultBlockState().setValue(NORTH, this.attachsTo(blockstate, blockstate.isFaceSturdy(iblockreader, blockpos1, Direction.SOUTH))).setValue(SOUTH, this.attachsTo(blockstate1, blockstate1.isFaceSturdy(iblockreader, blockpos2, Direction.NORTH))).setValue(WEST, this.attachsTo(blockstate2, blockstate2.isFaceSturdy(iblockreader, blockpos3, Direction.EAST))).setValue(EAST, this.attachsTo(blockstate3, blockstate3.isFaceSturdy(iblockreader, blockpos4, Direction.WEST))).setValue(WATERLOGGED, fluidstate.getType() == Fluids.WATER); } @Override public BlockState updateShape(BlockState p_196271_1_, Direction p_196271_2_, BlockState p_196271_3_, IWorld p_196271_4_, BlockPos p_196271_5_, BlockPos p_196271_6_) { if (p_196271_1_.getValue(WATERLOGGED)) { p_196271_4_.getLiquidTicks().scheduleTick(p_196271_5_, Fluids.WATER, Fluids.WATER.getTickDelay(p_196271_4_)); } return p_196271_2_.getAxis().isHorizontal() ? p_196271_1_.setValue(PROPERTY_BY_DIRECTION.get(p_196271_2_), Boolean.valueOf(this.attachsTo(p_196271_3_, p_196271_3_.isFaceSturdy(p_196271_4_, p_196271_6_, p_196271_2_.getOpposite())))) : super.updateShape(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_); } @Override public VoxelShape getVisualShape(BlockState p_230322_1_, IBlockReader p_230322_2_, BlockPos p_230322_3_, ISelectionContext p_230322_4_) { return VoxelShapes.empty(); } @Override @OnlyIn(Dist.CLIENT) public boolean skipRendering(BlockState p_200122_1_, BlockState p_200122_2_, Direction p_200122_3_) { if (p_200122_2_.is(this)) { if (!p_200122_3_.getAxis().isHorizontal()) { return true; } if (p_200122_1_.getValue(PROPERTY_BY_DIRECTION.get(p_200122_3_)) && p_200122_2_.getValue(PROPERTY_BY_DIRECTION.get(p_200122_3_.getOpposite()))) { return true; } } return super.skipRendering(p_200122_1_, p_200122_2_, p_200122_3_); } public final boolean attachsTo(BlockState p_220112_1_, boolean p_220112_2_) { Block block = p_220112_1_.getBlock(); return !isExceptionForConnection(block) && p_220112_2_ || block instanceof PaneBlock || block.is(BlockTags.WALLS); } @Override protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> p_206840_1_) { p_206840_1_.add(NORTH, EAST, WEST, SOUTH, WATERLOGGED); } } status: { "multipart": [ { "apply": { "model": "chinacraft:block/wood_window_post" } }, { "when": { "north": "true" }, "apply": { "model": "chinacraft:block/wood_window_side" } }, { "when": { "east": "true" }, "apply": { "model": "chinacraft:block/wood_window_side", "y": 90 } }, { "when": { "south": "true" }, "apply": { "model": "chinacraft:block/wood_window_side_alt" } }, { "when": { "west": "true" }, "apply": { "model": "chinacraft:block/wood_window_side_alt", "y": 90 } }, { "when": { "north": "false" }, "apply": { "model": "chinacraft:block/wood_window_noside" } }, { "when": { "east": "false" }, "apply": { "model": "chinacraft:block/wood_window_noside_alt" } }, { "when": { "south": "false" }, "apply": { "model": "chinacraft:block/wood_window_noside_alt", "y": 90 } }, { "when": { "west": "false" }, "apply": { "model": "chinacraft:block/wood_window_noside", "y": 270 } } ] }  
    • hello,I am making an object similar to glass_pane.But their status seems to be a bit problematic      
    • Are mcjty's tutorials good enough for making airplanes? And I don't know realistic movement settings and key bindings on the plane, please help!      
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.