diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java index 884fe2754..862a1a9c1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java @@ -23,6 +23,7 @@ public enum ConfigBoolValues{ UPDATE_CHECK_VERSION_SPECIFIC("Version Specific Update Checker", ConfigCategories.OTHER, true, "If Actually Additions' Update Check should only search for updates for the Minecraft Version you currently have"), DO_CAT_DROPS("Do Cat Drops", ConfigCategories.OTHER, true, "If Cats drop Hairy Balls on Occasion"), + WORMS("Worms", ConfigCategories.OTHER, true, "If worms should drop from tilling the ground"), TF_PAXELS("Thermal Foundation Paxels", ConfigCategories.OTHER, true, "If Paxels made of Thermal Foundation Materials should exist"), MT_PAXELS("MekanismTools Paxels", ConfigCategories.OTHER, true, "If Paxels made of MekanismTools Materials should exist"), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWorm.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWorm.java index a19839f06..150909714 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWorm.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWorm.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.items; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.data.WorldData; import de.ellpeck.actuallyadditions.mod.entity.EntityWorm; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; @@ -65,14 +66,16 @@ public class ItemWorm extends ItemBase{ @SubscribeEvent public void onHoe(UseHoeEvent event){ - World world = event.getWorld(); - if(!world.isRemote){ - BlockPos pos = event.getPos(); - IBlockState state = world.getBlockState(pos); - if(state.getBlock() instanceof BlockGrass && world.rand.nextFloat() > 0.7F){ - ItemStack stack = new ItemStack(InitItems.itemWorm, world.rand.nextInt(2)+1); - EntityItem item = new EntityItem(event.getWorld(), pos.getX()+0.5, pos.getY()+1, pos.getZ()+0.5, stack); - world.spawnEntityInWorld(item); + if(ConfigBoolValues.WORMS.isEnabled()){ + World world = event.getWorld(); + if(!world.isRemote){ + BlockPos pos = event.getPos(); + IBlockState state = world.getBlockState(pos); + if(state.getBlock() instanceof BlockGrass && world.rand.nextFloat() >= 0.95F){ + ItemStack stack = new ItemStack(InitItems.itemWorm, world.rand.nextInt(2)+1); + EntityItem item = new EntityItem(event.getWorld(), pos.getX()+0.5, pos.getY()+1, pos.getZ()+0.5, stack); + world.spawnEntityInWorld(item); + } } } } diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 1a6e0b119..00c4a8ded 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -954,5 +954,5 @@ booklet.actuallyadditions.chapter.playerProbe.name=Player Probe booklet.actuallyadditions.chapter.playerProbe.text.1=The Player Probe can be used to change the player a Player Interface is connected to. If you don't know what the Player Interface does, look it up in here first! To use the Player Probe, simply right-click any player with it and then right-click the interface. But watch out! The Probe will notify the player and disconenct from him whenever he sneaks and will also do so when he leaves the server! Shenanigans booklet.actuallyadditions.chapter.worms.name=Worms -booklet.actuallyadditions.chapter.worms.text.1=The Worms are a pretty useful species. They will, once placed down on dirt or grass, help you till the land around them in a 3x3 area and keep it wet. Additionally, they will help the crops grow faster by making the ground nice and soft. Worms can be gotten by simply tilling the ground with a hoe. +booklet.actuallyadditions.chapter.worms.text.1=The Worms are a pretty useful species. They will, once placed down on dirt or grass, help you till the land around them in a 3x3 area and keep it wet. Additionally, they will help the crops grow faster by making the ground nice and soft. Worms can be gotten by simply tilling grass with a hoe. booklet.actuallyadditions.chapter.worms.text.2=A worm at work \ No newline at end of file