From 3247af26e03126aef007f48285dfdb9fd325c895 Mon Sep 17 00:00:00 2001 From: DStrand1 Date: Sat, 4 Sep 2021 20:13:12 -0500 Subject: [PATCH] most work on first ZenExpansion --- .../crafttweaker/CTMaterialBuilder.java | 15 +- .../crafttweaker/CTMaterialHelpers.java | 31 +++ .../crafttweaker/MaterialExpansion.java | 199 ++++++++++++++++++ .../MaterialPropertyExpansion.java | 21 ++ .../api/unification/material/Material.java | 49 ++--- .../material/properties/BlastProperty.java | 6 +- .../material/properties/DustProperty.java | 5 - .../material/properties/FluidProperty.java | 21 -- .../material/properties/GemProperty.java | 2 - .../material/properties/IngotProperty.java | 2 - .../material/properties/PlasmaProperty.java | 9 - .../material/properties/ToolProperty.java | 15 -- 12 files changed, 280 insertions(+), 95 deletions(-) create mode 100644 src/main/java/gregtech/api/unification/crafttweaker/CTMaterialHelpers.java create mode 100644 src/main/java/gregtech/api/unification/crafttweaker/MaterialExpansion.java create mode 100644 src/main/java/gregtech/api/unification/crafttweaker/MaterialPropertyExpansion.java diff --git a/src/main/java/gregtech/api/unification/crafttweaker/CTMaterialBuilder.java b/src/main/java/gregtech/api/unification/crafttweaker/CTMaterialBuilder.java index 5a0df11e607..d8badca6d98 100644 --- a/src/main/java/gregtech/api/unification/crafttweaker/CTMaterialBuilder.java +++ b/src/main/java/gregtech/api/unification/crafttweaker/CTMaterialBuilder.java @@ -1,11 +1,9 @@ package gregtech.api.unification.crafttweaker; -import com.google.common.collect.ImmutableList; import crafttweaker.annotations.ZenRegister; import gregtech.api.unification.Element; import gregtech.api.unification.Elements; import gregtech.api.unification.material.Material; -import gregtech.api.unification.material.Material.FluidType; import gregtech.api.unification.material.info.MaterialFlag; import gregtech.api.unification.material.info.MaterialIconSet; import gregtech.api.unification.stack.MaterialStack; @@ -13,6 +11,9 @@ import stanhebben.zenscript.annotations.ZenClass; import stanhebben.zenscript.annotations.ZenMethod; +import static gregtech.api.unification.crafttweaker.CTMaterialHelpers.validateComponentList; +import static gregtech.api.unification.crafttweaker.CTMaterialHelpers.validateFluidType; + @ZenClass("mods.gregtech.material.MaterialBuilder") @ZenRegister @SuppressWarnings("unused") @@ -163,14 +164,4 @@ public CTMaterialBuilder itemPipeProperties(int priority, float stacksPerSec) { public Material build() { return backingBuilder.build(); } - - private static ImmutableList validateComponentList(MaterialStack[] components) { - return components == null || components.length == 0 ? ImmutableList.of() : ImmutableList.copyOf(components); - } - - private static FluidType validateFluidType(String fluidTypeName) { - if (fluidTypeName == null || fluidTypeName.equals("fluid")) return FluidType.FLUID; - else if (fluidTypeName.equals("gas")) return FluidType.GAS; - else throw new IllegalArgumentException("Fluid Type must be either \"fluid\" or \"gas\"!"); - } } diff --git a/src/main/java/gregtech/api/unification/crafttweaker/CTMaterialHelpers.java b/src/main/java/gregtech/api/unification/crafttweaker/CTMaterialHelpers.java new file mode 100644 index 00000000000..2dfd333b5a6 --- /dev/null +++ b/src/main/java/gregtech/api/unification/crafttweaker/CTMaterialHelpers.java @@ -0,0 +1,31 @@ +package gregtech.api.unification.crafttweaker; + +import com.google.common.collect.ImmutableList; +import crafttweaker.CraftTweakerAPI; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.MaterialRegistry; +import gregtech.api.unification.stack.MaterialStack; + +public class CTMaterialHelpers { + + protected static ImmutableList validateComponentList(MaterialStack[] components) { + return components == null || components.length == 0 ? ImmutableList.of() : ImmutableList.copyOf(components); + } + + protected static Material.FluidType validateFluidType(String fluidTypeName) { + if (fluidTypeName == null || fluidTypeName.equals("fluid")) return Material.FluidType.FLUID; + else if (fluidTypeName.equals("gas")) return Material.FluidType.GAS; + else throw new IllegalArgumentException("Fluid Type must be either \"fluid\" or \"gas\"!"); + } + + protected static boolean checkFrozen(String description) { + if (MaterialRegistry.isFrozen()) { + CraftTweakerAPI.logError("Cannot " + description + " now, must be done in a file labeled with \"#loader gregtech\""); + return true; + } return false; + } + + protected static void logError(Material m, String cause, String type) { + CraftTweakerAPI.logError("Cannot " + cause + " of a Material with no " + type + "! Try calling \"add" + type + "\" in your \"#loader gregtech\" file first if this is intentional. Material: " + m.getUnlocalizedName()); + } +} diff --git a/src/main/java/gregtech/api/unification/crafttweaker/MaterialExpansion.java b/src/main/java/gregtech/api/unification/crafttweaker/MaterialExpansion.java new file mode 100644 index 00000000000..2346cfa66e0 --- /dev/null +++ b/src/main/java/gregtech/api/unification/crafttweaker/MaterialExpansion.java @@ -0,0 +1,199 @@ +package gregtech.api.unification.crafttweaker; + +import crafttweaker.CraftTweakerAPI; +import crafttweaker.annotations.ZenRegister; +import crafttweaker.api.enchantments.IEnchantment; +import crafttweaker.api.liquid.ILiquidDefinition; +import crafttweaker.api.minecraft.CraftTweakerMC; +import gregtech.api.GTValues; +import gregtech.api.enchants.EnchantmentData; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.info.MaterialFlag; +import gregtech.api.unification.material.info.MaterialIconSet; +import gregtech.api.unification.material.properties.*; +import net.minecraft.enchantment.Enchantment; +import stanhebben.zenscript.annotations.Optional; +import stanhebben.zenscript.annotations.ZenExpansion; +import stanhebben.zenscript.annotations.ZenGetter; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.unification.crafttweaker.CTMaterialHelpers.checkFrozen; +import static gregtech.api.unification.crafttweaker.CTMaterialHelpers.logError; + +@ZenExpansion("mods.gregtech.material.Material") +@ZenRegister +@SuppressWarnings("unused") +public class MaterialExpansion { + + // Basic Material methods + @ZenMethod + public static void setFormula(Material m, String formula, @Optional boolean withFormatting) { + if (checkFrozen("set material chemical formula")) return; + m.setFormula(formula, withFormatting); + } + + @ZenMethod + public static boolean hasFlag(Material m, String flagName) { + return m.hasFlag(MaterialFlag.getByName(flagName)); + } + + @ZenMethod + public static void setIconSet(Material m, String iconSetName) { + if (checkFrozen("set material icon set")) return; + m.setMaterialIconSet(MaterialIconSet.getByName(iconSetName)); + } + + // Fluid Property + @ZenMethod + public static boolean hasFluid(Material m) { // todo move? + return m.hasProperty(PropertyKey.FLUID); + } + + @ZenMethod + public static boolean isGaseous(Material m) { + FluidProperty prop = m.getProperty(PropertyKey.FLUID); + return prop != null && prop.isGas(); + } + + @ZenMethod + public static void setFluidTemperature(Material m, int fluidTemperature) { + if (checkFrozen("set fluid temperature")) return; + FluidProperty prop = m.getProperty(PropertyKey.FLUID); + if (prop != null) { + prop.setFluidTemperature(fluidTemperature); + } else logError(m, "set temperature", "Fluid"); + } + + @ZenGetter("fluidTemperature") // todo is this allowed here? + public static int fluidTemperature(Material m) { + FluidProperty prop = m.getProperty(PropertyKey.FLUID); + if (prop != null) { + return prop.getFluidTemperature(); + } else logError(m, "get temperature", "Fluid"); + return 0; + } + + // TODO May need to move this to Material + @ZenGetter("fluid") + @net.minecraftforge.fml.common.Optional.Method(modid = GTValues.MODID_CT) + public static ILiquidDefinition getFluid(Material m) { + FluidProperty prop = m.getProperty(PropertyKey.FLUID); + if (prop != null) { + return CraftTweakerMC.getILiquidDefinition(prop.getFluid()); + } else logError(m, "get a Fluid", "Fluid"); + return null; + } + + // Dust Property + @ZenGetter("harvestLevel") + public static int harvestLevel(Material m) { + DustProperty prop = m.getProperty(PropertyKey.DUST); + if (prop != null) { + return prop.getHarvestLevel(); + } else logError(m, "get the harvest level", "Dust"); + return 0; + } + + @ZenGetter("burnTime") + public static int burnTime(Material m) { + DustProperty prop = m.getProperty(PropertyKey.DUST); + if (prop != null) { + return prop.getBurnTime(); + } else logError(m, "get the burn time", "Dust"); + return 0; + } + + @ZenMethod + public static void setHarvestLevel(Material m, int harvestLevel) { + if (checkFrozen("set harvest level")) return; + DustProperty prop = m.getProperty(PropertyKey.DUST); + if (prop != null) { + prop.setHarvestLevel(harvestLevel); + } else logError(m, "set the harvest level", "Dust"); + } + + @ZenMethod + public static void setBurnTime(Material m, int burnTime) { + if (checkFrozen("set burn time")) return; + DustProperty prop = m.getProperty(PropertyKey.DUST); + if (prop != null) { + prop.setBurnTime(burnTime); + } else logError(m, "set the burn time", "Dust"); + } + + // Ingot Property todo + + // Plasma Property + @ZenGetter("plasma") + @net.minecraftforge.fml.common.Optional.Method(modid = GTValues.MODID_CT) + public static ILiquidDefinition getPlasma(Material m) { + PlasmaProperty prop = m.getProperty(PropertyKey.PLASMA); + if (prop != null) { + return CraftTweakerMC.getILiquidDefinition(prop.getPlasma()); + } else logError(m, "get a Plasma", "Plasma"); + return null; + } + + // Tool Property + @ZenGetter("toolSpeed") + public static float toolSpeed(Material m) { + ToolProperty prop = m.getProperty(PropertyKey.TOOL); + if (prop != null) { + return prop.toolSpeed; + } else logError(m, "get the tool speed", "Tool"); + return 0; + } + + @ZenGetter("toolAttackDamage") + public static float attackDamage(Material m) { + ToolProperty prop = m.getProperty(PropertyKey.TOOL); + if (prop != null) { + return prop.toolAttackDamage; + } else logError(m, "get the tool attack damage", "Tool"); + return 0; + } + + @ZenGetter("toolDurability") + public static int toolDurability(Material m) { + ToolProperty prop = m.getProperty(PropertyKey.TOOL); + if (prop != null) { + return prop.toolDurability; + } else logError(m, "get the tool durability", "Tool"); + return 0; + } + + @ZenGetter("toolEnchantability") + public static int toolEnchant(Material m) { + ToolProperty prop = m.getProperty(PropertyKey.TOOL); + if (prop != null) { + return prop.toolEnchantability; + } else logError(m, "get the tool enchantability", "Tool"); + return 0; + } + + @ZenMethod + @net.minecraftforge.fml.common.Optional.Method(modid = GTValues.MODID_CT) + public static void addToolEnchantment(Material m, IEnchantment enchantment) { + if (checkFrozen("add tool enchantment")) return; + ToolProperty prop = m.getProperty(PropertyKey.TOOL); + if (prop != null) { + Enchantment enchantmentType = (Enchantment) enchantment.getDefinition().getInternal(); + prop.toolEnchantments.add(new EnchantmentData(enchantmentType, enchantment.getLevel())); + } else logError(m, "change tool enchantments", "Tool"); + } + + // Wire/Item Pipe/Fluid Pipe stuff? + + // Blast Property + @ZenMethod + public static void setBlastTemp(Material m, int blastTemp) { + if (checkFrozen("set blast temperature")) return; + if (blastTemp <= 0) { + CraftTweakerAPI.logError("Blast Temperature must be greater than zero! Material: " + m.getUnlocalizedName()); + return; + } + BlastProperty prop = m.getProperty(PropertyKey.BLAST); + if (prop != null) prop.setBlastTemperature(blastTemp); + else m.setProperty(PropertyKey.BLAST, new BlastProperty(blastTemp)); + } +} diff --git a/src/main/java/gregtech/api/unification/crafttweaker/MaterialPropertyExpansion.java b/src/main/java/gregtech/api/unification/crafttweaker/MaterialPropertyExpansion.java new file mode 100644 index 00000000000..8ac08925370 --- /dev/null +++ b/src/main/java/gregtech/api/unification/crafttweaker/MaterialPropertyExpansion.java @@ -0,0 +1,21 @@ +package gregtech.api.unification.crafttweaker; + +import crafttweaker.annotations.ZenRegister; +import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.properties.PropertyKey; +import stanhebben.zenscript.annotations.ZenExpansion; +import stanhebben.zenscript.annotations.ZenMethod; + +@ZenExpansion("mods.gregtech.material.Material") +@ZenRegister +@SuppressWarnings("unused") +public class MaterialPropertyExpansion { + + // Property Checkers and Setters + @ZenMethod + public static boolean hasBlastTemp(Material m) { + return m.hasProperty(PropertyKey.BLAST); + } + + // TODO +} diff --git a/src/main/java/gregtech/api/unification/material/Material.java b/src/main/java/gregtech/api/unification/material/Material.java index 307afdb41d1..42c6aa237f9 100644 --- a/src/main/java/gregtech/api/unification/material/Material.java +++ b/src/main/java/gregtech/api/unification/material/Material.java @@ -3,6 +3,7 @@ import com.google.common.base.CaseFormat; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; +import crafttweaker.annotations.ZenRegister; import gregtech.api.unification.Element; import gregtech.api.unification.Elements; import gregtech.api.unification.material.info.MaterialFlag; @@ -15,8 +16,7 @@ import net.minecraft.enchantment.Enchantment; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; -import stanhebben.zenscript.annotations.OperatorType; -import stanhebben.zenscript.annotations.ZenOperator; +import stanhebben.zenscript.annotations.*; import javax.annotation.Nonnull; import java.util.ArrayList; @@ -24,8 +24,8 @@ import java.util.Collection; import java.util.List; -//@ZenClass("mods.gregtech.material.Material") -//@ZenRegister +@ZenClass("mods.gregtech.material.Material") +@ZenRegister public class Material implements Comparable { /** @@ -72,7 +72,7 @@ private String calculateChemicalFormula() { return ""; } - //@ZenGetter + @ZenGetter public String getChemicalFormula() { return chemicalFormula; } @@ -111,13 +111,13 @@ protected void registerMaterial(Material material) { MaterialRegistry.register(this); } + @ZenMethod public void addFlag(MaterialFlag... flags) { if (MaterialRegistry.isFrozen()) throw new IllegalStateException("Cannot add flag to material when registry is frozen!"); this.flags.addFlags(flags).verify(this); } - //@ZenMethod("hasFlagRaw") public boolean hasFlag(MaterialFlag flag) { return flags.hasFlag(flag); } @@ -126,12 +126,6 @@ public boolean hasFlags(MaterialFlag... flags) { return Arrays.stream(flags).allMatch(this::hasFlag); } - //@ZenMethod - //public boolean hasFlag(String flagName) { - // long materialFlagId = MaterialFlags.resolveFlag(flagName, getClass()); - // return hasFlag(materialFlagId); - //} - protected void calculateDecompositionType() { if (!materialInfo.componentList.isEmpty() && !hasFlag(MaterialFlags.DECOMPOSITION_BY_CENTRIFUGING) && @@ -168,17 +162,16 @@ public int getHarvestLevel() { return getProperty(PropertyKey.DUST).getHarvestLevel(); } - //@ZenMethod + @ZenMethod public void setMaterialRGB(int materialRGB) { materialInfo.color = materialRGB; } - //@ZenGetter + @ZenGetter public int getMaterialRGB() { return materialInfo.color; } - //@ZenMethod public void setMaterialIconSet(MaterialIconSet materialIconSet) { materialInfo.iconSet = materialIconSet; } @@ -187,7 +180,7 @@ public MaterialIconSet getMaterialIconSet() { return materialInfo.iconSet; } - //@ZenGetter("radioactive") + @ZenGetter("radioactive") public boolean isRadioactive() { if (materialInfo.element != null) return materialInfo.element.halfLifeSeconds >= 0; @@ -196,7 +189,7 @@ public boolean isRadioactive() { return false; } - //@ZenGetter("protons") + @ZenGetter("protons") public long getProtons() { if (materialInfo.element != null) return materialInfo.element.getProtons(); @@ -209,7 +202,7 @@ public long getProtons() { return totalProtons; } - //@ZenGetter("neutrons") + @ZenGetter("neutrons") public long getNeutrons() { if (materialInfo.element != null) return materialInfo.element.getNeutrons(); @@ -222,7 +215,7 @@ public long getNeutrons() { return totalNeutrons; } - //@ZenGetter("mass") + @ZenGetter("mass") public long getMass() { if (materialInfo.element != null) return materialInfo.element.getMass(); @@ -235,7 +228,7 @@ public long getMass() { return totalMass; } - //@ZenGetter("averageProtons") + @ZenGetter("averageProtons") public long getAverageProtons() { if (materialInfo.element != null) return materialInfo.element.getProtons(); @@ -249,7 +242,7 @@ public long getAverageProtons() { return totalProtons / totalAmount; } - //@ZenGetter("averageNeutrons") + @ZenGetter("averageNeutrons") public long getAverageNeutrons() { if (materialInfo.element != null) return materialInfo.element.getNeutrons(); @@ -264,7 +257,7 @@ public long getAverageNeutrons() { } - //@ZenGetter("averageMass") + @ZenGetter("averageMass") public long getAverageMass() { if (materialInfo.element != null) return materialInfo.element.getMass(); @@ -278,7 +271,7 @@ public long getAverageMass() { return totalMass / totalAmount; } - //@ZenGetter("blastTemperature") + @ZenGetter("blastTemperature") public int getBlastTemperature() { BlastProperty prop = properties.getProperty(PropertyKey.BLAST); return prop == null ? 0 : prop.getBlastTemperature(); @@ -289,29 +282,29 @@ public FluidStack getPlasma(int amount) { return prop == null ? null : prop.getPlasma(amount); } - //@ZenGetter("camelCaseName") + @ZenGetter("camelCaseName") public String toCamelCaseString() { return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, toString()); } - //@ZenGetter("unlocalizedName") + @ZenGetter("unlocalizedName") public String getUnlocalizedName() { return "material." + materialInfo.name; } - //@ZenGetter("localizedName") + @ZenGetter("localizedName") public String getLocalizedName() { return LocalizationUtils.format(getUnlocalizedName()); } @Override - //@ZenMethod + @ZenMethod public int compareTo(Material material) { return toString().compareTo(material.toString()); } @Override - //@ZenGetter("name") + @ZenGetter("name") public String toString() { return materialInfo.name; } diff --git a/src/main/java/gregtech/api/unification/material/properties/BlastProperty.java b/src/main/java/gregtech/api/unification/material/properties/BlastProperty.java index c0b8424ccdf..63149fce86e 100644 --- a/src/main/java/gregtech/api/unification/material/properties/BlastProperty.java +++ b/src/main/java/gregtech/api/unification/material/properties/BlastProperty.java @@ -10,7 +10,7 @@ public class BlastProperty implements IMaterialProperty { * If a Material with this Property has a Fluid, its temperature * will be set to this if it is the default Fluid temperature. */ - private final int blastTemperature; + private int blastTemperature; public BlastProperty(int blastTemperature) { this.blastTemperature = blastTemperature; @@ -27,6 +27,10 @@ public int getBlastTemperature() { return blastTemperature; } + public void setBlastTemperature(int blastTemp) { + this.blastTemperature = blastTemp; + } + @Override public void verifyProperty(MaterialProperties properties) { properties.ensureSet(PropertyKey.INGOT, true); diff --git a/src/main/java/gregtech/api/unification/material/properties/DustProperty.java b/src/main/java/gregtech/api/unification/material/properties/DustProperty.java index 75e8fcf1099..ba46d1cbcce 100644 --- a/src/main/java/gregtech/api/unification/material/properties/DustProperty.java +++ b/src/main/java/gregtech/api/unification/material/properties/DustProperty.java @@ -1,7 +1,5 @@ package gregtech.api.unification.material.properties; -//@ZenClass("mods.gregtech.material.DustMaterial") -//@ZenRegister public class DustProperty implements IMaterialProperty { /** @@ -9,7 +7,6 @@ public class DustProperty implements IMaterialProperty { *

* Default: 2 (Iron). */ - //@ZenProperty private int harvestLevel; /** @@ -18,7 +15,6 @@ public class DustProperty implements IMaterialProperty { *

* Default: 0. */ - //@ZenProperty private int burnTime; public DustProperty(int harvestLevel, int burnTime) { @@ -33,7 +29,6 @@ public DustProperty() { this(2, 0); } - //@ZenMethod public void setHarvestLevel(int harvestLevel) { this.harvestLevel = harvestLevel; } diff --git a/src/main/java/gregtech/api/unification/material/properties/FluidProperty.java b/src/main/java/gregtech/api/unification/material/properties/FluidProperty.java index 5d6b7bf5a2c..b3401ea66f2 100644 --- a/src/main/java/gregtech/api/unification/material/properties/FluidProperty.java +++ b/src/main/java/gregtech/api/unification/material/properties/FluidProperty.java @@ -1,17 +1,11 @@ package gregtech.api.unification.material.properties; import com.google.common.base.Preconditions; -import crafttweaker.api.liquid.ILiquidDefinition; -import crafttweaker.api.minecraft.CraftTweakerMC; -import gregtech.api.GTValues; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fml.common.Optional; import javax.annotation.Nonnull; -//@ZenClass("mods.gregtech.material.FluidMaterial") -//@ZenRegister public class FluidProperty implements IMaterialProperty { public static final int BASE_TEMP = 300; @@ -37,12 +31,6 @@ public FluidProperty() { this(false, false); } - //@ZenGetter("hasFluid") - public boolean shouldGenerateFluid() { - return true; - } - - //@ZenGetter("isGaseous") public boolean isGas() { return isGas; } @@ -68,24 +56,15 @@ public FluidStack getFluid(int amount) { return new FluidStack(fluid, amount); } - //@ZenMethod("setFluidTemperature") public void setFluidTemperature(int fluidTemperature) { Preconditions.checkArgument(fluidTemperature > 0, "Invalid temperature"); this.fluidTemperature = fluidTemperature; } - //@ZenGetter("fluidTemperature") public int getFluidTemperature() { return fluidTemperature; } - //@ZenGetter("fluid") - @Optional.Method(modid = GTValues.MODID_CT) - @Nonnull - public ILiquidDefinition ctGetFluid() { - return CraftTweakerMC.getILiquidDefinition(fluid); - } - @Override public void verifyProperty(MaterialProperties properties) { if (properties.hasProperty(PropertyKey.PLASMA)) { diff --git a/src/main/java/gregtech/api/unification/material/properties/GemProperty.java b/src/main/java/gregtech/api/unification/material/properties/GemProperty.java index 66ebb08e94b..2da41ef073a 100644 --- a/src/main/java/gregtech/api/unification/material/properties/GemProperty.java +++ b/src/main/java/gregtech/api/unification/material/properties/GemProperty.java @@ -1,7 +1,5 @@ package gregtech.api.unification.material.properties; -//@ZenClass("mods.gregtech.material.GemMaterial") -//@ZenRegister public class GemProperty implements IMaterialProperty { @Override diff --git a/src/main/java/gregtech/api/unification/material/properties/IngotProperty.java b/src/main/java/gregtech/api/unification/material/properties/IngotProperty.java index 88162984844..8a6ceb8e773 100644 --- a/src/main/java/gregtech/api/unification/material/properties/IngotProperty.java +++ b/src/main/java/gregtech/api/unification/material/properties/IngotProperty.java @@ -4,8 +4,6 @@ import javax.annotation.Nullable; -//@ZenClass("mods.gregtech.material.IngotMaterial") -//@ZenRegister public class IngotProperty implements IMaterialProperty { /** diff --git a/src/main/java/gregtech/api/unification/material/properties/PlasmaProperty.java b/src/main/java/gregtech/api/unification/material/properties/PlasmaProperty.java index 5848fea7187..0678400184a 100644 --- a/src/main/java/gregtech/api/unification/material/properties/PlasmaProperty.java +++ b/src/main/java/gregtech/api/unification/material/properties/PlasmaProperty.java @@ -1,9 +1,6 @@ package gregtech.api.unification.material.properties; import com.google.common.base.Preconditions; -import crafttweaker.api.liquid.ILiquidDefinition; -import crafttweaker.api.minecraft.CraftTweakerMC; -import gregtech.api.GTValues; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; @@ -36,10 +33,4 @@ public Fluid getPlasma() { public FluidStack getPlasma(int amount) { return new FluidStack(plasma, amount); } - - //@ZenGetter("plasma") - @net.minecraftforge.fml.common.Optional.Method(modid = GTValues.MODID_CT) - public ILiquidDefinition ctGetPlasma() { - return CraftTweakerMC.getILiquidDefinition(plasma); - } } diff --git a/src/main/java/gregtech/api/unification/material/properties/ToolProperty.java b/src/main/java/gregtech/api/unification/material/properties/ToolProperty.java index c3c7eb29717..a99d7b2e82c 100644 --- a/src/main/java/gregtech/api/unification/material/properties/ToolProperty.java +++ b/src/main/java/gregtech/api/unification/material/properties/ToolProperty.java @@ -1,10 +1,7 @@ package gregtech.api.unification.material.properties; -import crafttweaker.api.enchantments.IEnchantment; -import gregtech.api.GTValues; import gregtech.api.enchants.EnchantmentData; import net.minecraft.enchantment.Enchantment; -import net.minecraftforge.fml.common.Optional; import java.util.ArrayList; import java.util.List; @@ -16,7 +13,6 @@ public class ToolProperty implements IMaterialProperty { *

* Default: */ - //@ZenProperty public final float toolSpeed; /** @@ -24,7 +20,6 @@ public class ToolProperty implements IMaterialProperty { *

* Default: */ - //@ZenProperty public final float toolAttackDamage; /** @@ -32,7 +27,6 @@ public class ToolProperty implements IMaterialProperty { *

* Default: */ - //@ZenProperty public final int toolDurability; /** @@ -40,7 +34,6 @@ public class ToolProperty implements IMaterialProperty { *

* Default: */ - //@ZenProperty public final int toolEnchantability; /** @@ -48,7 +41,6 @@ public class ToolProperty implements IMaterialProperty { *

* Default: none. */ - //@ZenProperty public final List toolEnchantments = new ArrayList<>(); public ToolProperty(float toolSpeed, float toolAttackDamage, int toolDurability, int toolEnchantability) { @@ -73,11 +65,4 @@ public void verifyProperty(MaterialProperties properties) { public void addEnchantmentForTools(Enchantment enchantment, int level) { toolEnchantments.add(new EnchantmentData(enchantment, level)); } - - //@ZenMethod("addToolEnchantment") - @Optional.Method(modid = GTValues.MODID_CT) - public void ctAddEnchantmentForTools(IEnchantment enchantment) { - Enchantment enchantmentType = (Enchantment) enchantment.getDefinition().getInternal(); - toolEnchantments.add(new EnchantmentData(enchantmentType, enchantment.getLevel())); - } }