From 01909c978754e65b7504693d2a7738deab02be5d Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 8 Jul 2016 17:40:47 +0200 Subject: [PATCH] Solid XP drop config --- .../mod/config/values/ConfigBoolValues.java | 1 + .../mod/items/ItemSolidifiedExperience.java | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) 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 f0f2f6798..a534d230c 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 @@ -37,6 +37,7 @@ public enum ConfigBoolValues{ DO_SPIDER_DROPS("Spider Cobweb Drop", ConfigCategories.MOB_DROPS, true, "If Cobwebs should sometimes drop from Spiders"), DO_BAT_DROPS("Bat Wing Drop", ConfigCategories.MOB_DROPS, true, "If Wings should sometimes drop from Bats"), + DO_XP_DROPS("Solidified XP Drop", ConfigCategories.MOB_DROPS, true, "If Mobs should randomly drop solidified XP occasionally"), CTRL_EXTRA_INFO("Advanced Info", ConfigCategories.OTHER, true, "Show Advanced Item Info when holding Control on every Item"), CTRL_INFO_FOR_EXTRA_INFO("Advanced Info Tooltips", ConfigCategories.OTHER, true, "Show the 'Press Control for more Info'-Text on Item Tooltips"), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java index cf6a2b2b1..a118c5a0d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.items; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.entity.EntityCreature; @@ -37,11 +38,13 @@ public class ItemSolidifiedExperience extends ItemBase{ @SubscribeEvent public void onEntityDropEvent(LivingDropsEvent event){ - if(event.getEntityLiving().worldObj != null && !event.getEntityLiving().worldObj.isRemote && event.getSource().getEntity() instanceof EntityPlayer){ - //Drop Solidified XP - if(event.getEntityLiving() instanceof EntityCreature){ - if(Util.RANDOM.nextInt(10) <= event.getLootingLevel()*2){ - event.getEntityLiving().entityDropItem(new ItemStack(InitItems.itemSolidifiedExperience, Util.RANDOM.nextInt(2+event.getLootingLevel())+1), 0); + if(ConfigBoolValues.DO_XP_DROPS.isEnabled()){ + if(event.getEntityLiving().worldObj != null && !event.getEntityLiving().worldObj.isRemote && event.getSource().getEntity() instanceof EntityPlayer){ + //Drop Solidified XP + if(event.getEntityLiving() instanceof EntityCreature){ + if(Util.RANDOM.nextInt(10) <= event.getLootingLevel()*2){ + event.getEntityLiving().entityDropItem(new ItemStack(InitItems.itemSolidifiedExperience, Util.RANDOM.nextInt(2+event.getLootingLevel())+1), 0); + } } } }