mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
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:
parent
cc8124d941
commit
04453f7ca1
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue