Skip to content

Commit

Permalink
Excrement piles can now be disabled without any later crashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Apr 14, 2014
1 parent f23e999 commit c240802
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/evilcraft/events/PlaySoundAtEntityEventHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;
import evilcraft.ExtendedDamageSource;
import evilcraft.GeneralConfig;
import evilcraft.Recipes;
import evilcraft.blocks.ExcrementPile;
import evilcraft.blocks.ExcrementPileConfig;
import evilcraft.entities.monster.Werewolf;
Expand Down Expand Up @@ -40,7 +41,8 @@ private void dropExcrement(PlaySoundAtEntityEvent event) {
if(event.entity instanceof EntityAnimal) {
EntityAnimal entity = (EntityAnimal) event.entity;
World world = entity.worldObj;
if(world.rand.nextInt(CHANCE_DROP_EXCREMENT) == 0) {
if(world.rand.nextInt(CHANCE_DROP_EXCREMENT) == 0
&& Recipes.isItemEnabled(ExcrementPileConfig.class)) {
int x = MathHelper.floor_double(entity.posX);
int y = MathHelper.floor_double(entity.posY);
int z = MathHelper.floor_double(entity.posZ);
Expand Down

0 comments on commit c240802

Please sign in to comment.