Colored frying pans

- Added colored frying pans
- Switched frying pans to using the itemstack sensitive container item
since the non-sensitive version was deprecated.
This commit is contained in:
Arthur Uzulin committed 2014-09-09 19:54:50 +10:00
1 parent 80efde613a
commit 2f44669d52
5 files changed
+72 -28

No files matched your search

@@ -245,12 +245,12 @@ public class TConstructRegistry
* Spiny.
*/
public static void addToolMaterial (int materialID, String materialName, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, float stonebound, String style)
public static void addToolMaterial (int materialID, String materialName, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, float stonebound, String style, int primaryColor)
{
ToolMaterial mat = toolMaterials.get(materialID);
if (mat == null)
{
mat = new ToolMaterial(materialName, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, stonebound, style);
mat = new ToolMaterial(materialName, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, stonebound, style, primaryColor);
toolMaterials.put(materialID, mat);
toolMaterialStrings.put(materialName, mat);
}
@@ -258,6 +258,13 @@ public class TConstructRegistry
throw new IllegalArgumentException("[TCon API] Material ID " + materialID + " is already occupied by " + mat.materialName);
}
@Deprecated
public static void addToolMaterial (int materialID, String materialName, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, float stonebound, String style)
{
logger.warn("[TCon API] Using deprecated addToolMaterial with no primary color. A fallback of white will be used.");
addToolMaterial(materialID, materialName, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, stonebound, style, 0xFFFFFF);
}
@Deprecated
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)
{
@@ -16,6 +16,7 @@ public class ToolMaterial
public final int reinforced;
public final float stonebound;
public final String tipStyle;
public final int primaryColor;
@Deprecated
public String displayName;
@@ -25,7 +26,7 @@ public class ToolMaterial
@Deprecated
public ToolMaterial(String name, String displayName, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style, String ability)
{
this(name, level, durability, speed, damage, handle, reinforced, stonebound, style);
this(name, level, durability, speed, damage, handle, reinforced, stonebound, style, 0xFFFFFF);
this.displayName = prefixName();
this.ability = ability();
}
@@ -33,12 +34,12 @@ public class ToolMaterial
@Deprecated
public ToolMaterial(String name, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style, String ability)
{
this(name, level, durability, speed, damage, handle, reinforced, stonebound, style);
this(name, level, durability, speed, damage, handle, reinforced, stonebound, style, 0xFFFFFF);
this.displayName = prefixName();
this.ability = ability();
}
public ToolMaterial(String name, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style)
public ToolMaterial(String name, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style, int primaryColor)
{
this.materialName = name;
this.harvestLevel = level;
@@ -49,6 +50,7 @@ public class ToolMaterial
this.reinforced = reinforced;
this.stonebound = stonebound;
this.tipStyle = style;
this.primaryColor = primaryColor;
}
public String name ()
@@ -109,6 +111,11 @@ public class ToolMaterial
return this.tipStyle;
}
public int primaryColor ()
{
return this.primaryColor;
}
/**
* Returns the ability of the tool to display.
* ONLY USE THIS FOR DISPLAY PURPOSES. It is not data you can rely on. Use the material-ids for that.