Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SubscribeEvent
- public void drawSelectionBox(DrawBlockHighlightEvent e)
- {
- ///*
- if(e.target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
- {
- BlockPos blockpos = e.target.getBlockPos();
- World world = e.player.worldObj;
- TileEntity tileEntity = world.getTileEntity(blockpos);
- if(tileEntity instanceof TileEntityTinyDirt)
- {
- TileEntityTinyDirt tileEntityTinyDirt = (TileEntityTinyDirt) tileEntity;
- TinyDirt block = (TinyDirt) world.getBlockState(blockpos).getBlock();
- if(tileEntityTinyDirt.isBot_nw())
- {
- block.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 0.5F, 0.5F);
- e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks);
- }
- if(tileEntityTinyDirt.isBot_ne())
- {
- block.setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 0.5F, 0.5F);
- e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks);
- }
- if(tileEntityTinyDirt.isBot_se())
- {
- block.setBlockBounds(0.5F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F);
- e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks);
- }
- if(tileEntityTinyDirt.isBot_sw())
- {
- block.setBlockBounds(0.0F, 0.0F, 0.5F, 0.5F, 0.5F, 1.0F);
- e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks);
- }
- if(tileEntityTinyDirt.isTop_nw())
- {
- block.setBlockBounds(0.0F, 0.5F, 0.0F, 0.5F, 1.0F, 0.5F);
- e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks);
- }
- if(tileEntityTinyDirt.isTop_ne())
- {
- block.setBlockBounds(0.5F, 0.5F, 0.0F, 1.0F, 1.0F, 0.5F);
- e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks);
- }
- if(tileEntityTinyDirt.isTop_se())
- {
- block.setBlockBounds(0.5F, 0.5F, 0.5F, 1.0F, 1.0F, 1.0F);
- e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks);
- }
- if(tileEntityTinyDirt.isTop_sw())
- {
- block.setBlockBounds(0.0F, 0.5F, 0.5F, 0.5F, 1.0F, 1.0F);
- e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks);
- }
- e.setCanceled(true);
- }
- //*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment