Some more work

This commit is contained in:
modmuss50 2016-05-14 19:26:04 +01:00
parent cc921dca0a
commit a170177980
3 changed files with 31 additions and 3 deletions

View file

@ -63,9 +63,14 @@ public class BlockDistributor extends Block {
@Override
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
if(entityIn instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer) entityIn;
if(player.getHeldItemOffhand() == null || player.getHeldItemOffhand() != null && player.getHeldItemOffhand().getItem() != Items.SHIELD){
if(!entityIn.worldObj.isRemote){
if(entityIn instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer) entityIn;
if(player.getHeldItemOffhand() != null && player.getHeldItemOffhand().getItem() == Items.SHIELD){
if(ItemNBTHelper.getString(player.getHeldItemOffhand(), "type", "null").equals("modmuss50")){
return;
}
}
player.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, getReleaseStack());
}
}