Some more work
This commit is contained in:
parent
cc921dca0a
commit
a170177980
3 changed files with 31 additions and 3 deletions
|
@ -63,9 +63,14 @@ public class BlockDistributor extends Block {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
|
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
|
||||||
|
if(!entityIn.worldObj.isRemote){
|
||||||
if(entityIn instanceof EntityPlayer){
|
if(entityIn instanceof EntityPlayer){
|
||||||
EntityPlayer player = (EntityPlayer) entityIn;
|
EntityPlayer player = (EntityPlayer) entityIn;
|
||||||
if(player.getHeldItemOffhand() == null || player.getHeldItemOffhand() != null && player.getHeldItemOffhand().getItem() != Items.SHIELD){
|
if(player.getHeldItemOffhand() != null && player.getHeldItemOffhand().getItem() == Items.SHIELD){
|
||||||
|
if(ItemNBTHelper.getString(player.getHeldItemOffhand(), "type", "null").equals("modmuss50")){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
player.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, getReleaseStack());
|
player.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, getReleaseStack());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"nortmal": { "model": "techreborn:techreborn.distributor" }
|
||||||
|
}
|
||||||
|
}
|
|
@ -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" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue