From 54b4f946ea6f8013aa2f0ca43b2e765beea717c3 Mon Sep 17 00:00:00 2001 From: Shadows_of_Fire Date: Mon, 21 May 2018 16:07:03 -0400 Subject: [PATCH] meta is wrong n ur code bad bcuz it use meta --- .../actuallyadditions/mod/blocks/BlockWildPlant.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java index 7e7ca88df..895e97d99 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java @@ -18,7 +18,6 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheWildPlants; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; -import net.minecraft.block.BlockCrops; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyEnum; @@ -52,15 +51,14 @@ public class BlockWildPlant extends BlockBushBase{ BlockPos offset = pos.down(); IBlockState offsetState = world.getBlockState(offset); Block offsetBlock = offsetState.getBlock(); - return this.getMetaFromState(state) == TheWildPlants.RICE.ordinal() ? offsetState.getMaterial() == Material.WATER : offsetBlock.canSustainPlant(offsetState, world, offset, EnumFacing.UP, this); + return state.getValue(TYPE) == TheWildPlants.RICE ? offsetState.getMaterial() == Material.WATER : offsetBlock.canSustainPlant(offsetState, world, offset, EnumFacing.UP, this); } @Override - @SideOnly(Side.CLIENT) public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player){ - int metadata = this.getMetaFromState(state); - return metadata >= ALL_WILD_PLANTS.length ? null : new ItemStack(((BlockPlant)ALL_WILD_PLANTS[metadata].wildVersionOf).seedItem); + BlockPlant wild = (BlockPlant) state.getValue(TYPE).wildVersionOf; + return new ItemStack(wild.seedItem); } @Override