Skip to content

Commit

Permalink
remove old CT file
Browse files Browse the repository at this point in the history
  • Loading branch information
DStrand1 committed Sep 5, 2021
1 parent 561c32a commit be1cab6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 97 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import crafttweaker.annotations.ZenRegister;
import crafttweaker.zenscript.IBracketHandler;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.MaterialRegistry;
import stanhebben.zenscript.compiler.IEnvironmentGlobal;
import stanhebben.zenscript.expression.ExpressionCallStatic;
import stanhebben.zenscript.expression.ExpressionString;
Expand All @@ -25,7 +26,7 @@ public MaterialBracketHandler() {
}

public static Material getMaterial(String name) {
return name == null ? null : CTMaterialRegistry.get(name);
return name == null ? null : MaterialRegistry.get(name);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
package gregtech.api.unification.material;

import com.google.common.collect.Lists;
import crafttweaker.annotations.ZenRegister;
import gregtech.api.util.GTControlledRegistry;
import gregtech.api.util.GTLog;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;

import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;

@ZenClass("mods.gregtech.material.MaterialRegistry")
@ZenRegister
public class MaterialRegistry {

private MaterialRegistry() {
Expand Down Expand Up @@ -39,4 +46,15 @@ private static void postVerify(Material material) {
public static void register(Material material) {
DEFERRED_REGISTRY.add(material);
}

@ZenMethod
@Nullable
public static Material get(String name) {
return MATERIAL_REGISTRY.getObject(name);
}

@ZenMethod
public static List<Material> getAllMaterials() {
return Lists.newArrayList(MATERIAL_REGISTRY);
}
}

0 comments on commit be1cab6

Please sign in to comment.