mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 03:15:07 +00:00
You can now use your mother on special grasses
This commit is contained in:
1 parent
c5a874d4ea
commit
666ed3f6ac
1 file changed
+15
-1
@@ -20,8 +20,10 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -81,7 +83,19 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
for(int i = 0; i < 6; i++)
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
||||
ItemStack held = player.getHeldItem(hand);
|
||||
if(held.getItem() instanceof ItemHoe && world.isAirBlock(pos.up())) {
|
||||
held.damageItem(1, player);
|
||||
world.setBlockState(pos, Blocks.FARMLAND.getDefaultState(), 1 | 2);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) {
|
||||
if(!world.isRemote && state.getBlock() == this && world.getLight(pos.up()) >= 9) {
|
||||
|
||||
Reference in new issue
Block a user