From c00f2c812f500b29096f92acee76d35bf1a58c56 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 24 Dec 2016 17:24:16 +0100 Subject: [PATCH] bland mode --- .../mod/config/values/ConfigBoolValues.java | 3 ++- .../mod/event/ClientEvents.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) 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 00d8dc66d..607a451be 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 @@ -50,7 +50,8 @@ public enum ConfigBoolValues{ LASER_RELAY_LOSS("Laser Relay Energy Loss", ConfigCategories.MACHINE_VALUES, true, "If Energy Laser Relays should have energy loss"), - 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.)"); + 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?"); public final String name; public final String category; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java index 307e29a90..51f70a8e7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java @@ -30,6 +30,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.client.event.RenderGameOverlayEvent; @@ -40,6 +41,8 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.OreDictionary; +import java.util.Locale; + @SideOnly(Side.CLIENT) public class ClientEvents{ @@ -130,6 +133,21 @@ public class ClientEvents{ } } } + + //Be da bland + if(ConfigBoolValues.MOST_BLAND_PERSON_EVER.isEnabled()){ + ItemStack stack = event.getItemStack(); + if(StackUtil.isValid(stack)){ + ResourceLocation regName = stack.getItem().getRegistryName(); + if(regName != null){ + if(regName.toString().toLowerCase(Locale.ROOT).contains(ModUtil.MOD_ID)){ + if(event.getToolTip().size() > 0){ + event.getToolTip().set(0, TextFormatting.RESET+event.getToolTip().get(0)); + } + } + } + } + } } @SubscribeEvent