make the worm do the thing elpek said it did

cuz hes a fraud and it was the farmer that did that thing but now the
worm is cool 2
This commit is contained in:
Shadows_of_Fire 2017-07-29 00:01:28 -04:00
parent cc8124d941
commit 04453f7ca1

View file

@ -11,6 +11,7 @@
package de.ellpeck.actuallyadditions.mod.entity; package de.ellpeck.actuallyadditions.mod.entity;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.DefaultFarmerBehavior;
import net.minecraft.block.*; import net.minecraft.block.*;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@ -81,6 +82,12 @@ public class EntityWorm extends Entity{
if(!isFarmland || state.getValue(BlockFarmland.MOISTURE) < 7){ if(!isFarmland || state.getValue(BlockFarmland.MOISTURE) < 7){
if(isMiddlePose || this.world.rand.nextFloat() >= 0.45F){ if(isMiddlePose || this.world.rand.nextFloat() >= 0.45F){
DefaultFarmerBehavior.useHoeAt(world, pos);
state = this.world.getBlockState(pos);
block = state.getBlock();
isFarmland = block instanceof BlockFarmland;
IBlockState stateToModify = isFarmland ? state : Blocks.FARMLAND.getDefaultState(); IBlockState stateToModify = isFarmland ? state : Blocks.FARMLAND.getDefaultState();
this.world.setBlockState(pos, stateToModify.withProperty(BlockFarmland.MOISTURE, 7), 2); this.world.setBlockState(pos, stateToModify.withProperty(BlockFarmland.MOISTURE, 7), 2);