From f24c0b770570cbce475205fd48f3813bd3fce9b9 Mon Sep 17 00:00:00 2001 From: Shadows_of_Fire Date: Fri, 5 Oct 2018 02:19:07 -0400 Subject: [PATCH] Closes #1185 --- .../mod/config/values/ConfigBoolValues.java | 4 +++- .../mod/items/ItemSolidifiedExperience.java | 10 +++++++--- 2 files changed, 10 insertions(+), 4 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 fc836b17a..9bf744d9d 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 @@ -56,7 +56,9 @@ public enum ConfigBoolValues{ SUPER_DUPER_HARD_MODE("Super Duper Hard Recipes", ConfigCategories.OTHER, false, "Turn this on to make recipes for items from the mod really hard. (This is a joke feature poking fun at the whole FTB Infinity Expert Mode style of playing. You shouldn't really turn this on as it makes the mod completely unplayable.)"), MOST_BLAND_PERSON_EVER("No Colored Item Names", ConfigCategories.OTHER, false, "If you want to be really boring and lame, you can turn on this setting to disable colored names on Actually Additions items. Because why would you want things to look pretty anyways, right?"), - COLOR_LENS_USES_OREDICT("Color Lens Oredict", ConfigCategories.OTHER, false, "If true, the Lens of Color will attempt to pull from the oredict instead of only using vanilla dyes."); + COLOR_LENS_USES_OREDICT("Color Lens Oredict", ConfigCategories.OTHER, false, "If true, the Lens of Color will attempt to pull from the oredict instead of only using vanilla dyes."), + SOLID_XP_ALWAYS_ORBS("Solid XP Orbs", ConfigCategories.OTHER, false, "If true, Solidified Experience will always spawn orbs, even for regular players."); + public final String name; public final String category; 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 6b8dd8a92..3e9396374 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java @@ -24,6 +24,7 @@ import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -69,9 +70,12 @@ public class ItemSolidifiedExperience extends ItemBase{ } } - EntityXPOrb orb = new EntityXPOrb(world, player.posX+0.5, player.posY+0.5, player.posZ+0.5, amount); - orb.getEntityData().setBoolean(ActuallyAdditions.MODID+"FromSolidified", true); - world.spawnEntity(orb); + if(ConfigBoolValues.SOLID_XP_ALWAYS_ORBS.currentValue || player instanceof FakePlayer) { + EntityXPOrb orb = new EntityXPOrb(world, player.posX+0.5, player.posY+0.5, player.posZ+0.5, amount); + orb.getEntityData().setBoolean(ActuallyAdditions.MODID+"FromSolidified", true); + world.spawnEntity(orb); + } + else player.addExperience(amount); } return new ActionResult<>(EnumActionResult.SUCCESS, stack); }