Skip to content

Commit

Permalink
add some missed CT material stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss committed Sep 6, 2021
1 parent d088a7f commit 3767821
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ public static void setIconSet(Material m, String iconSetName) {
m.setMaterialIconSet(MaterialIconSet.getByName(iconSetName));
}

@ZenGetter("iconSet")
public static String getIconSet(Material m) {
return m.getMaterialIconSet().getName();
}

////////////////////////////////////
// Fluid Property //
////////////////////////////////////

@ZenMethod
public static boolean hasFluid(Material m) { // todo move?
return m.hasProperty(PropertyKey.FLUID);
}

@ZenMethod
@ZenGetter
public static boolean isGaseous(Material m) {
FluidProperty prop = m.getProperty(PropertyKey.FLUID);
return prop != null && prop.isGas();
Expand Down Expand Up @@ -196,6 +196,18 @@ public static void addToolEnchantment(Material m, IEnchantment enchantment) {
} else logError(m, "change tool enchantments", "Tool");
}

@ZenMethod
public static void setToolStats(Material m, float toolSpeed, float toolAttackDamage, int toolDurability, @Optional int enchantability) {
if (checkFrozen("set tool stats")) return;
ToolProperty prop = m.getProperty(PropertyKey.TOOL);
if (prop != null) {
prop.setToolSpeed(toolSpeed);
prop.setToolAttackDamage(toolAttackDamage);
prop.setToolDurability(toolDurability);
prop.setToolEnchantability(enchantability == 0 ? 10 : enchantability);
} else logError(m, "change tool stats", "Tool");
}

// Wire/Item Pipe/Fluid Pipe stuff?

////////////////////////////////////
Expand All @@ -213,4 +225,13 @@ public static void setBlastTemp(Material m, int blastTemp) {
if (prop != null) prop.setBlastTemperature(blastTemp);
else m.setProperty(PropertyKey.BLAST, new BlastProperty(blastTemp));
}

@ZenGetter
public static int blastTemp(Material m) {
BlastProperty prop = m.getProperty(PropertyKey.BLAST);
if (prop != null) {
return prop.getBlastTemperature();
} else logError(m, "get blast temperature", "Blast");
return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void setMaterialRGB(int materialRGB) {
materialInfo.color = materialRGB;
}

@ZenGetter
@ZenGetter("materialRGB")
public int getMaterialRGB() {
return materialInfo.color;
}
Expand Down

0 comments on commit 3767821

Please sign in to comment.