mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-26 15:03:03 +00:00
Merge 1.12
This commit is contained in:
commit
13e56153a9
80 files changed
+1165
-784
No files matched your search
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.BlockStem;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -17,10 +18,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Particles;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IItemProvider;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
@@ -65,7 +68,19 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
public boolean isToolEffective(IBlockState state, ToolType tool) {
|
||||
return tool.equals(ToolType.SHOVEL);
|
||||
}
|
||||
|
||||
|
||||
@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 tick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
if(!world.isRemote && state.getBlock() == this && world.getLight(pos.up()) >= 9) {
|
||||
@@ -89,7 +104,7 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
@Override
|
||||
public boolean canSustainPlant(@Nonnull IBlockState state, @Nonnull IBlockReader world, BlockPos pos, @Nonnull EnumFacing direction, IPlantable plantable) {
|
||||
EnumPlantType type = plantable.getPlantType(world, pos.down());
|
||||
return type == EnumPlantType.Plains || type == EnumPlantType.Beach;
|
||||
return type == EnumPlantType.Plains || type == EnumPlantType.Beach || plantable instanceof BlockStem;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
||||
Reference in new issue
Block a user