mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 00:38:35 +01:00
parent
018e2603d5
commit
722bb103f3
1 changed files with 7 additions and 5 deletions
|
@ -64,11 +64,13 @@ public class ItemWorm extends ItemBase{
|
||||||
World world = event.getWorld();
|
World world = event.getWorld();
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
BlockPos pos = event.getPos();
|
BlockPos pos = event.getPos();
|
||||||
IBlockState state = world.getBlockState(pos);
|
if(world.isAirBlock(pos.up())){
|
||||||
if(state.getBlock() instanceof BlockGrass && world.rand.nextFloat() >= 0.95F){
|
IBlockState state = world.getBlockState(pos);
|
||||||
ItemStack stack = new ItemStack(InitItems.itemWorm, world.rand.nextInt(2)+1);
|
if(state.getBlock() instanceof BlockGrass && world.rand.nextFloat() >= 0.95F){
|
||||||
EntityItem item = new EntityItem(event.getWorld(), pos.getX()+0.5, pos.getY()+1, pos.getZ()+0.5, stack);
|
ItemStack stack = new ItemStack(InitItems.itemWorm, world.rand.nextInt(2)+1);
|
||||||
world.spawnEntityInWorld(item);
|
EntityItem item = new EntityItem(event.getWorld(), pos.getX()+0.5, pos.getY()+1, pos.getZ()+0.5, stack);
|
||||||
|
world.spawnEntityInWorld(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue