mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 20:52:26 +00:00
fix lots of rendering mappings. rename toolmaterial to ttoolmaterial to avoid conflicts w/ a SRG name for something in vanilla
This commit is contained in:
1 parent
f7a86a7377
commit
ab73bafc15
28 files changed
+140
-139
No files matched your search
@@ -16,7 +16,7 @@ import tconstruct.library.tools.BowstringMaterial;
|
||||
import tconstruct.library.tools.CustomMaterial;
|
||||
import tconstruct.library.tools.FletchingMaterial;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.library.tools.ToolMaterial;
|
||||
import tconstruct.library.tools.TToolMaterial;
|
||||
import tconstruct.library.util.TabTools;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -206,8 +206,8 @@ public class TConstructRegistry
|
||||
}
|
||||
|
||||
//Materials
|
||||
public static HashMap<Integer, ToolMaterial> toolMaterials = new HashMap<Integer, ToolMaterial>(40);
|
||||
public static HashMap<String, ToolMaterial> toolMaterialStrings = new HashMap<String, ToolMaterial>(40);
|
||||
public static HashMap<Integer, TToolMaterial> toolMaterials = new HashMap<Integer, TToolMaterial>(40);
|
||||
public static HashMap<String, TToolMaterial> toolMaterialStrings = new HashMap<String, TToolMaterial>(40);
|
||||
|
||||
/** Adds a tool material to the registry
|
||||
*
|
||||
@@ -226,10 +226,10 @@ public class TConstructRegistry
|
||||
public static void addToolMaterial (int materialID, String materialName, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, float stonebound,
|
||||
String style, String ability)
|
||||
{
|
||||
ToolMaterial mat = toolMaterials.get(materialID);
|
||||
TToolMaterial mat = toolMaterials.get(materialID);
|
||||
if (mat == null)
|
||||
{
|
||||
mat = new ToolMaterial(materialName, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, stonebound, style, ability);
|
||||
mat = new TToolMaterial(materialName, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, stonebound, style, ability);
|
||||
toolMaterials.put(materialID, mat);
|
||||
toolMaterialStrings.put(materialName, mat);
|
||||
}
|
||||
@@ -255,10 +255,10 @@ public class TConstructRegistry
|
||||
public static void addToolMaterial (int materialID, String materialName, String displayName, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced,
|
||||
float stonebound, String style, String ability)
|
||||
{
|
||||
ToolMaterial mat = toolMaterials.get(materialID);
|
||||
TToolMaterial mat = toolMaterials.get(materialID);
|
||||
if (mat == null)
|
||||
{
|
||||
mat = new ToolMaterial(materialName, displayName, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, stonebound, style, ability);
|
||||
mat = new TToolMaterial(materialName, displayName, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, stonebound, style, ability);
|
||||
toolMaterials.put(materialID, mat);
|
||||
toolMaterialStrings.put(materialName, mat);
|
||||
}
|
||||
@@ -273,9 +273,9 @@ public class TConstructRegistry
|
||||
* @param material Complete tool material to add. Uses the name in the material for lookup purposes.
|
||||
*/
|
||||
|
||||
public static void addtoolMaterial (int materialID, ToolMaterial material)
|
||||
public static void addtoolMaterial (int materialID, TToolMaterial material)
|
||||
{
|
||||
ToolMaterial mat = toolMaterials.get(materialID);
|
||||
TToolMaterial mat = toolMaterials.get(materialID);
|
||||
if (mat == null)
|
||||
{
|
||||
toolMaterials.put(materialID, mat);
|
||||
@@ -291,7 +291,7 @@ public class TConstructRegistry
|
||||
* @return Tool Material
|
||||
*/
|
||||
|
||||
public static ToolMaterial getMaterial (int key)
|
||||
public static TToolMaterial getMaterial (int key)
|
||||
{
|
||||
return (toolMaterials.get(key));
|
||||
}
|
||||
@@ -302,7 +302,7 @@ public class TConstructRegistry
|
||||
* @return Tool Material
|
||||
*/
|
||||
|
||||
public static ToolMaterial getMaterial (String key)
|
||||
public static TToolMaterial getMaterial (String key)
|
||||
{
|
||||
return (toolMaterialStrings.get(key));
|
||||
}
|
||||
@@ -520,7 +520,8 @@ public class TConstructRegistry
|
||||
|
||||
static void initializeDrawbridgeState ()
|
||||
{
|
||||
drawbridgeState[Blocks.stone] = 1;
|
||||
//TODO fix this mess and move to TMech
|
||||
/* drawbridgeState[Blocks.stone] = 1;
|
||||
drawbridgeState[Blocks.grass] = 1;
|
||||
drawbridgeState[Blocks.dirt] = 1;
|
||||
drawbridgeState[Blocks.cobblestone] = 1;
|
||||
@@ -674,6 +675,7 @@ public class TConstructRegistry
|
||||
drawbridgeState[Blocks.dropper] = 3;
|
||||
interchangableBlockMapping[Blocks.dirt] = Blocks.grass;
|
||||
interchangableBlockMapping[Blocks.grass] = Blocks.dirt;
|
||||
*/
|
||||
}
|
||||
|
||||
static
|
||||
|
||||
@@ -17,7 +17,7 @@ import tconstruct.library.armor.ArmorCore;
|
||||
import tconstruct.library.armor.ArmorMod;
|
||||
import tconstruct.library.event.ToolCraftEvent;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.library.tools.ToolMaterial;
|
||||
import tconstruct.library.tools.TToolMaterial;
|
||||
import tconstruct.library.tools.ToolMod;
|
||||
import tconstruct.library.util.IToolPart;
|
||||
|
||||
@@ -196,7 +196,7 @@ public class ToolBuilder
|
||||
if (item == null)
|
||||
return null;
|
||||
|
||||
ToolMaterial headMat = null, handleMat = null, accessoryMat = null, extraMat = null;
|
||||
TToolMaterial headMat = null, handleMat = null, accessoryMat = null, extraMat = null;
|
||||
headMat = TConstructRegistry.getMaterial(head);
|
||||
handleMat = TConstructRegistry.getMaterial(handle);
|
||||
|
||||
@@ -332,7 +332,7 @@ public class ToolBuilder
|
||||
compound.getCompoundTag("display").setString("Name", "\u00A7f" + name);
|
||||
}
|
||||
|
||||
ToolCraftEvent.NormalTool event = new ToolCraftEvent.NormalTool(item, compound, new ToolMaterial[] { headMat, handleMat, accessoryMat, extraMat });
|
||||
ToolCraftEvent.NormalTool event = new ToolCraftEvent.NormalTool(item, compound, new TToolMaterial[] { headMat, handleMat, accessoryMat, extraMat });
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
|
||||
if (event.getResult() == Result.DEFAULT)
|
||||
@@ -449,7 +449,7 @@ public class ToolBuilder
|
||||
return null;
|
||||
}
|
||||
|
||||
int buildReinforced (ToolMaterial headMat, ToolMaterial handleMat, ToolMaterial accessoryMat, ToolMaterial extraMat)
|
||||
int buildReinforced (TToolMaterial headMat, TToolMaterial handleMat, TToolMaterial accessoryMat, TToolMaterial extraMat)
|
||||
{
|
||||
int reinforced = 0;
|
||||
|
||||
@@ -474,7 +474,7 @@ public class ToolBuilder
|
||||
return reinforced;
|
||||
}
|
||||
|
||||
float buildShoddy (ToolMaterial headMat, ToolMaterial handleMat, ToolMaterial accessoryMat, ToolMaterial extraMat)
|
||||
float buildShoddy (TToolMaterial headMat, TToolMaterial handleMat, TToolMaterial accessoryMat, TToolMaterial extraMat)
|
||||
{
|
||||
float sHead = headMat.shoddy();
|
||||
float sHandle = handleMat.shoddy();
|
||||
|
||||
@@ -2,7 +2,7 @@ package tconstruct.library.event;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.library.tools.ToolMaterial;
|
||||
import tconstruct.library.tools.TToolMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@@ -14,10 +14,10 @@ public class ToolCraftEvent extends Event
|
||||
{
|
||||
public final ToolCore tool;
|
||||
public final NBTTagCompound toolTag;
|
||||
public final ToolMaterial[] materials;
|
||||
public final TToolMaterial[] materials;
|
||||
protected ItemStack resultStack;
|
||||
|
||||
public ToolCraftEvent(ToolCore tool, NBTTagCompound toolTag, ToolMaterial[] materials)
|
||||
public ToolCraftEvent(ToolCore tool, NBTTagCompound toolTag, TToolMaterial[] materials)
|
||||
{
|
||||
this.tool = tool;
|
||||
this.toolTag = toolTag;
|
||||
@@ -27,7 +27,7 @@ public class ToolCraftEvent extends Event
|
||||
@HasResult
|
||||
public static class NormalTool extends ToolCraftEvent
|
||||
{
|
||||
public NormalTool(ToolCore tool, NBTTagCompound toolTag, ToolMaterial[] materials)
|
||||
public NormalTool(ToolCore tool, NBTTagCompound toolTag, TToolMaterial[] materials)
|
||||
{
|
||||
super(tool, toolTag, materials);
|
||||
}
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@ package tconstruct.library.tools;
|
||||
/*
|
||||
* Dynamic substitute for an enum. It carries a lot of information
|
||||
*/
|
||||
public class ToolMaterial
|
||||
public class TToolMaterial
|
||||
{
|
||||
//mining level, durability, mining speed, baseDamage, handle modifier, Reinforced level, shoddy/spiny level, color/style on name
|
||||
|
||||
@@ -19,12 +19,12 @@ public class ToolMaterial
|
||||
public final String tipStyle;
|
||||
public final String ability;
|
||||
|
||||
public ToolMaterial(String name, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style, String ability)
|
||||
public TToolMaterial(String name, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style, String ability)
|
||||
{
|
||||
this(name, name + " ", level, durability, speed, damage, handle, reinforced, stonebound, style, ability);
|
||||
}
|
||||
|
||||
public ToolMaterial(String name, String displayName, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style, String ability)
|
||||
public TToolMaterial(String name, String displayName, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style, String ability)
|
||||
{
|
||||
this.materialName = name;
|
||||
this.displayName = displayName;
|
||||
@@ -68,7 +68,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
public static IIcon blankSprite;
|
||||
public static IIcon emptyIcon;
|
||||
|
||||
public ToolCore( int baseDamage)
|
||||
public ToolCore(int baseDamage)
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
@@ -425,10 +425,10 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
|
||||
public String getReinforcedName (int head, int handle, int accessory, int extra, int unbreaking)
|
||||
{
|
||||
ToolMaterial headMat = TConstructRegistry.getMaterial(head);
|
||||
ToolMaterial handleMat = TConstructRegistry.getMaterial(handle);
|
||||
ToolMaterial accessoryMat = TConstructRegistry.getMaterial(accessory);
|
||||
ToolMaterial extraMat = TConstructRegistry.getMaterial(extra);
|
||||
TToolMaterial headMat = TConstructRegistry.getMaterial(TToolMaterial)head);
|
||||
TToolMaterial handleMat = TConstructRegistry.getMaterial(handle);
|
||||
TToolMaterial accessoryMat = TConstructRegistry.getMaterial(accessory);
|
||||
TToolMaterial extraMat = TConstructRegistry.getMaterial(extra);
|
||||
|
||||
int reinforced = 0;
|
||||
String style = "";
|
||||
@@ -455,7 +455,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
}
|
||||
if (getPartAmount() >= 4)
|
||||
{
|
||||
current = extraMat.reinforced();
|
||||
current = extraMat.reinforced();
|
||||
if (current > 0 && current > reinforced)
|
||||
{
|
||||
style = extraMat.style();
|
||||
@@ -527,7 +527,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
while (iter.hasNext())
|
||||
{
|
||||
Map.Entry pairs = (Map.Entry) iter.next();
|
||||
ToolMaterial material = (ToolMaterial) pairs.getValue();
|
||||
TToolMaterial material = (TToolMaterial) pairs.getValue();
|
||||
buildTool((Integer) pairs.getKey(), material.displayName, list);
|
||||
}
|
||||
}
|
||||
@@ -844,8 +844,6 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
return tags.getCompoundTag("InfiTool").getInteger("Damage");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Battlegear support, IBattlegearWeapon */
|
||||
|
||||
@Override
|
||||
@@ -961,6 +959,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
}
|
||||
return tags.getInteger("Energy");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored (ItemStack container)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user