subtle worm changes

This commit is contained in:
Ellpeck 2016-07-22 22:52:18 +02:00
parent 205bb07c6b
commit 1fd25ec885
3 changed files with 13 additions and 9 deletions

View file

@ -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"),

View file

@ -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);
}
}
}
}

View file

@ -954,5 +954,5 @@ booklet.actuallyadditions.chapter.playerProbe.name=Player Probe
booklet.actuallyadditions.chapter.playerProbe.text.1=The <item>Player Probe<r> can be used to change the player a <item>Player Interface<r> is connected to. If you don't know what the <item>Player Interface<r> does, look it up in here first! <n><n>To use the Player Probe, simply <imp>right-click any player<r> with it and then <imp>right-click the interface<r>. But watch out! <n>The Probe will <imp>notify the player and disconenct<r> from him whenever he sneaks and will also do so when he <imp>leaves the server<r>! <n><n><i>Shenanigans
booklet.actuallyadditions.chapter.worms.name=Worms
booklet.actuallyadditions.chapter.worms.text.1=The <item>Worms<r> are a pretty useful species. <n>They will, once <imp>placed down on dirt or grass<r>, help you <imp>till the land<r> around them in a 3x3 area and <imp>keep it wet<r>. <n>Additionally, they will help the crops <imp>grow faster<r> by making the ground nice and soft. <n><n><item>Worms<r> can be gotten by simply <imp>tilling the ground<r> with a hoe.
booklet.actuallyadditions.chapter.worms.text.1=The <item>Worms<r> are a pretty useful species. <n>They will, once <imp>placed down on dirt or grass<r>, help you <imp>till the land<r> around them in a 3x3 area and <imp>keep it wet<r>. <n>Additionally, they will help the crops <imp>grow faster<r> by making the ground nice and soft. <n><n><item>Worms<r> can be gotten by simply <imp>tilling grass<r> with a hoe.
booklet.actuallyadditions.chapter.worms.text.2=<i>A worm at work