Updated ToolStats based on new TConstruct API
ToolMaterial constructor in TConstruct API was updated to have a color passed in instead of an ability. Old set method was kept but marked as deprecated in case users have existing scripts.
This commit is contained in:
parent
c98ea2f454
commit
4cff02c675
1 changed files with 12 additions and 2 deletions
|
@ -14,10 +14,20 @@ import tconstruct.library.tools.ToolMaterial;
|
||||||
|
|
||||||
@ZenClass("mods.tconstruct.ToolStats")
|
@ZenClass("mods.tconstruct.ToolStats")
|
||||||
public class ToolStats {
|
public class ToolStats {
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
@java.lang.Deprecated
|
||||||
@ZenMethod
|
@ZenMethod
|
||||||
public static void set(String material, @Optional String name, int level, int durability, int speed, int damage, double handle, int reinforced, double stonebound, String style, String ability) {
|
public static void set(String material, @Optional String name, int level, int durability, int speed, int damage, double handle, int reinforced, double stonebound, String style, String ability) {
|
||||||
if (name == null) name = material + " ";
|
if (name == null) name = material + " ";
|
||||||
MineTweakerAPI.apply(new SetToolStats(material, "", new ToolMaterial(material, name, level, durability, speed, damage, (float) handle, reinforced, (float) stonebound, style, ability)));
|
MineTweakerAPI.apply(new SetToolStats(material, "", new ToolMaterial(material, name, level, durability, speed, damage, (float) handle, reinforced, (float) stonebound, style, 0xFFFFFF)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ZenMethod
|
||||||
|
public static void set(String material, @Optional String name, int level, int durability, int speed, int damage, double handle, int reinforced, double stonebound, String style, int primaryColor) {
|
||||||
|
if (name == null) name = material + " ";
|
||||||
|
MineTweakerAPI.apply(new SetToolStats(material, "", new ToolMaterial(material, name, level, durability, speed, damage, (float) handle, reinforced, (float) stonebound, style, primaryColor)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ZenMethod
|
@ZenMethod
|
||||||
|
@ -94,7 +104,7 @@ public class ToolStats {
|
||||||
fresh = (ToolMaterial) value;
|
fresh = (ToolMaterial) value;
|
||||||
} else {
|
} else {
|
||||||
ToolMaterial t = (ToolMaterial) old;
|
ToolMaterial t = (ToolMaterial) old;
|
||||||
fresh = new ToolMaterial(t.materialName, t.displayName, t.harvestLevel, t.durability, t.miningspeed, t.attack, t.handleModifier, t.reinforced, t.stonebound, t.tipStyle, t.ability);
|
fresh = new ToolMaterial(t.materialName, t.localizationString, t.harvestLevel, t.durability, t.miningspeed, t.attack, t.handleModifier, t.reinforced, t.stonebound, t.tipStyle, t.primaryColor);
|
||||||
ReflectionHelper.setPrivateValue(ToolMaterial.class, fresh, field, value);
|
ReflectionHelper.setPrivateValue(ToolMaterial.class, fresh, field, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue