Skip to content
Browse files

Reflective block textures can no longer be reset with an empty hand.

  • Loading branch information...
Ri5ux committed Mar 15, 2019
1 parent 582ea5d commit b52c373cb1afa96c5baa62f7715842d22650a8ba
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/main/java/org/avp/block/
@@ -14,13 +14,15 @@
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Mirror;
import net.minecraft.util.NonNullList;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
@@ -90,7 +92,7 @@ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, Blo
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
TileEntity tile = worldIn.getTileEntity(pos);

if (tile != null && tile instanceof TileEntityReflective)
TileEntityReflective reflective = (TileEntityReflective) tile;
@@ -101,7 +103,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state,
Block blockHeld = Block.getBlockFromItem(itemHeld);
int metadata = playerIn.getHeldItemMainhand().getMetadata();

if (blockHeld != null)
if (blockHeld != Blocks.AIR)
reflective.setReflection(blockHeld, metadata);
worldIn.notifyBlockUpdate(pos, state, state, 3);
@@ -265,7 +267,13 @@ public IBlockState getExtendedState(IBlockState state, IBlockAccess world, Block

return state;

public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
super.getDrops(drops, world, pos, state, fortune);

public TileEntity createNewTileEntity(World worldIn, int meta)

0 comments on commit b52c373

Please sign in to comment.
You can’t perform that action at this time.