From 12ef852517230cb415bff372d8eb758334ce9e7c Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Tue, 6 Sep 2016 03:28:48 +1000 Subject: + Added some MultiPickaxes. % Improved a few aspects of the Tunnel Digger pickaxe. $ Tried fixing some bad names with spaces where they should be. --- src/Java/miscutil/core/util/Utils.java | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/Java/miscutil/core/util/Utils.java') diff --git a/src/Java/miscutil/core/util/Utils.java b/src/Java/miscutil/core/util/Utils.java index cbd488afab..24236b0e0a 100644 --- a/src/Java/miscutil/core/util/Utils.java +++ b/src/Java/miscutil/core/util/Utils.java @@ -1,5 +1,6 @@ package miscutil.core.util; +import gregtech.api.enums.Materials; import gregtech.api.enums.TC_Aspects; import gregtech.api.enums.TC_Aspects.TC_AspectStack; import ic2.core.IC2Potion; @@ -32,6 +33,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.util.MathHelper; @@ -496,6 +498,40 @@ public class Utils { } return null; } + + public static String sanitizeString(String input){ + String temp; + String output; + + temp = input.replace(" ", ""); + temp = temp.replace("-", ""); + temp = temp.replace("_", ""); + temp = temp.replace("?", ""); + temp = temp.replace("!", ""); + temp = temp.replace("@", ""); + temp = temp.replace("#", ""); + temp = temp.replace("(", ""); + temp = temp.replace(")", ""); + temp = temp.replace("{", ""); + temp = temp.replace("}", ""); + temp = temp.replace("[", ""); + temp = temp.replace("]", ""); + output = temp; + return output; + + } + + public static ToolMaterial generateMaterialFromGT(Materials gtMaterial){ + String name = gtMaterial.name(); + int harvestLevel = gtMaterial.mToolQuality; + int durability = gtMaterial.mDurability; + float damage = gtMaterial.mToolQuality; + int efficiency = (int) gtMaterial.mToolSpeed; + int enchantability = gtMaterial.mEnchantmentToolsLevel; + ToolMaterial temp = EnumHelper.addToolMaterial(name, harvestLevel, durability, efficiency, damage, enchantability); + return temp; + + } } -- cgit