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());
}
}

View file

@ -0,0 +1,5 @@
{
"variants": {
"nortmal": { "model": "techreborn:techreborn.distributor" }
}
}

View file

@ -0,0 +1,18 @@
{ "parent": "block/thin_block",
"textures": {
"particle": "blocks/stone"
},
"elements": [
{ "from": [ 1, 0, 1 ],
"to": [ 15, 1, 15 ],
"faces": {
"down": { "uv": [ 1, 1, 15, 15 ], "texture": "blocks/stone", "cullface": "down" },
"up": { "uv": [ 1, 1, 15, 15 ], "texture": "blocks/stone" },
"north": { "uv": [ 1, 15, 15, 16 ], "texture": "blocks/stone" },
"south": { "uv": [ 1, 15, 15, 16 ], "texture": "blocks/stone" },
"west": { "uv": [ 1, 15, 15, 16 ], "texture": "blocks/stone" },
"east": { "uv": [ 1, 15, 15, 16 ], "texture": "blocks/stone" }
}
}
]
}