resourceConstructor) {
+ if (this.defaultResource == null) {
+ this.defaultResource = (MaterialResource) resourceConstructor.apply(this);
+ }
+
+ return this.defaultResource;
+ }
+
@Accessors(chain = true)
public static class MaterialInfo {
/**
- * 此材料的modid和未本地化名称。
- *
- * 必需项。
- */
- @Getter
- private final Identifier Identifier;
-
- /**
- * 此材料的颜色。
- * 如果索引0之后的任何颜色值为-1,则表示未使用。
- *
- * 默认值:若无成分则为0xFFFFFF,否则将为成分的平均值。
+ * 材料的ID
*/
@Getter
- @Setter
- private IntList colors = new IntArrayList(List.of(-1, -1));
-
+ private final Identifier identifier;
/**
- * 此材料的流体颜色是否启用。
- *
- * 默认值:true
+ * 材料的贴图层级颜色
*/
@Getter
@Setter
- private boolean hasFluidColor = true;
-
- /**
- * 此材料的成分列表。
- *
- * 默认值:无。
- */
+ private Map colors = new HashMap<>();
@Getter
@Setter
private ImmutableList componentList;
-
- /**
- * 此材料的图标集。
- *
- * 默认值:- 若具有GemProperty则为GEM_VERTICAL。
- * - 若具有DustProperty或IngotProperty则为DULL。
- */
@Getter
@Setter
private MaterialIconSet iconSet;
-
- /**
- * 此材料的元素(如果是直接元素)。
- *
- * 默认值:无。
- */
@Getter
@Setter
private Element element;
- public MaterialInfo(Identifier Identifier) {
- this.Identifier = Identifier;
+ public MaterialInfo(@NotNull Identifier identifier) {
+ this.identifier = identifier;
+ colors.put(MaterialIconLayer.BaseLayer, -1);
}
- public void verifyInfo(MaterialProperties p, boolean averageRGB) {
- // Verify IconSet
-
- if (iconSet == null) {
- if (p.hasProperty(PropertyKey.FLUID)) {
- iconSet = BreaMaterialIconSet.FLUID;
- } else iconSet = BreaMaterialIconSet.DULL;
- }
-
- // Verify MaterialRGB
- if (colors.getInt(0) == -1) {
+ public void verifyInfo(MaterialAttributeSet attributeSet, boolean averageRGB) {
+ if (iconSet == null)
+ iconSet = attributeSet.hasAttribute(AttributeType.FLUID) ? MaterialIconSet.FLUID : MaterialIconSet.DEFAULT;
+ if (colors.get(MaterialIconLayer.BaseLayer) == -1) {
if (!averageRGB || componentList.isEmpty())
- colors.set(0, 0xFFFFFF);
+ colors.put(MaterialIconLayer.BaseLayer, 0xFFFFFF);
else {
long colorTemp = 0;
long divisor = 0;
- for (MaterialStack stack : componentList) {
- colorTemp += stack.material().getMaterialARGB() * stack.amount();
+ for (var stack : componentList) {
+ colorTemp += stack.getMaterial().getMaterialARBG() * stack.amount();
divisor += stack.amount();
}
- colors.set(0, BreaMath.saturatedCast(colorTemp / divisor));
+ colors.put(MaterialIconLayer.BaseLayer, BreaMath.saturatedCast(colorTemp / divisor));
}
}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/attributes/AttributeType.java b/src/main/java/net/phasetranscrystal/breacore/api/material/attributes/AttributeType.java
new file mode 100644
index 0000000..365a150
--- /dev/null
+++ b/src/main/java/net/phasetranscrystal/breacore/api/material/attributes/AttributeType.java
@@ -0,0 +1,73 @@
+package net.phasetranscrystal.breacore.api.material.attributes;
+
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Optional;
+import java.util.function.Supplier;
+
+public class AttributeType {
+
+ public static final AttributeType GENERAL = new AttributeType<>("general", GeneralAttribute.class, GeneralAttribute::new);
+ public static final AttributeType FLUID = new AttributeType<>("fluid", FluidAttribute.class, FluidAttribute::new);
+ @SuppressWarnings("ClassEscapesDefinedScope")
+ public static final AttributeType EMPTY = new AttributeType<>("empty", PlaceholderAttribute.class, PlaceholderAttribute::new);
+ private final String key;
+ private final Class type;
+ private final Supplier defaultSupplier;
+
+ public AttributeType(String key, Class type) {
+ this.key = key;
+ this.type = type;
+ defaultSupplier = null;
+ }
+
+ public AttributeType(String key, Class type, @NotNull Supplier defaultSupplier) {
+ this.key = key;
+ this.type = type;
+ this.defaultSupplier = defaultSupplier;
+ }
+
+ protected String getKey() {
+ return key;
+ }
+
+ protected Optional constructDefault() {
+ try {
+ return Optional.ofNullable(defaultSupplier).map(Supplier::get);
+ } catch (Exception e) {
+ return Optional.empty();
+ }
+ }
+
+ public T cast(MaterialAttribute property) {
+ return this.type.cast(property);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof AttributeType) {
+ return ((AttributeType>) o).getKey().equals(key);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return key.hashCode();
+ }
+
+ @Override
+ public String toString() {
+ return key;
+ }
+
+ private static class PlaceholderAttribute implements MaterialAttribute {
+
+ private PlaceholderAttribute() {}
+
+ @Override
+ public boolean canBeAddedTo(MaterialAttributeSet currentSet) {
+ return true;
+ }
+ }
+}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/attributes/FluidAttribute.java b/src/main/java/net/phasetranscrystal/breacore/api/material/attributes/FluidAttribute.java
new file mode 100644
index 0000000..e0b2aac
--- /dev/null
+++ b/src/main/java/net/phasetranscrystal/breacore/api/material/attributes/FluidAttribute.java
@@ -0,0 +1,9 @@
+package net.phasetranscrystal.breacore.api.material.attributes;
+
+public class FluidAttribute implements MaterialAttribute {
+
+ @Override
+ public boolean canBeAddedTo(MaterialAttributeSet currentSet) {
+ return true;
+ }
+}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/property/DustProperty.java b/src/main/java/net/phasetranscrystal/breacore/api/material/attributes/GeneralAttribute.java
similarity index 76%
rename from src/main/java/net/phasetranscrystal/breacore/api/material/property/DustProperty.java
rename to src/main/java/net/phasetranscrystal/breacore/api/material/attributes/GeneralAttribute.java
index 4628701..75fd363 100644
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/property/DustProperty.java
+++ b/src/main/java/net/phasetranscrystal/breacore/api/material/attributes/GeneralAttribute.java
@@ -1,11 +1,8 @@
-package net.phasetranscrystal.breacore.api.material.property;
+package net.phasetranscrystal.breacore.api.material.attributes;
import lombok.Getter;
-/**
- * 材料的基本性质 如挖掘等级,燃烧时间
- */
-public class DustProperty implements IMaterialProperty {
+public class GeneralAttribute implements MaterialAttribute {
/**
* 采集此材料方块所需的工具等级。
@@ -14,7 +11,6 @@ public class DustProperty implements IMaterialProperty {
*/
@Getter
private int harvestLevel;
-
/**
* 此材料作为熔炉燃料时的燃烧时间。
* 零或负值表示此材料不能用作燃料。
@@ -30,7 +26,7 @@ public class DustProperty implements IMaterialProperty {
* @param harvestLevel 挖掘等级
* @param burnTime 燃烧时间
*/
- public DustProperty(int harvestLevel, int burnTime) {
+ public GeneralAttribute(int harvestLevel, int burnTime) {
this.harvestLevel = harvestLevel;
this.burnTime = burnTime;
}
@@ -38,7 +34,7 @@ public DustProperty(int harvestLevel, int burnTime) {
/**
* 默认属性构造方法。
*/
- public DustProperty() {
+ public GeneralAttribute() {
this(2, 0);
}
@@ -53,5 +49,7 @@ public void setBurnTime(int burnTime) {
}
@Override
- public void verifyProperty(MaterialProperties properties) {}
+ public boolean canBeAddedTo(MaterialAttributeSet currentSet) {
+ return true;
+ }
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/attributes/MaterialAttribute.java b/src/main/java/net/phasetranscrystal/breacore/api/material/attributes/MaterialAttribute.java
new file mode 100644
index 0000000..d7e602f
--- /dev/null
+++ b/src/main/java/net/phasetranscrystal/breacore/api/material/attributes/MaterialAttribute.java
@@ -0,0 +1,17 @@
+package net.phasetranscrystal.breacore.api.material.attributes;
+
+import java.util.Optional;
+import java.util.Set;
+
+public interface MaterialAttribute {
+
+ boolean canBeAddedTo(MaterialAttributeSet currentSet);
+
+ default Set> getRequiredTypes() {
+ return Set.of();
+ }
+
+ default Optional createDependency(AttributeType type) {
+ return Optional.empty();
+ }
+}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/attributes/MaterialAttributeSet.java b/src/main/java/net/phasetranscrystal/breacore/api/material/attributes/MaterialAttributeSet.java
new file mode 100644
index 0000000..75247af
--- /dev/null
+++ b/src/main/java/net/phasetranscrystal/breacore/api/material/attributes/MaterialAttributeSet.java
@@ -0,0 +1,58 @@
+package net.phasetranscrystal.breacore.api.material.attributes;
+
+import net.phasetranscrystal.breacore.api.material.Material;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.*;
+
+public class MaterialAttributeSet {
+
+ private final Map, MaterialAttribute> attributeMap;
+ @Getter
+ @Setter
+ private Material material;
+
+ public MaterialAttributeSet() {
+ this.attributeMap = new HashMap<>();
+ this.attributeMap.put(AttributeType.EMPTY, AttributeType.EMPTY.constructDefault().orElseThrow());
+ }
+
+ public boolean isEmpty() {
+ return attributeMap.isEmpty();
+ }
+
+ public T getAttribute(AttributeType key) {
+ return key.cast(attributeMap.get(key));
+ }
+
+ public boolean hasAttribute(AttributeType key) {
+ return attributeMap.get(key) != null;
+ }
+
+ public void setAttribute(AttributeType key, T value) {
+ if (value == null)
+ throw new IllegalArgumentException("Material Attribute cannot be null");
+ if (attributeMap.containsKey(key))
+ throw new IllegalArgumentException("Material Attribute " + key.toString() + " already registered!");
+ if (!value.canBeAddedTo(this))
+ throw new IllegalArgumentException("Material Attribute " + key.toString() + " cannot be added to!");
+ for (var type : value.getRequiredTypes()) {
+ if (attributeMap.containsKey(type)) continue;
+ var def = type.constructDefault();
+ if (def.isEmpty())
+ def = value.createDependency(type);
+ var dep = def.orElseThrow(() -> new IllegalArgumentException("Material Attribute " + key.toString() + " cannot be constructed!"));
+ attributeMap.put(key, dep);
+ attributeMap.remove(AttributeType.EMPTY);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ attributeMap.forEach((k, v) -> sb.append(k.toString()).append("\n"));
+ return sb.toString();
+ }
+}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialFlag.java b/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialFlag.java
deleted file mode 100644
index 595a7de..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialFlag.java
+++ /dev/null
@@ -1,216 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.info;
-
-import net.phasetranscrystal.breacore.BreakdownCore;
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.api.material.property.PropertyKey;
-
-import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * 表示定义材料特殊特性或行为的材料标志。
- * 标志可以依赖于其他标志,并要求特定的材料属性。
- *
- * 标志在全局注册表中注册,可以通过名称检索。
- * 通常使用 {@link Builder} 构建器模式进行构建。
- *
- *
- * @see Material
- * @see PropertyKey
- * @see Builder
- */
-public class MaterialFlag {
-
- /**
- * 所有材料标志的全局注册表。
- */
- private static final Set FLAG_REGISTRY = new HashSet<>();
-
- /**
- * 此标志的唯一名称。
- */
- private final String name;
-
- /**
- * 应用此标志时必须存在的标志集合。
- */
- private final Set requiredFlags;
-
- /**
- * 应用此标志时材料必须具有的属性集合。
- */
- private final Set> requiredProperties;
-
- /**
- * 使用指定参数构造新的 MaterialFlag。
- *
- * @param name 标志的唯一名称
- * @param requiredFlags 存在此标志时所需的依赖标志
- * @param requiredProperties 存在此标志时所需的属性
- */
- private MaterialFlag(String name, Set requiredFlags, Set> requiredProperties) {
- this.name = name;
- this.requiredFlags = requiredFlags;
- this.requiredProperties = requiredProperties;
- FLAG_REGISTRY.add(this);
- }
-
- /**
- * 通过名称从注册表中检索标志。
- *
- * 搜索不区分大小写。
- *
- *
- * @param name 要查找的标志名称
- * @return 找到的标志,如果不存在该名称的标志则返回 {@code null}
- */
- public static MaterialFlag getByName(String name) {
- return FLAG_REGISTRY.stream().filter(f -> f.toString().equalsIgnoreCase(name)).findFirst().orElse(null);
- }
-
- /**
- * 验证材料是否满足此标志的所有要求。
- *
- * 检查所需属性,并递归验证所有依赖标志。
- * 对于任何缺失的要求,记录警告信息。
- *
- *
- * @param material 要验证的材料
- * @return 包含此标志及其所有已通过材料验证的传递性依赖的集合
- * @throws NullPointerException 如果材料为 null
- */
- protected Set verifyFlag(Material material) {
- requiredProperties.forEach(key -> {
- if (!material.hasProperty(key)) {
- BreakdownCore.LOGGER.warn("材料 {} 不具有标志 {} 所需的属性 {}!",
- material.getUnlocalizedName(), this.name, key.toString());
- }
- });
-
- Set thisAndDependencies = new HashSet<>(requiredFlags);
- requiredFlags.stream()
- .map(f -> f.verifyFlag(material))
- .forEach(thisAndDependencies::addAll);
-
- return thisAndDependencies;
- }
-
- /**
- * 返回此标志的名称。
- *
- * @return 标志名称
- */
- @Override
- public String toString() {
- return this.name;
- }
-
- /**
- * 将此标志与另一对象进行相等性比较。
- *
- * 如果两个标志具有相同的名称,则认为它们相等。
- *
- *
- * @param o 要比较的对象
- * @return 如果对象相等则返回 {@code true},否则返回 {@code false}
- */
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- MaterialFlag that = (MaterialFlag) o;
- return name.equals(that.name);
- }
-
- /**
- * 根据名称返回此标志的哈希码值。
- *
- * @return 此标志的哈希码值
- */
- @Override
- public int hashCode() {
- return name.hashCode();
- }
-
- /**
- * 用于通过流畅API创建 {@link MaterialFlag} 实例的构建器。
- *
- * 此构建器允许在构造最终不可变的 MaterialFlag 实例之前指定所需的标志和属性。
- *
- *
- * @see MaterialFlag
- */
- public static class Builder {
-
- /**
- * 正在构建的标志的名称。
- */
- final String name;
-
- /**
- * 正在构建的标志所需的依赖标志。
- */
- final Set requiredFlags = new ObjectOpenHashSet<>();
-
- /**
- * 正在构建的标志所需的属性。
- */
- final Set> requiredProperties = new ObjectOpenHashSet<>();
-
- /**
- * 为具有指定名称的标志创建一个新的构建器。
- *
- * @param name 要构建的标志的名称
- * @throws NullPointerException 如果名称为 null
- */
- public Builder(String name) {
- this.name = name;
- }
-
- /**
- * 添加应用此标志时必须存在的依赖标志。
- *
- * 应用此标志时,材料必须具有所有指定的依赖标志。
- *
- *
- * @param flags 所需的依赖标志
- * @return 此构建器以支持方法链式调用
- * @throws NullPointerException 如果 flags 或任何元素为 null
- */
- public Builder requireFlags(MaterialFlag... flags) {
- requiredFlags.addAll(Arrays.asList(flags));
- return this;
- }
-
- /**
- * 添加应用此标志时材料必须具有的属性。
- *
- * 应用此标志时,材料必须具有所有指定的属性。
- *
- *
- * @param propertyKeys 所需的属性
- * @return 此构建器以支持方法链式调用
- * @throws NullPointerException 如果 propertyKeys 或任何元素为 null
- */
- public Builder requireProps(PropertyKey>... propertyKeys) {
- requiredProperties.addAll(Arrays.asList(propertyKeys));
- return this;
- }
-
- /**
- * 使用此构建器中指定的配置构造并注册一个新的 {@link MaterialFlag}。
- *
- * 一旦构建完成,标志将自动添加到全局注册表中,并且无法再修改。
- *
- *
- * @return 新创建的 MaterialFlag
- * @throws IllegalStateException 如果已存在具有相同名称的标志
- */
- public MaterialFlag build() {
- return new MaterialFlag(name, requiredFlags, requiredProperties);
- }
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialFlags.java b/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialFlags.java
deleted file mode 100644
index 0163f45..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialFlags.java
+++ /dev/null
@@ -1,286 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.info;
-
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.api.material.property.PropertyKey;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-/**
- * 材料标志
- * 用于批量生成数数据包内容
- */
-public class MaterialFlags {
-
- /**
- * 添加到材料以完全禁用其统一化处理
- */
- public static final MaterialFlag DISABLE_MATERIAL_RECIPES = new MaterialFlag.Builder("disable_material_recipes")
- .build();
- /**
- * 启用电解机分解配方生成
- */
- public static final MaterialFlag DECOMPOSITION_BY_ELECTROLYZING = new MaterialFlag.Builder(
- "decomposition_by_electrolyzing").build();
- /**
- * 启用离心机分解配方生成
- */
- public static final MaterialFlag DECOMPOSITION_BY_CENTRIFUGING = new MaterialFlag.Builder(
- "decomposition_by_centrifuging").build();
- /**
- * 禁用此材料的分解配方生成
- */
- public static final MaterialFlag DISABLE_DECOMPOSITION = new MaterialFlag.Builder("disable_decomposition").build();
- /**
- * 添加到材料,表示其为某种爆炸物
- */
- public static final MaterialFlag EXPLOSIVE = new MaterialFlag.Builder("explosive").build();
-
- /////////////////
- // GENERIC //
- /////////////////
- /**
- * 添加到材料,表示其为某种易燃物
- */
- public static final MaterialFlag FLAMMABLE = new MaterialFlag.Builder("flammable").build();
- /**
- * 添加到材料,表示其为某种粘性物
- */
- public static final MaterialFlag STICKY = new MaterialFlag.Builder("sticky").build();
- /**
- * 添加到材料,表示其为某种磷光物
- */
- public static final MaterialFlag PHOSPHORESCENT = new MaterialFlag.Builder("phosphorescent").build();
- /**
- * 为此材料生成板
- * 如果是粉尘材料,将生成粉尘压缩机配方制作板
- * 如果是金属材料,将生成弯曲机配方
- * 如果找到方块,还会生成切割机配方
- */
- public static final MaterialFlag GENERATE_PLATE = new MaterialFlag.Builder("generate_plate")
- .requireProps(PropertyKey.DUST)
- .build();
- public static final MaterialFlag GENERATE_DENSE = new MaterialFlag.Builder("generate_dense")
- .requireFlags(GENERATE_PLATE)
- .requireProps(PropertyKey.DUST)
- .build();
- public static final MaterialFlag GENERATE_ROD = new MaterialFlag.Builder("generate_rod")
- .requireProps(PropertyKey.DUST)
- .build();
- public static final MaterialFlag GENERATE_BOLT_SCREW = new MaterialFlag.Builder("generate_bolt_screw")
- .requireFlags(GENERATE_ROD)
- .requireProps(PropertyKey.DUST)
- .build();
- public static final MaterialFlag GENERATE_FRAME = new MaterialFlag.Builder("generate_frame")
- .requireFlags(GENERATE_ROD)
- .requireProps(PropertyKey.DUST)
- .build();
-
- //////////////////
- // 粉尘 //
- //////////////////
- public static final MaterialFlag GENERATE_GEAR = new MaterialFlag.Builder("generate_gear")
- .requireFlags(GENERATE_PLATE, GENERATE_ROD)
- .requireProps(PropertyKey.DUST)
- .build();
- public static final MaterialFlag GENERATE_LONG_ROD = new MaterialFlag.Builder("generate_long_rod")
- .requireFlags(GENERATE_ROD)
- .requireProps(PropertyKey.DUST)
- .build();
- public static final MaterialFlag GENERATE_SPRING = new MaterialFlag.Builder("generate_spring")
- .requireFlags(GENERATE_LONG_ROD)
- .requireProps(PropertyKey.INGOT)
- .build();
- public static final MaterialFlag FORCE_GENERATE_BLOCK = new MaterialFlag.Builder("force_generate_block")
- .requireProps(PropertyKey.DUST)
- .build();
- /**
- * 这将阻止材料创建粉尘与方块之间的无序合成配方,
- * 同时阻止通过SHAPE_EXTRUDING/MOLD_BLOCK的挤出和合金冶炼配方。
- */
- public static final MaterialFlag EXCLUDE_BLOCK_CRAFTING_RECIPES = new MaterialFlag.Builder(
- "exclude_block_crafting_recipes")
- .requireProps(PropertyKey.DUST)
- .build();
- /**
- * 排除板材压缩机配方
- */
- public static final MaterialFlag EXCLUDE_PLATE_COMPRESSOR_RECIPE = new MaterialFlag.Builder(
- "exclude_plate_compressor_recipe")
- .requireFlags(GENERATE_PLATE)
- .requireProps(PropertyKey.DUST)
- .build();
- /**
- * 这将阻止材料创建粉尘与方块之间的无序合成配方。
- */
- public static final MaterialFlag EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES = new MaterialFlag.Builder(
- "exclude_block_crafting_by_hand_recipes")
- .requireProps(PropertyKey.DUST)
- .build();
- /**
- * 添加到材料表示可用研钵研磨
- */
- public static final MaterialFlag MORTAR_GRINDABLE = new MaterialFlag.Builder("mortar_grindable")
- .requireProps(PropertyKey.DUST)
- .build();
- /**
- * 添加到材料表示除粉碎或熔炼外无法通过其他方式加工。用于涂层材料。
- */
- public static final MaterialFlag NO_WORKING = new MaterialFlag.Builder("no_working")
- .requireProps(PropertyKey.DUST)
- .build();
- /**
- * 添加到材料表示无法进行常规金属加工,因为无法弯曲。
- */
- public static final MaterialFlag NO_SMASHING = new MaterialFlag.Builder("no_smashing")
- .requireProps(PropertyKey.DUST)
- .build();
- /**
- * 添加到材料表示无法熔炼
- */
- public static final MaterialFlag NO_SMELTING = new MaterialFlag.Builder("no_smelting")
- .requireProps(PropertyKey.DUST)
- .build();
- /**
- * 添加到材料表示无法从矿石中熔炼
- */
- public static final MaterialFlag NO_ORE_SMELTING = new MaterialFlag.Builder("no_ore_smelting")
- .requireProps(PropertyKey.DUST)
- .build();
- /**
- * 添加到材料以禁用创建矿石处理标签页
- */
- public static final MaterialFlag NO_ORE_PROCESSING_TAB = new MaterialFlag.Builder("no_ore_processing_tab")
- .requireProps(PropertyKey.ORE)
- .build();
- /**
- * 将此添加到您的材料中,如果您希望其矿石方解石在高炉中加热以获得更多产出。
- * 已经列出的材料有:铁、黄铁矿、生铁、熟铁。
- */
- public static final MaterialFlag BLAST_FURNACE_CALCITE_DOUBLE = new MaterialFlag.Builder(
- "blast_furnace_calcite_double")
- .requireProps(PropertyKey.DUST)
- .build();
- /**
- * 高炉方解石三重产量
- */
- public static final MaterialFlag BLAST_FURNACE_CALCITE_TRIPLE = new MaterialFlag.Builder(
- "blast_furnace_calcite_triple")
- .requireProps(PropertyKey.DUST)
- .build();
- /**
- * 用于禁用合金高炉配方的生成
- */
- public static final MaterialFlag DISABLE_ALLOY_BLAST = new MaterialFlag.Builder("disable_alloy_blast")
- .requireProps(PropertyKey.BLAST, PropertyKey.FLUID)
- .build();
- /**
- * 用于禁用与合金高炉相关的所有内容
- */
- public static final MaterialFlag DISABLE_ALLOY_PROPERTY = new MaterialFlag.Builder("disable_alloy_property")
- .requireProps(PropertyKey.BLAST, PropertyKey.FLUID)
- .requireFlags(DISABLE_ALLOY_BLAST)
- .build();
- /// //////////////
-
- public static final MaterialFlag SOLDER_MATERIAL = new MaterialFlag.Builder("solder_material")
- .requireProps(PropertyKey.FLUID)
- .build();
- public static final MaterialFlag SOLDER_MATERIAL_BAD = new MaterialFlag.Builder("solder_material_bad")
- .requireProps(PropertyKey.FLUID)
- .build();
- // GCYM
- public static final MaterialFlag SOLDER_MATERIAL_GOOD = new MaterialFlag.Builder("solder_material_good")
- .requireProps(PropertyKey.FLUID)
- .build();
- /// //////////////
-
- public static final MaterialFlag GENERATE_FOIL = new MaterialFlag.Builder("generate_foil")
- .requireFlags(GENERATE_PLATE)
- .requireProps(PropertyKey.INGOT)
- .build();
-
- /////////////////
- // FLUID //
- public static final MaterialFlag GENERATE_FINE_WIRE = new MaterialFlag.Builder("generate_fine_wire")
- .requireFlags(GENERATE_FOIL)
- .requireProps(PropertyKey.INGOT)
- .build();
- public static final MaterialFlag GENERATE_RING = new MaterialFlag.Builder("generate_ring")
- .requireFlags(GENERATE_ROD)
- .requireProps(PropertyKey.INGOT)
- .build();
- public static final MaterialFlag GENERATE_ROTOR = new MaterialFlag.Builder("generate_rotor")
- .requireFlags(GENERATE_BOLT_SCREW, GENERATE_RING, GENERATE_PLATE)
- .requireProps(PropertyKey.INGOT)
- .build();
-
- /////////////////
- // INGOT //
- public static final MaterialFlag GENERATE_SPRING_SMALL = new MaterialFlag.Builder("generate_spring_small")
- .requireFlags(GENERATE_ROD)
- .requireProps(PropertyKey.INGOT)
- .build();
- public static final MaterialFlag GENERATE_SMALL_GEAR = new MaterialFlag.Builder("generate_small_gear")
- .requireFlags(GENERATE_PLATE, GENERATE_ROD)
- .requireProps(PropertyKey.INGOT)
- .build();
- public static final MaterialFlag GENERATE_ROUND = new MaterialFlag.Builder("generate_round")
- .requireProps(PropertyKey.INGOT)
- .build();
- /**
- * 将此添加到您的材料中,如果它是另一种材料的磁化形式。
- */
- public static final MaterialFlag IS_MAGNETIC = new MaterialFlag.Builder("is_magnetic")
- .requireProps(PropertyKey.INGOT)
- .build();
- /**
- * 表示此材料可以结晶。
- */
- public static final MaterialFlag CRYSTALLIZABLE = new MaterialFlag.Builder("crystallizable")
- .requireProps(PropertyKey.GEM)
- .build();
- public static final MaterialFlag GENERATE_LENS = new MaterialFlag.Builder("generate_lens")
- .requireFlags(GENERATE_PLATE)
- .requireProps(PropertyKey.GEM)
- .build();
- /// //////////////
-
- public static final MaterialFlag HIGH_SIFTER_OUTPUT = new MaterialFlag.Builder("high_sifter_output")
- .requireProps(PropertyKey.GEM, PropertyKey.ORE)
- .build();
- private final Set flags = new HashSet<>();
-
- public MaterialFlags addFlags(MaterialFlag... flags) {
- this.flags.addAll(Arrays.asList(flags));
- return this;
- }
-
- /////////////////
- // 宝石 //
- /////////////////
-
- public void verify(Material material) {
- flags.addAll(flags.stream()
- .map(f -> f.verifyFlag(material))
- .flatMap(Collection::stream)
- .collect(Collectors.toSet()));
- }
-
- public boolean hasFlag(MaterialFlag flag) {
- return flags.contains(flag);
- }
-
- /////////////////
- // ORE //
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- flags.forEach(f -> sb.append(f.toString()).append("\n"));
- return sb.toString();
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialIconLayer.java b/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialIconLayer.java
new file mode 100644
index 0000000..e39dbcb
--- /dev/null
+++ b/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialIconLayer.java
@@ -0,0 +1,28 @@
+package net.phasetranscrystal.breacore.api.material.info;
+
+import net.minecraft.client.renderer.block.model.Material;
+import net.minecraft.resources.Identifier;
+
+import lombok.Getter;
+
+public enum MaterialIconLayer {
+
+ BaseLayer("_base"),
+ OverlayLayer("_overlay"),
+ SecondaryLayer("_secondary"),
+ MaskLayer("_mask"),
+ DetailLayer("_detail"),
+ FluidStillLayer("_fluid_still"),
+ FluidFlowingLayer("_fluid_flowing");
+
+ @Getter
+ private final String suffix;
+
+ MaterialIconLayer(String suffix) {
+ this.suffix = suffix;
+ }
+
+ public Material getLayer(Identifier identifier) {
+ return new Material(identifier.withSuffix(suffix));
+ }
+}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialIconSet.java b/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialIconSet.java
index 9b22801..209f16a 100644
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialIconSet.java
+++ b/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialIconSet.java
@@ -2,7 +2,6 @@
import com.google.common.base.Preconditions;
import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import java.util.HashMap;
import java.util.Locale;
@@ -11,10 +10,8 @@
public class MaterialIconSet {
public static final Map ICON_SETS = new HashMap<>();
-
- public static final MaterialIconSet DULL = new MaterialIconSet("dull", null, true);
-
- // Implementation -----------------------------------------------------------------------------------------------
+ public static final MaterialIconSet DEFAULT = new MaterialIconSet("default");
+ public static final MaterialIconSet FLUID = new MaterialIconSet("fluid", DEFAULT);
private static int idCounter = 0;
public final String name;
@@ -27,40 +24,22 @@ public class MaterialIconSet {
*/
public final MaterialIconSet parentIconset;
- /**
- * 创建一个新的MaterialIconSet,其父图标集为{@link MaterialIconSet#DULL}
- *
- * @param name 图标集名称
- */
- public MaterialIconSet(@NotNull String name) {
- this(name, MaterialIconSet.DULL);
+ public MaterialIconSet(String name) {
+ this(name, MaterialIconSet.DEFAULT);
}
- /**
- * 创建一个新的MaterialIconSet,可指定父图标集
- *
- * @param name 图标集名称
- * @param parentIconset 父图标集
- */
- public MaterialIconSet(@NotNull String name, @NotNull MaterialIconSet parentIconset) {
+ public MaterialIconSet(String name, MaterialIconSet parentIconset) {
this(name, parentIconset, false);
}
- /**
- * 创建一个新的MaterialIconSet,可作为根图标集
- *
- * @param name 图标集名称
- * @param parentIconset 父图标集,若此图标集为根图标集则应为null
- * @param isRootIconset 如果此图标集为根图标集则为true,否则为false
- */
- public MaterialIconSet(@NotNull String name, @Nullable MaterialIconSet parentIconset, boolean isRootIconset) {
+ private MaterialIconSet(String name, MaterialIconSet parentIconset, boolean isRootIconset) {
this.name = name.toLowerCase(Locale.ENGLISH);
Preconditions.checkArgument(!ICON_SETS.containsKey(this.name),
"MaterialIconSet " + this.name + " 已注册!");
this.id = idCounter++;
this.isRootIconset = isRootIconset;
this.parentIconset = parentIconset;
- ICON_SETS.put(this.name, this);
+ ICON_SETS.put(name, this);
}
public static MaterialIconSet getByName(@NotNull String name) {
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialIconType.java b/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialIconType.java
deleted file mode 100644
index 46b8135..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/info/MaterialIconType.java
+++ /dev/null
@@ -1,208 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.info;
-
-import net.phasetranscrystal.brealib.BreaLib;
-
-import net.minecraft.client.Minecraft;
-import net.minecraft.resources.Identifier;
-
-import com.google.common.base.CaseFormat;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.HashBasedTable;
-import com.google.common.collect.Table;
-import com.lowdragmc.lowdraglib2.utils.ResourceHelper;
-import org.apache.logging.log4j.util.Strings;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 图标集类型
- * 待重构
- * 待美工
- *
- * @param name
- */
-public record MaterialIconType(String name) {
-
- public static final Map ICON_TYPES = new HashMap<>();
-
- private static final Table ITEM_MODEL_CACHE = HashBasedTable
- .create();
- private static final Table ITEM_TEXTURE_CACHE = HashBasedTable
- .create();
- private static final Table ITEM_TEXTURE_CACHE_SECONDARY = HashBasedTable
- .create();
- private static final Table BLOCK_MODEL_CACHE = HashBasedTable
- .create();
- private static final Table BLOCK_TEXTURE_CACHE = HashBasedTable
- .create();
- private static final Table BLOCK_TEXTURE_CACHE_SECONDARY = HashBasedTable
- .create();
-
- public MaterialIconType(String name) {
- this.name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
- Preconditions.checkArgument(!ICON_TYPES.containsKey(this.name),
- "MaterialIconType " + this.name + " already registered!");
- ICON_TYPES.put(this.name, this);
- }
-
- public static MaterialIconType getByName(String name) {
- return ICON_TYPES.get(name);
- }
-
- @Nullable
- public Identifier getBlockTexturePath(@NotNull MaterialIconSet materialIconSet, boolean doReadCache) {
- return getBlockTexturePath(materialIconSet, null, doReadCache);
- }
-
- @Nullable // Safe: only null on registration on fabric, and no "required" textures are resolved at that point.
- public Identifier getBlockTexturePath(@NotNull MaterialIconSet materialIconSet, String suffix,
- boolean doReadCache) {
- if (doReadCache) {
- if (suffix == null || suffix.isBlank()) {
- if (BLOCK_TEXTURE_CACHE.contains(this, materialIconSet))
- return BLOCK_TEXTURE_CACHE.get(this, materialIconSet);
- } else {
- if (BLOCK_TEXTURE_CACHE_SECONDARY.contains(this, materialIconSet))
- return BLOCK_TEXTURE_CACHE_SECONDARY.get(this, materialIconSet);
- }
- }
-
- suffix = Strings.isBlank(suffix) ? "" : "_" + suffix;
-
- MaterialIconSet iconSet = materialIconSet;
- // noinspection ConstantConditions
- if (!BreaLib.isClientSide() ||
- Minecraft.getInstance() == null ||
- Minecraft.getInstance().getResourceManager() == null)
- return null; // check minecraft for null for CI environments
- if (!iconSet.isRootIconset) {
- while (!iconSet.isRootIconset) {
- Identifier location = BreaLib.id(String.format("textures/gensource/block/%s/%s%s.png", iconSet.name, this.name, suffix));
- if (ResourceHelper.isResourceExist(location) || ResourceHelper.isResourceExistRaw(location))
- break;
- iconSet = iconSet.parentIconset;
- }
- }
-
- Identifier location = BreaLib.id(String.format("textures/gensource/block/%s/%s%s.png", iconSet.name, this.name, suffix));
- if (!suffix.isEmpty() && !ResourceHelper.isResourceExist(location) &&
- !ResourceHelper.isResourceExistRaw(location)) {
- return null;
- }
- location = BreaLib.id(String.format("gensource/block/%s/%s%s", iconSet.name, this.name, suffix));
- if (suffix.isEmpty()) {
- BLOCK_TEXTURE_CACHE.put(this, materialIconSet, location);
- } else {
- BLOCK_TEXTURE_CACHE_SECONDARY.put(this, materialIconSet, location);
- }
-
- return location;
- }
-
- @NotNull
- public Identifier getBlockModelPath(@NotNull MaterialIconSet materialIconSet, boolean doReadCache) {
- if (doReadCache) {
- if (BLOCK_MODEL_CACHE.contains(this, materialIconSet)) {
- return BLOCK_MODEL_CACHE.get(this, materialIconSet);
- }
- }
-
- MaterialIconSet iconSet = materialIconSet;
- // noinspection ConstantConditions
- if (!iconSet.isRootIconset && BreaLib.isClientSide() && Minecraft.getInstance() != null &&
- Minecraft.getInstance().getResourceManager() != null) { // check minecraft for null for CI environments
- while (!iconSet.isRootIconset) {
- Identifier location = BreaLib.id(String.format("models/block/gensource/%s/%s.json", iconSet.name, this.name));
- if (ResourceHelper.isResourceExist(location) || ResourceHelper.isResourceExistRaw(location))
- break;
- iconSet = iconSet.parentIconset;
- }
- }
-
- Identifier location = BreaLib.id(String.format("block/gensource/%s/%s", iconSet.name, this.name));
- ITEM_MODEL_CACHE.put(this, materialIconSet, location);
-
- return location;
- }
-
- @NotNull
- public Identifier getItemModelPath(@NotNull MaterialIconSet materialIconSet, boolean doReadCache) {
- if (doReadCache) {
- if (ITEM_MODEL_CACHE.contains(this, materialIconSet)) {
- return ITEM_MODEL_CACHE.get(this, materialIconSet);
- }
- }
-
- MaterialIconSet iconSet = materialIconSet;
- // noinspection ConstantConditions
- if (!iconSet.isRootIconset && BreaLib.isClientSide() && Minecraft.getInstance() != null &&
- Minecraft.getInstance().getResourceManager() != null) { // check minecraft for null for CI environments
- while (!iconSet.isRootIconset) {
- Identifier location = BreaLib.id(String.format("item/gensource/%s/%s.json", iconSet.name, this.name));
- if (ResourceHelper.isResourceExist(location) || ResourceHelper.isResourceExistRaw(location))
- break;
- iconSet = iconSet.parentIconset;
- }
- }
-
- Identifier location = BreaLib.id(String.format("item/gensource/%s/%s", iconSet.name, this.name));
- ITEM_MODEL_CACHE.put(this, materialIconSet, location);
-
- return location;
- }
-
- @Nullable
- public Identifier getItemTexturePath(@NotNull MaterialIconSet materialIconSet, boolean doReadCache) {
- return getItemTexturePath(materialIconSet, null, doReadCache);
- }
-
- @Nullable
- public Identifier getItemTexturePath(@NotNull MaterialIconSet materialIconSet, String suffix,
- boolean doReadCache) {
- if (doReadCache) {
- if (suffix == null || suffix.isBlank()) {
- if (ITEM_TEXTURE_CACHE.contains(this, materialIconSet))
- return ITEM_TEXTURE_CACHE.get(this, materialIconSet);
- } else {
- if (ITEM_TEXTURE_CACHE_SECONDARY.contains(this, materialIconSet))
- return ITEM_TEXTURE_CACHE_SECONDARY.get(this, materialIconSet);
- }
- }
-
- suffix = suffix == null || suffix.isBlank() ? "" : "_" + suffix;
-
- MaterialIconSet iconSet = materialIconSet;
- // noinspection ConstantConditions
- if (!iconSet.isRootIconset && BreaLib.isClientSide() && Minecraft.getInstance() != null &&
- Minecraft.getInstance().getResourceManager() != null) { // check minecraft for null for CI environments
- while (!iconSet.isRootIconset) {
- Identifier location = BreaLib.id(String.format("textures/itemgensource//%s/%s%s.png", iconSet.name, this.name, suffix));
- if (ResourceHelper.isResourceExist(location) || ResourceHelper.isResourceExistRaw(location))
- break;
- iconSet = iconSet.parentIconset;
- }
- }
-
- Identifier location = BreaLib.id(String.format("textures/item/gensource/%s/%s%s.png", iconSet.name, this.name, suffix));
- if (!suffix.isEmpty() && !ResourceHelper.isResourceExist(location) &&
- !ResourceHelper.isResourceExistRaw(location)) {
- return null;
- }
- location = BreaLib.id(String.format("item/gensource/%s/%s%s", iconSet.name, this.name, suffix));
- if (suffix.isEmpty()) {
- ITEM_TEXTURE_CACHE.put(this, materialIconSet, location);
- } else {
- ITEM_TEXTURE_CACHE_SECONDARY.put(this, materialIconSet, location);
- }
-
- return location;
- }
-
- @Override
- public @NotNull String toString() {
- return this.name;
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/property/BlastProperty.java b/src/main/java/net/phasetranscrystal/breacore/api/material/property/BlastProperty.java
deleted file mode 100644
index 4d7ec8c..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/property/BlastProperty.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.property;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * 材料物理性质,熔炼信息
- * 待重新设定
- */
-public class BlastProperty implements IMaterialProperty {
-
- /**
- * 此材料的高炉冶炼温度。
- * 如果低于1000K,将同时添加原始高炉配方。
- * 如果高于1750K,将同时添加热锭及其真空冷冻机配方。
- *
- * 如果具有此属性的材料有流体形态,且流体温度为默认值,
- * 则其温度将被设置为此值。
- */
- @Getter
- private int blastTemperature;
-
- /**
- * EBF(电力高炉)配方的持续时间,覆盖默认行为。
- *
- * 默认值:-1,表示持续时间将为:material.getAverageMass() * blastTemperature / 50
- */
- @Setter
- @Getter
- private int durationOverride = -1;
-
- /**
- * EBF(电力高炉)配方的EU/t(能耗),覆盖默认行为。
- *
- * 默认值:-1,表示EU/t将为120。
- */
- @Setter
- @Getter
- private int EUtOverride = -1;
-
- /**
- * 真空冷冻机配方的持续时间,覆盖默认行为。
- *
- * 默认值:-1,表示持续时间将为:material.getMass() * 3
- */
- @Setter
- @Getter
- private int vacuumDurationOverride = -1;
-
- /**
- * 真空冷冻机配方(如果需要)的EU/t(能耗),覆盖默认行为。
- *
- * 默认值:-1,表示EU/t将为120。
- */
- @Setter
- @Getter
- private int vacuumEUtOverride = -1;
-
- public BlastProperty(int blastTemperature) {
- this.blastTemperature = blastTemperature;
- }
-
- public BlastProperty(int blastTemperature, int eutOverride, int durationOverride,
- int vacuumEUtOverride, int vacuumDurationOverride) {
- this.blastTemperature = blastTemperature;
- this.EUtOverride = eutOverride;
- this.durationOverride = durationOverride;
- this.vacuumEUtOverride = vacuumEUtOverride;
- this.vacuumDurationOverride = vacuumDurationOverride;
- }
-
- /**
- * Default property constructor.
- */
- public BlastProperty() {
- this(0);
- }
-
- public void setBlastTemperature(int blastTemp) {
- if (blastTemp <= 0) throw new IllegalArgumentException("Blast Temperature must be greater than zero!");
- this.blastTemperature = blastTemp;
- }
-
- @Override
- public void verifyProperty(MaterialProperties properties) {
- properties.ensureSet(PropertyKey.INGOT, true);
- }
-
- public static class Builder {
-
- private int temp;
- private int eutOverride = -1;
- private int durationOverride = -1;
- private int vacuumEUtOverride = -1;
- private int vacuumDurationOverride = -1;
-
- public Builder() {}
-
- public Builder temp(int temperature) {
- this.temp = temperature;
- return this;
- }
-
- public Builder blastStats(int eutOverride) {
- this.eutOverride = eutOverride;
- return this;
- }
-
- public Builder blastStats(int eutOverride, int durationOverride) {
- this.eutOverride = eutOverride;
- this.durationOverride = durationOverride;
- return this;
- }
-
- public Builder vacuumStats(int eutOverride) {
- this.vacuumEUtOverride = eutOverride;
- return this;
- }
-
- public Builder vacuumStats(int eutOverride, int durationOverride) {
- this.vacuumEUtOverride = eutOverride;
- this.vacuumDurationOverride = durationOverride;
- return this;
- }
-
- public BlastProperty build() {
- return new BlastProperty(temp, eutOverride, durationOverride, vacuumEUtOverride,
- vacuumDurationOverride);
- }
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/property/FluidProperty.java b/src/main/java/net/phasetranscrystal/breacore/api/material/property/FluidProperty.java
deleted file mode 100644
index 9592134..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/property/FluidProperty.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.property;
-
-import net.phasetranscrystal.breacore.api.fluid.FluidRegisterBuilder;
-import net.phasetranscrystal.breacore.api.fluid.store.FluidStorage;
-import net.phasetranscrystal.breacore.api.fluid.store.FluidStorageImpl;
-import net.phasetranscrystal.breacore.api.fluid.store.FluidStorageKey;
-import net.phasetranscrystal.breacore.api.fluid.store.FluidStorageKeys;
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.api.registry.registrate.BreaRegistrate;
-
-import net.minecraft.world.level.material.Fluid;
-import net.neoforged.neoforge.fluids.FluidStack;
-
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-import org.jetbrains.annotations.ApiStatus;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import java.util.function.Supplier;
-
-/**
- * 流体属性
- */
-@NoArgsConstructor
-public class FluidProperty implements IMaterialProperty, FluidStorage {
-
- private final FluidStorageImpl storage = new FluidStorageImpl();
- @Getter
- @Setter
- private FluidStorageKey primaryKey = null;
- @Setter
- private @Nullable Fluid solidifyingFluid = null;
-
- public FluidProperty(@NotNull FluidStorageKey key, @NotNull FluidRegisterBuilder builder) {
- enqueueRegistration(key, builder);
- }
-
- public @NotNull FluidStorage getStorage() {
- return this;
- }
-
- @ApiStatus.Internal
- public void registerFluids(@NotNull Material material, @NotNull BreaRegistrate registrate) {
- this.storage.registerFluids(material, registrate);
- }
-
- @Override
- public void enqueueRegistration(@NotNull FluidStorageKey key, @NotNull FluidRegisterBuilder builder) {
- storage.enqueueRegistration(key, builder);
- if (primaryKey == null) {
- primaryKey = key;
- }
- }
-
- @Override
- public void store(@NotNull FluidStorageKey key, @NotNull Supplier extends Fluid> fluid,
- @Nullable FluidRegisterBuilder builder) {
- storage.store(key, fluid, builder);
- if (primaryKey == null) {
- primaryKey = key;
- }
- }
-
- @Override
- public @Nullable Fluid get(@NotNull FluidStorageKey key) {
- return storage.get(key);
- }
-
- @Override
- public @Nullable FluidEntry getEntry(@NotNull FluidStorageKey key) {
- return storage.getEntry(key);
- }
-
- @Override
- public @Nullable FluidRegisterBuilder getQueuedBuilder(@NotNull FluidStorageKey key) {
- return storage.getQueuedBuilder(key);
- }
-
- /**
- * @return the Fluid which solidifies into the material.
- */
- public @Nullable Fluid solidifiesFrom() {
- if (this.solidifyingFluid == null) {
- this.solidifyingFluid = getStorage().get(FluidStorageKeys.LIQUID);
- }
- return solidifyingFluid;
- }
-
- /**
- * @param amount the size of the returned FluidStack.
- * @return a FluidStack of the Fluid which solidifies into the material.
- */
- public @NotNull FluidStack solidifiesFrom(int amount) {
- Fluid fluid = solidifiesFrom();
- if (fluid == null) {
- return FluidStack.EMPTY;
- }
- return new FluidStack(fluid, amount);
- }
-
- @Override
- public void verifyProperty(MaterialProperties properties) {
- if (this.primaryKey == null) {
- throw new IllegalStateException("FluidProperty cannot be empty!");
- }
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/property/GemProperty.java b/src/main/java/net/phasetranscrystal/breacore/api/material/property/GemProperty.java
deleted file mode 100644
index 8f4e934..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/property/GemProperty.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.property;
-
-/**
- * 宝石类材料基本信息
- */
-public class GemProperty implements IMaterialProperty {
-
- @Override
- public void verifyProperty(MaterialProperties properties) {
- properties.ensureSet(PropertyKey.DUST, true);
- if (properties.hasProperty(PropertyKey.INGOT)) {
- throw new IllegalStateException(
- "Material " + properties.getMaterial() +
- " has both Ingot and Gem Property, which is not allowed!");
- }
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/property/IMaterialProperty.java b/src/main/java/net/phasetranscrystal/breacore/api/material/property/IMaterialProperty.java
deleted file mode 100644
index ab8b4c2..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/property/IMaterialProperty.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.property;
-
-/**
- * 材料属性接口
- */
-public interface IMaterialProperty {
-
- void verifyProperty(MaterialProperties properties);
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/property/IngotProperty.java b/src/main/java/net/phasetranscrystal/breacore/api/material/property/IngotProperty.java
deleted file mode 100644
index 9df4ad6..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/property/IngotProperty.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.property;
-
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterials;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.jetbrains.annotations.NotNull;
-
-/**
- * 锭类材料信息
- * 等待重新设定
- */
-public class IngotProperty implements IMaterialProperty {
-
- /**
- * 指定此材料部件加热时转变为何种材料
- */
- @Getter
- @Setter
- @NotNull
- private Material smeltingInto = BreaMaterials.NULL;
-
- /**
- * 指定此材料部件在电弧炉中加热时转变为何种材料
- */
- @Getter
- @Setter
- @NotNull
- private Material arcSmeltingInto = BreaMaterials.NULL;
-
- /**
- * 指定此材料破碎后得到何种材料。
- *
- * 默认值:此材料本身。
- */
- @Getter
- @Setter
- @NotNull
- private Material macerateInto = BreaMaterials.NULL;
-
- /**
- * 此材料磁化后获得的材料
- */
- @Getter
- @Setter
- @NotNull
- private Material magneticMaterial = BreaMaterials.NULL;
-
- @Override
- public void verifyProperty(MaterialProperties properties) {
- // 确保材料具有DUST属性
- properties.ensureSet(PropertyKey.DUST, true);
-
- // 检查材料不能同时具有INGOT和GEM属性
- if (properties.hasProperty(PropertyKey.GEM)) {
- throw new IllegalStateException(
- "材料 " + properties.getMaterial() +
- " 同时具有Ingot和Gem属性,这是不允许的!");
- }
-
- // 设置默认值:如果未指定加热转变材料,则默认为材料本身
- if (smeltingInto.isNull()) smeltingInto = properties.getMaterial();
- else smeltingInto.getProperties().ensureSet(PropertyKey.INGOT, true);
-
- // 设置默认值:如果未指定电弧炉加热转变材料,则默认为材料本身
- if (arcSmeltingInto.isNull()) arcSmeltingInto = properties.getMaterial();
- else arcSmeltingInto.getProperties().ensureSet(PropertyKey.INGOT, true);
-
- // 设置默认值:如果未指定破碎后材料,则默认为材料本身
- if (macerateInto.isNull()) macerateInto = properties.getMaterial();
- else macerateInto.getProperties().ensureSet(PropertyKey.INGOT, true);
-
- // 如果指定了磁化材料,确保其具有INGOT属性
- if (!magneticMaterial.isNull())
- magneticMaterial.getProperties().ensureSet(PropertyKey.INGOT, true);
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/property/MaterialProperties.java b/src/main/java/net/phasetranscrystal/breacore/api/material/property/MaterialProperties.java
deleted file mode 100644
index 5ef8768..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/property/MaterialProperties.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.property;
-
-import net.phasetranscrystal.brealib.BreaLib;
-
-import net.phasetranscrystal.breacore.BreakdownCore;
-import net.phasetranscrystal.breacore.api.material.Material;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.*;
-
-public class MaterialProperties {
-
- private static final Set> baseTypes = new HashSet<>(Arrays.asList(
- PropertyKey.FLUID,
- PropertyKey.DUST,
- PropertyKey.INGOT,
- PropertyKey.GEM,
- PropertyKey.EMPTY));
- private final Map, IMaterialProperty> propertyMap;
- @Getter
- @Setter
- private Material material;
-
- public MaterialProperties() {
- propertyMap = new HashMap<>();
- }
-
- @SuppressWarnings("unused")
- public static void addBaseType(PropertyKey> baseTypeKey) {
- baseTypes.add(baseTypeKey);
- }
-
- public boolean isEmpty() {
- return propertyMap.isEmpty();
- }
-
- public T getProperty(PropertyKey key) {
- return key.cast(propertyMap.get(key));
- }
-
- public boolean hasProperty(PropertyKey key) {
- return propertyMap.get(key) != null;
- }
-
- public void setProperty(PropertyKey key, IMaterialProperty value) {
- if (value == null) throw new IllegalArgumentException("Material Property must not be null!");
- if (hasProperty(key))
- throw new IllegalArgumentException("Material Property " + key.toString() + " already registered!");
- propertyMap.put(key, value);
- propertyMap.remove(PropertyKey.EMPTY);
- }
-
- public void removeProperty(PropertyKey property) {
- if (!hasProperty(property))
- throw new IllegalArgumentException("Material Property " + property.toString() + " not present!");
- propertyMap.remove(property);
- if (propertyMap.isEmpty())
- propertyMap.put(PropertyKey.EMPTY, PropertyKey.EMPTY.constructDefault());
- }
-
- public void ensureSet(PropertyKey key, boolean verify) {
- if (!hasProperty(key)) {
- propertyMap.put(key, key.constructDefault());
- propertyMap.remove(PropertyKey.EMPTY);
- if (verify) verify();
- }
- }
-
- public void ensureSet(PropertyKey key) {
- ensureSet(key, false);
- }
-
- public void verify() {
- List oldList;
- do {
- oldList = new ArrayList<>(propertyMap.values());
- oldList.forEach(p -> p.verifyProperty(this));
- } while (oldList.size() != propertyMap.size());
-
- // 空属性,用于允许无属性的材料,同时不保留基础类型强制约束
- if (propertyMap.keySet().stream().noneMatch(baseTypes::contains)) {
- if (propertyMap.isEmpty()) {
- if (BreaLib.isDev()) {
- BreakdownCore.LOGGER.debug("正在创建空占位符材料 {}", material);
- }
- propertyMap.put(PropertyKey.EMPTY, PropertyKey.EMPTY.constructDefault());
- } else
- throw new IllegalArgumentException("材料必须至少指定以下属性之一:" + baseTypes);
- }
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- propertyMap.forEach((k, v) -> sb.append(k.toString()).append("\n"));
- return sb.toString();
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/property/OreProperty.java b/src/main/java/net/phasetranscrystal/breacore/api/material/property/OreProperty.java
deleted file mode 100644
index 78bd3bf..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/property/OreProperty.java
+++ /dev/null
@@ -1,201 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.property;
-
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterials;
-
-import net.minecraft.util.Mth;
-
-import com.mojang.datafixers.util.Pair;
-import lombok.Getter;
-import lombok.Setter;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * 矿处属性
- */
-public class OreProperty implements IMaterialProperty {
-
- /**
- * 矿物副产品列表。
- *
- * 默认值:无,即仅包含此属性对应的材料。
- */
- @Getter
- private final List oreByProducts = new ArrayList<>();
- /**
- * 在电磁分离过程中,此矿物将被分离为此材料和此字段指定的材料。
- * 限制为2种材料。
- *
- * 材料必须具有粉尘属性。
- * 默认值:无。
- */
- @Getter
- private final List separatedInto = new ArrayList<>();
- /**
- * 破碎过程中破碎矿石产出量的倍数。
- *
- * 默认值:1(无倍数)。
- */
- @Getter
- @Setter
- private int oreMultiplier;
- /**
- * 破碎过程中副产品产出量的倍数。
- *
- * 默认值:1(无倍数)。
- */
- @Getter
- @Setter
- private int byProductMultiplier;
- /**
- * 矿物方块是否使用发光纹理。
- *
- * 默认值:false。
- */
- @Getter
- @Setter
- private boolean emissive;
- /**
- * 此矿物直接冶炼得到的结果材料。
- *
- * 该材料必须具有粉尘属性。
- * 默认值:无。
- */
- @Getter
- @Setter
- @NotNull
- private Material directSmeltResult = BreaMaterials.NULL;
- /**
- * 此矿物应在此材料中进行洗涤以获得额外产出。
- *
- * 该材料必须具有流体属性。
- * 默认值:无。
- */
- @Setter
- @NotNull
- private Material washedIn = BreaMaterials.NULL;
- /**
- * 在化学浴中洗涤此矿物所需的材料量。
- *
- * 默认值:100 mb
- */
- private int washedAmount = 100;
-
- /**
- * 构造方法
- *
- * @param oreMultiplier 矿石产出倍数
- * @param byProductMultiplier 副产品产出倍数
- */
- public OreProperty(int oreMultiplier, int byProductMultiplier) {
- this.oreMultiplier = oreMultiplier;
- this.byProductMultiplier = byProductMultiplier;
- this.emissive = false;
- }
-
- /**
- * 构造方法
- *
- * @param oreMultiplier 矿石产出倍数
- * @param byProductMultiplier 副产品产出倍数
- * @param emissive 是否发光
- */
- public OreProperty(int oreMultiplier, int byProductMultiplier, boolean emissive) {
- this.oreMultiplier = oreMultiplier;
- this.byProductMultiplier = byProductMultiplier;
- this.emissive = emissive;
- }
-
- /**
- * 默认值构造方法。
- */
- public OreProperty() {
- this(1, 1);
- }
-
- /**
- * 设置洗涤材料和用量
- *
- * @param m 洗涤材料
- * @param washedAmount 用量
- */
- public void setWashedIn(Material m, int washedAmount) {
- this.washedIn = m;
- this.washedAmount = washedAmount;
- }
-
- /**
- * 获取洗涤材料和用量
- *
- * @return 洗涤材料和用量的配对
- */
- public Pair getWashedIn() {
- return Pair.of(this.washedIn, this.washedAmount);
- }
-
- /**
- * 设置分离产物
- *
- * @param materials 分离得到的材料
- */
- public void setSeparatedInto(Material... materials) {
- this.separatedInto.addAll(Arrays.asList(materials));
- }
-
- /**
- * 设置矿物副产品
- *
- * @param materials 用作副产品的材料
- */
- public void setOreByProducts(@NotNull Material @NotNull... materials) {
- setOreByProducts(Arrays.asList(materials));
- }
-
- /**
- * 设置矿物副产品
- *
- * @param materials 用作副材料的集合
- */
- public void setOreByProducts(@NotNull Collection<@NotNull Material> materials) {
- this.oreByProducts.clear();
- this.oreByProducts.addAll(materials);
- }
-
- /**
- * 添加矿物副产品
- *
- * @param materials 要添加为副产品的材料
- */
- public void addOreByProducts(@NotNull Material @NotNull... materials) {
- this.oreByProducts.addAll(Arrays.asList(materials));
- }
-
- @NotNull
- public final Material getOreByProduct(int index) {
- if (this.oreByProducts.isEmpty()) return BreaMaterials.NULL;
- return this.oreByProducts.get(Mth.clamp(index, 0, this.oreByProducts.size() - 1));
- }
-
- @NotNull
- public final Material getOreByProduct(int index, @NotNull Material fallback) {
- Material material = getOreByProduct(index);
- return !material.isNull() ? material : fallback;
- }
-
- @Override
- public void verifyProperty(MaterialProperties properties) {
- properties.ensureSet(PropertyKey.DUST, true);
-
- if (!directSmeltResult.isNull())
- directSmeltResult.getProperties().ensureSet(PropertyKey.DUST, true);
- if (!washedIn.isNull())
- washedIn.getProperties().ensureSet(PropertyKey.FLUID, true);
- separatedInto.forEach(m -> m.getProperties().ensureSet(PropertyKey.DUST, true));
- oreByProducts.forEach(m -> m.getProperties().ensureSet(PropertyKey.DUST, true));
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/property/PolymerProperty.java b/src/main/java/net/phasetranscrystal/breacore/api/material/property/PolymerProperty.java
deleted file mode 100644
index 47537a4..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/property/PolymerProperty.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.property;
-
-import net.phasetranscrystal.breacore.api.material.info.MaterialFlags;
-
-/**
- * 聚合物信息
- */
-public class PolymerProperty implements IMaterialProperty {
-
- @Override
- public void verifyProperty(MaterialProperties properties) {
- properties.ensureSet(PropertyKey.DUST, true);
- properties.ensureSet(PropertyKey.INGOT, true);
-
- properties.getMaterial().addFlags(MaterialFlags.FLAMMABLE, MaterialFlags.NO_SMASHING,
- MaterialFlags.DISABLE_DECOMPOSITION);
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/property/PropertyKey.java b/src/main/java/net/phasetranscrystal/breacore/api/material/property/PropertyKey.java
deleted file mode 100644
index 2287063..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/property/PropertyKey.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.property;
-
-public class PropertyKey {
-
- /**
- * 材料基本属性
- */
- public static final PropertyKey DUST = new PropertyKey<>("dust", DustProperty.class);
- /**
- * 锭属性
- */
- public static final PropertyKey INGOT = new PropertyKey<>("ingot", IngotProperty.class);
- /**
- * 宝石属性
- */
- public static final PropertyKey GEM = new PropertyKey<>("gem", GemProperty.class);
- /**
- * 流体属性
- */
- public static final PropertyKey FLUID = new PropertyKey<>("fluid", FluidProperty.class);
- /**
- * 熔炼属性
- */
- public static final PropertyKey BLAST = new PropertyKey<>("blast", BlastProperty.class);
- /**
- * 聚合物属性
- */
- public static final PropertyKey POLYMER = new PropertyKey<>("polymer", PolymerProperty.class);
- /**
- * 工具属性
- */
- public static final PropertyKey TOOL = new PropertyKey<>("tool", ToolProperty.class);
- /**
- * 木材属性
- */
- public static final PropertyKey WOOD = new PropertyKey<>("wood", WoodProperty.class);
- /**
- * 矿石属性
- */
- public static final PropertyKey ORE = new PropertyKey<>("ore", OreProperty.class);
- /**
- * 空属性,用于允许无属性的材料,同时不保留基础类型强制约束
- */
- public static final PropertyKey EMPTY = new PropertyKey<>("empty", EmptyProperty.class);
-
- private final String key;
- private final Class type;
-
- public PropertyKey(String key, Class type) {
- this.key = key;
- this.type = type;
- }
-
- protected String getKey() {
- return key;
- }
-
- protected T constructDefault() {
- try {
- return type.newInstance();
- } catch (Exception e) {
- return null;
- }
- }
-
- public T cast(IMaterialProperty property) {
- return this.type.cast(property);
- }
-
- @Override
- public boolean equals(Object o) {
- if (o instanceof PropertyKey) {
- return ((PropertyKey>) o).getKey().equals(key);
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return key.hashCode();
- }
-
- @Override
- public String toString() {
- return key;
- }
-
- /**
- * 空属性 不执行任何操作
- */
- public static class EmptyProperty implements IMaterialProperty {
-
- private EmptyProperty() {}
-
- @Override
- public void verifyProperty(MaterialProperties properties) {
- // no-op
- }
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/property/ToolProperty.java b/src/main/java/net/phasetranscrystal/breacore/api/material/property/ToolProperty.java
deleted file mode 100644
index 3b73bf3..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/property/ToolProperty.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.property;
-
-/**
- * 工具属性
- */
-public class ToolProperty implements IMaterialProperty {
-
- @Override
- public void verifyProperty(MaterialProperties properties) {
- if (properties.hasProperty(PropertyKey.WOOD)) {
- return;
- }
- if (properties.hasProperty(PropertyKey.GEM)) {
- return;
- }
- properties.ensureSet(PropertyKey.INGOT, true);
- }
-
- public static class Builder {}
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/property/WoodProperty.java b/src/main/java/net/phasetranscrystal/breacore/api/material/property/WoodProperty.java
deleted file mode 100644
index a26c680..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/property/WoodProperty.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.property;
-
-/**
- * 木材属性
- */
-public class WoodProperty implements IMaterialProperty {
-
- @Override
- public void verifyProperty(MaterialProperties properties) {
- properties.ensureSet(PropertyKey.DUST, true);
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/registry/IMaterialRegistry.java b/src/main/java/net/phasetranscrystal/breacore/api/material/registry/IMaterialRegistry.java
index c3f8b4b..bd26869 100644
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/registry/IMaterialRegistry.java
+++ b/src/main/java/net/phasetranscrystal/breacore/api/material/registry/IMaterialRegistry.java
@@ -2,79 +2,39 @@
import net.phasetranscrystal.breacore.api.material.Material;
+import net.minecraft.core.Holder;
import net.minecraft.resources.Identifier;
+import net.minecraft.resources.ResourceKey;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.UnmodifiableView;
+import java.lang.ref.Reference;
import java.util.Collection;
+import java.util.Optional;
import java.util.stream.Stream;
public interface IMaterialRegistry extends Iterable {
- /**
- * Accessible when in phases:
- *
- * - {@link Phase#OPEN}
- * - {@link Phase#CLOSED}
- * - {@link Phase#FROZEN}
- *
- *
- * @return all namespaces the registered materials use
- */
@UnmodifiableView
@NotNull
Collection getUsedNamespaces();
- /**
- * Register a material. Accessible when in phase {@link Phase#OPEN}.
- *
- * @param material the material to register
- * @return the same material.
- */
Material register(Material material);
- /**
- * Get a material from a String in formats:
- *
- * - {@code "modid:registry_name"}
- * - {@code "registry_name"} - where modid is inferred to be
- * {@link net.phasetranscrystal.breacore.BreakdownCore#MOD_ID}
- *
- *
- * Intended for use in reading/writing materials from/to NBT tags.
- *
- * @param name the name of the material in the above format
- * @return the material associated with the name
- */
Material getMaterial(Identifier name);
+ Optional> getHolder(ResourceKey key);
+
Identifier getKey(Material material);
- /**
- * Set the fallback material for a namespace.
- * This is only for manual fallback usage.
- *
- * @param modId the namespace to set the fallback for
- * @param material the fallback material
- */
void setFallbackMaterial(@NotNull String modId, @NotNull Material material);
- /**
- * This is only for manual fallback usage.
- *
- * @param modId the namespace to get the fallback for
- * @return the fallback material, used for when another material does not exist
- */
@NotNull
Material getFallbackMaterial(@NotNull String modId);
Stream stream();
- /**
- * @return the current phase in the material registration process
- * @see Phase
- */
@NotNull
Phase getPhase();
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/registry/MaterialBuilder.java b/src/main/java/net/phasetranscrystal/breacore/api/material/registry/MaterialBuilder.java
index ffd08a5..c50d1f6 100644
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/registry/MaterialBuilder.java
+++ b/src/main/java/net/phasetranscrystal/breacore/api/material/registry/MaterialBuilder.java
@@ -1,646 +1,3 @@
package net.phasetranscrystal.breacore.api.material.registry;
-import net.phasetranscrystal.breacore.api.fluid.FluidRegisterBuilder;
-import net.phasetranscrystal.breacore.api.fluid.FluidState;
-import net.phasetranscrystal.breacore.api.fluid.store.FluidStorageKey;
-import net.phasetranscrystal.breacore.api.fluid.store.FluidStorageKeys;
-import net.phasetranscrystal.breacore.api.material.Element;
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.api.material.info.MaterialFlag;
-import net.phasetranscrystal.breacore.api.material.info.MaterialFlags;
-import net.phasetranscrystal.breacore.api.material.info.MaterialIconSet;
-import net.phasetranscrystal.breacore.api.material.property.*;
-import net.phasetranscrystal.breacore.api.material.stack.MaterialStack;
-import net.phasetranscrystal.breacore.api.tag.TagPrefix;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterialIconSet;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterials;
-
-import net.minecraft.resources.Identifier;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.*;
-import java.util.function.UnaryOperator;
-
-@SuppressWarnings("UnusedReturnValue")
-public class MaterialBuilder {
-
- private final Material.MaterialInfo materialInfo;
- private final MaterialProperties properties;
- private final MaterialFlags flags;
- private Set ignoredTagPrefixes = null;
-
- private String formula = null;
-
- /*
- * The temporary list of components for this Material.
- */
- private List composition = new ArrayList<>();
-
- /*
- * Temporary value to use to determine how to calculate default RGB
- */
- private boolean averageRGB = false;
-
- /**
- * Constructs a {@link Material}. This MaterialBuilder replaces the old constructors, and
- * no longer uses a class hierarchy, instead using a {@link MaterialProperties} system.
- *
- * @param Identifier The Name of this Material. Will be formatted as
- * "material." for the Translation Key.
- * @since GTCEu 2.0.0
- */
- public MaterialBuilder(Identifier Identifier) {
- String name = Identifier.getPath();
- if (name.charAt(name.length() - 1) == '_')
- throw new IllegalArgumentException("Material name cannot end with a '_'!");
- materialInfo = new Material.MaterialInfo(Identifier);
- properties = new MaterialProperties();
- flags = new MaterialFlags();
- }
-
- /*
- * Material Types
- */
-
- /**
- * Add a {@link FluidProperty} to this Material.
- * Will be created as a {@link FluidStorageKeys#LIQUID}, without a Fluid Block.
- *
- * @throws IllegalArgumentException If a {@link FluidProperty} has already been added to this Material.
- */
- public MaterialBuilder fluid() {
- fluid(FluidStorageKeys.LIQUID, new FluidRegisterBuilder());
- return this;
- }
-
- /**
- * Add a {@link FluidProperty} to this Material.
- * Will be created with the specified state a with standard {@link FluidRegisterBuilder} defaults.
- *
- * Can be called multiple times to add multiple fluids.
- */
- public MaterialBuilder fluid(@NotNull FluidStorageKey key, @NotNull FluidState state) {
- return fluid(key, new FluidRegisterBuilder().state(state));
- }
-
- /**
- * Add a {@link FluidProperty} to this Material.
- *
- * Can be called multiple times to add multiple fluids.
- */
- public MaterialBuilder fluid(@NotNull FluidStorageKey key, @NotNull FluidRegisterBuilder builder) {
- properties.ensureSet(PropertyKey.FLUID);
- FluidProperty property = properties.getProperty(PropertyKey.FLUID);
- property.enqueueRegistration(key, builder);
- return this;
- }
-
- /**
- * Add a liquid for this material.
- *
- * @see #fluid(FluidStorageKey, FluidState)
- */
- public MaterialBuilder liquid() {
- return fluid(FluidStorageKeys.LIQUID, FluidState.LIQUID);
- }
-
- /**
- * Add a liquid for this material.
- *
- * @see #fluid(FluidStorageKey, FluidState)
- */
- public MaterialBuilder liquid(@NotNull FluidRegisterBuilder builder) {
- return fluid(FluidStorageKeys.LIQUID, builder.state(FluidState.LIQUID));
- }
-
- public MaterialBuilder liquid(int temp) {
- return liquid(new FluidRegisterBuilder().temperature(temp));
- }
-
- /**
- * Add a plasma for this material.
- *
- * @see #fluid(FluidStorageKey, FluidState)
- */
- public MaterialBuilder plasma() {
- return fluid(FluidStorageKeys.PLASMA, FluidState.PLASMA);
- }
-
- /**
- * Add a plasma for this material.
- *
- * @see #fluid(FluidStorageKey, FluidState)
- */
- public MaterialBuilder plasma(@NotNull FluidRegisterBuilder builder) {
- return fluid(FluidStorageKeys.PLASMA, builder.state(FluidState.PLASMA));
- }
-
- public MaterialBuilder plasma(int temp) {
- return plasma(new FluidRegisterBuilder().temperature(temp));
- }
-
- /**
- * Add a gas for this material.
- *
- * @see #fluid(FluidStorageKey, FluidState)
- */
- public MaterialBuilder gas() {
- return fluid(FluidStorageKeys.GAS, FluidState.GAS);
- }
-
- /**
- * Add a gas for this material.
- *
- * @see #fluid(FluidStorageKey, FluidState)
- */
- public MaterialBuilder gas(@NotNull FluidRegisterBuilder builder) {
- return fluid(FluidStorageKeys.GAS, builder.state(FluidState.GAS));
- }
-
- public MaterialBuilder gas(int temp) {
- return gas(new FluidRegisterBuilder().temperature(temp));
- }
-
- /**
- * Add a {@link DustProperty} to this Material.
- * Will be created with a Harvest Level of 2 and no Burn Time (Furnace Fuel).
- *
- * @throws IllegalArgumentException If a {@link DustProperty} has already been added to this Material.
- */
- public MaterialBuilder dust() {
- properties.ensureSet(PropertyKey.DUST);
- return this;
- }
-
- /**
- * Add a {@link DustProperty} to this Material.
- * Will be created with no Burn Time (Furnace Fuel).
- *
- * @param harvestLevel The Harvest Level of this block for Mining.
- * If this Material also has a {@link ToolProperty}, this value will
- * also be used to determine the tool's Mining Level.
- * @throws IllegalArgumentException If a {@link DustProperty} has already been added to this Material.
- */
- public MaterialBuilder dust(int harvestLevel) {
- return dust(harvestLevel, 0);
- }
-
- /**
- * Add a {@link DustProperty} to this Material.
- *
- * @param harvestLevel The Harvest Level of this block for Mining.
- * If this Material also has a {@link ToolProperty}, this value will
- * also be used to determine the tool's Mining Level.
- * @param burnTime The Burn Time (in ticks) of this Material as a Furnace Fuel.
- * @throws IllegalArgumentException If a {@link DustProperty} has already been added to this Material.
- */
- public MaterialBuilder dust(int harvestLevel, int burnTime) {
- properties.setProperty(PropertyKey.DUST, new DustProperty(harvestLevel, burnTime));
- return this;
- }
-
- /**
- * Add a {@link WoodProperty} to this Material.
- * Useful for marking a Material as Wood for various additional behaviors.
- * Will be created with a Harvest Level of 0, and a Burn Time of 300 (Furnace Fuel).
- *
- * @throws IllegalArgumentException If a {@link DustProperty} has already been added to this Material.
- */
- public MaterialBuilder wood() {
- return wood(0, 300);
- }
-
- /**
- * Add a {@link WoodProperty} to this Material.
- * Useful for marking a Material as Wood for various additional behaviors.
- * Will be created with a Burn Time of 300 (Furnace Fuel).
- *
- * @param harvestLevel The Harvest Level of this block for Mining.
- * If this Material also has a {@link ToolProperty}, this value will
- * also be used to determine the tool's Mining Level.
- * @throws IllegalArgumentException If a {@link DustProperty} has already been added to this Material.
- */
- public MaterialBuilder wood(int harvestLevel) {
- return wood(harvestLevel, 300);
- }
-
- /**
- * Add a {@link WoodProperty} to this Material.
- * Useful for marking a Material as Wood for various additional behaviors.
- *
- * @param harvestLevel The Harvest Level of this block for Mining.
- * If this Material also has a {@link ToolProperty}, this value will
- * also be used to determine the tool's Mining Level.
- * @param burnTime The Burn Time (in ticks) of this Material as a Furnace Fuel.
- * @throws IllegalArgumentException If a {@link DustProperty} has already been added to this Material.
- */
- public MaterialBuilder wood(int harvestLevel, int burnTime) {
- properties.setProperty(PropertyKey.DUST, new DustProperty(harvestLevel, burnTime));
- properties.ensureSet(PropertyKey.WOOD);
- return this;
- }
-
- /**
- * Add an {@link IngotProperty} to this Material.
- * Will be created with a Harvest Level of 2 and no Burn Time (Furnace Fuel).
- * Will automatically add a {@link DustProperty} to this Material if it does not already have one.
- *
- * @throws IllegalArgumentException If an {@link IngotProperty} has already been added to this Material.
- */
- public MaterialBuilder ingot() {
- properties.ensureSet(PropertyKey.INGOT);
- return this;
- }
-
- /**
- * Add an {@link IngotProperty} to this Material.
- * Will be created with no Burn Time (Furnace Fuel).
- * Will automatically add a {@link DustProperty} to this Material if it does not already have one.
- *
- * @param harvestLevel The Harvest Level of this block for Mining. 2 will make it require a iron tool.
- * If this Material also has a {@link ToolProperty}, this value will
- * also be used to determine the tool's Mining level (-1). So 2 will make the tool harvest
- * diamonds.
- * If this Material already had a Harvest Level defined, it will be overridden.
- * @throws IllegalArgumentException If an {@link IngotProperty} has already been added to this Material.
- */
- public MaterialBuilder ingot(int harvestLevel) {
- return ingot(harvestLevel, 0);
- }
-
- /**
- * Add an {@link IngotProperty} to this Material.
- * Will automatically add a {@link DustProperty} to this Material if it does not already have one.
- *
- * @param harvestLevel The Harvest Level of this block for Mining. 2 will make it require a iron tool.
- * If this Material also has a {@link ToolProperty}, this value will
- * also be used to determine the tool's Mining level (-1). So 2 will make the tool harvest
- * diamonds.
- * If this Material already had a Harvest Level defined, it will be overridden.
- * @param burnTime The Burn Time (in ticks) of this Material as a Furnace Fuel.
- * If this Material already had a Burn Time defined, it will be overridden.
- * @throws IllegalArgumentException If an {@link IngotProperty} has already been added to this Material.
- */
- public MaterialBuilder ingot(int harvestLevel, int burnTime) {
- DustProperty prop = properties.getProperty(PropertyKey.DUST);
- if (prop == null) dust(harvestLevel, burnTime);
- else {
- if (prop.getHarvestLevel() == 2) prop.setHarvestLevel(harvestLevel);
- if (prop.getBurnTime() == 0) prop.setBurnTime(burnTime);
- }
- properties.ensureSet(PropertyKey.INGOT);
- return this;
- }
-
- /**
- * Add a {@link GemProperty} to this Material.
- * Will be created with a Harvest Level of 2 and no Burn Time (Furnace Fuel).
- * Will automatically add a {@link DustProperty} to this Material if it does not already have one.
- *
- * @throws IllegalArgumentException If a {@link GemProperty} has already been added to this Material.
- */
- public MaterialBuilder gem() {
- properties.ensureSet(PropertyKey.GEM);
- return this;
- }
-
- /**
- * Add a {@link GemProperty} to this Material.
- * Will be created with no Burn Time (Furnace Fuel).
- * Will automatically add a {@link DustProperty} to this Material if it does not already have one.
- *
- * @param harvestLevel The Harvest Level of this block for Mining.
- * If this Material also has a {@link ToolProperty}, this value will
- * also be used to determine the tool's Mining level.
- * If this Material already had a Harvest Level defined, it will be overridden.
- * @throws IllegalArgumentException If a {@link GemProperty} has already been added to this Material.
- */
- public MaterialBuilder gem(int harvestLevel) {
- return gem(harvestLevel, 0);
- }
-
- /**
- * Add a {@link GemProperty} to this Material.
- * Will automatically add a {@link DustProperty} to this Material if it does not already have one.
- *
- * @param harvestLevel The Harvest Level of this block for Mining.
- * If this Material also has a {@link ToolProperty}, this value will
- * also be used to determine the tool's Mining level.
- * If this Material already had a Harvest Level defined, it will be overridden.
- * @param burnTime The Burn Time (in ticks) of this Material as a Furnace Fuel.
- * If this Material already had a Burn Time defined, it will be overridden.
- */
- public MaterialBuilder gem(int harvestLevel, int burnTime) {
- DustProperty prop = properties.getProperty(PropertyKey.DUST);
- if (prop == null) dust(harvestLevel, burnTime);
- else {
- if (prop.getHarvestLevel() == 2) prop.setHarvestLevel(harvestLevel);
- if (prop.getBurnTime() == 0) prop.setBurnTime(burnTime);
- }
- properties.ensureSet(PropertyKey.GEM);
- return this;
- }
-
- /**
- * Add a {@link PolymerProperty} to this Material.
- * Will be created with a Harvest Level of 2 and no Burn Time (Furnace Fuel).
- * Will automatically add a {@link DustProperty} to this Material if it does not already have one.
- *
- * @throws IllegalArgumentException If an {@link PolymerProperty} has already been added to this Material.
- */
- public MaterialBuilder polymer() {
- properties.ensureSet(PropertyKey.POLYMER);
- return this;
- }
-
- /**
- * Add a {@link PolymerProperty} to this Material.
- * Will automatically add a {@link DustProperty} to this Material if it does not already have one.
- * Will have a burn time of 0
- *
- * @param harvestLevel The Harvest Level of this block for Mining.
- * If this Material also has a {@link ToolProperty}, this value will
- * also be used to determine the tool's Mining level.
- * If this Material already had a Harvest Level defined, it will be overridden.
- * @throws IllegalArgumentException If an {@link PolymerProperty} has already been added to this Material.
- */
- public MaterialBuilder polymer(int harvestLevel) {
- DustProperty prop = properties.getProperty(PropertyKey.DUST);
- if (prop == null) dust(harvestLevel, 0);
- else if (prop.getHarvestLevel() == 2) prop.setHarvestLevel(harvestLevel);
- properties.ensureSet(PropertyKey.POLYMER);
- return this;
- }
-
- public MaterialBuilder burnTime(int burnTime) {
- DustProperty prop = properties.getProperty(PropertyKey.DUST);
- if (prop == null) {
- dust();
- prop = properties.getProperty(PropertyKey.DUST);
- }
- prop.setBurnTime(burnTime);
- return this;
- }
-
- /**
- * Set the Color of this Material.
- * Defaults to 0xFFFFFF unless {@link MaterialBuilder#colorAverage()} was called, where
- * it will be a weighted average of the components of the Material.
- *
- * @param color The RGB-formatted Color.
- */
- public MaterialBuilder color(int color) {
- color(color, true);
- return this;
- }
-
- /**
- * Set the Color of this Material.
- * Defaults to 0xFFFFFF unless {@link MaterialBuilder#colorAverage()} was called, where
- * it will be a weighted average of the components of the Material.
- *
- * @param color The RGB-formatted Color.
- * @param hasFluidColor Whether the fluid should be colored or not.
- */
- public MaterialBuilder color(int color, boolean hasFluidColor) {
- this.materialInfo.getColors().set(0, color);
- this.materialInfo.setHasFluidColor(hasFluidColor);
- return this;
- }
-
- /**
- * Set the secondary color of this Material.
- * Defaults to 0xFFFFFF unless {@link MaterialBuilder#colorAverage()} was called, where
- * it will be a weighted average of the components of the Material.
- *
- * @param color The RGB-formatted Color.
- */
- public MaterialBuilder secondaryColor(int color) {
- this.materialInfo.getColors().set(1, color);
- return this;
- }
-
- public MaterialBuilder colorAverage() {
- this.averageRGB = true;
- return this;
- }
-
- /**
- * Set the {@link MaterialIconSet} of this Material.
- * Defaults vary depending on if the Material has a:
- *
- * - {@link GemProperty}, it will default to {@link BreaMaterialIconSet#GEM_VERTICAL}
- *
- {@link IngotProperty} or {@link DustProperty}, it will default to {@link BreaMaterialIconSet#DULL}
- *
- {@link FluidProperty}, it will default to {@link BreaMaterialIconSet#FLUID}
- *
- * Default will be determined by first-found Property in this order, unless specified.
- *
- * @param iconSet The {@link MaterialIconSet} of this Material.
- */
- public MaterialBuilder iconSet(MaterialIconSet iconSet) {
- materialInfo.setIconSet(iconSet);
- return this;
- }
-
- public MaterialBuilder components(Object... components) {
- Preconditions.checkArgument(
- components.length % 2 == 0,
- "Material Components list malformed!");
-
- for (int i = 0; i < components.length; i += 2) {
- if (components[i] == null) {
- throw new IllegalArgumentException(
- "Material in Components List is null for Material " + this.materialInfo.getIdentifier());
- }
- composition.add(new MaterialStack(
- components[i] instanceof CharSequence chars ? BreaMaterials.get(chars.toString()) :
- (Material) components[i],
- ((Number) components[i + 1]).longValue()));
- }
- return this;
- }
-
- public MaterialBuilder componentStacks(MaterialStack... components) {
- composition = Arrays.asList(components);
- return this;
- }
-
- public MaterialBuilder componentStacks(ImmutableList components) {
- composition = components;
- return this;
- }
-
- /**
- * Add {@link MaterialFlags} to this Material.
- * Dependent Flags (for example, {@link MaterialFlags#GENERATE_LONG_ROD} requiring
- * {@link MaterialFlags#GENERATE_ROD}) will be automatically applied.
- */
- public MaterialBuilder flags(MaterialFlag... flags) {
- this.flags.addFlags(flags);
- return this;
- }
-
- /**
- * Add {@link MaterialFlags} to this Material.
- * Dependent Flags (for example, {@link MaterialFlags#GENERATE_LONG_ROD} requiring
- * {@link MaterialFlags#GENERATE_ROD}) will be automatically applied.
- *
- * @param f1 A {@link Collection} of {@link MaterialFlag}. Provided this way for easy Flag presets to be
- * applied.
- * @param f2 An Array of {@link MaterialFlag}. If no {@link Collection} is required, use
- * {@link MaterialBuilder#flags(MaterialFlag...)}.
- */
- // rename for kjs conflicts
- public MaterialBuilder appendFlags(Collection f1, MaterialFlag... f2) {
- this.flags.addFlags(f1.toArray(new MaterialFlag[0]));
- this.flags.addFlags(f2);
- return this;
- }
-
- /**
- * Added {@link TagPrefix} to be ignored by this Material.
- */
- public MaterialBuilder ignoredTagPrefixes(TagPrefix... prefixes) {
- if (this.ignoredTagPrefixes == null) {
- this.ignoredTagPrefixes = new HashSet<>();
- }
- this.ignoredTagPrefixes.addAll(Arrays.asList(prefixes));
- return this;
- }
-
- public MaterialBuilder element(Element element) {
- this.materialInfo.setElement(element);
- return this;
- }
-
- public MaterialBuilder formula(String formula) {
- this.formula = formula;
- return this;
- }
-
- /**
- * Replaced the old toolStats methods which took many parameters.
- * Use {@link ToolProperty.Builder} instead to create a Tool Property.
- */
- public MaterialBuilder toolStats(ToolProperty toolProperty) {
- properties.setProperty(PropertyKey.TOOL, toolProperty);
- return this;
- }
-
- public MaterialBuilder blastTemp(int temp) {
- return blast(temp);
- }
-
- public MaterialBuilder blastTemp(int temp, int eutOverride) {
- return blast(b -> b.temp(temp).blastStats(eutOverride));
- }
-
- public MaterialBuilder blastTemp(int temp, int eutOverride, int durationOverride) {
- return blast(b -> b.temp(temp).blastStats(eutOverride, durationOverride));
- }
-
- public MaterialBuilder blast(int temp) {
- properties.setProperty(PropertyKey.BLAST, new BlastProperty(temp));
- return this;
- }
-
- public MaterialBuilder blast(UnaryOperator b) {
- properties.setProperty(PropertyKey.BLAST, b.apply(new BlastProperty.Builder()).build());
- return this;
- }
-
- public MaterialBuilder ore() {
- properties.ensureSet(PropertyKey.ORE);
- return this;
- }
-
- public MaterialBuilder ore(boolean emissive) {
- properties.setProperty(PropertyKey.ORE, new OreProperty(1, 1, emissive));
- return this;
- }
-
- public MaterialBuilder ore(int oreMultiplier, int byproductMultiplier) {
- properties.setProperty(PropertyKey.ORE, new OreProperty(oreMultiplier, byproductMultiplier));
- return this;
- }
-
- public MaterialBuilder ore(int oreMultiplier, int byproductMultiplier, boolean emissive) {
- properties.setProperty(PropertyKey.ORE, new OreProperty(oreMultiplier, byproductMultiplier, emissive));
- return this;
- }
-
- public MaterialBuilder washedIn(Material m) {
- properties.ensureSet(PropertyKey.ORE);
- properties.getProperty(PropertyKey.ORE).setWashedIn(m);
- return this;
- }
-
- public MaterialBuilder washedIn(Material m, int washedAmount) {
- properties.ensureSet(PropertyKey.ORE);
- properties.getProperty(PropertyKey.ORE).setWashedIn(m, washedAmount);
- return this;
- }
-
- public MaterialBuilder separatedInto(Material... m) {
- properties.ensureSet(PropertyKey.ORE);
- properties.getProperty(PropertyKey.ORE).setSeparatedInto(m);
- return this;
- }
-
- public MaterialBuilder oreSmeltInto(Material m) {
- properties.ensureSet(PropertyKey.ORE);
- properties.getProperty(PropertyKey.ORE).setDirectSmeltResult(m);
- return this;
- }
-
- public MaterialBuilder polarizesInto(Material m) {
- properties.ensureSet(PropertyKey.INGOT);
- properties.getProperty(PropertyKey.INGOT).setMagneticMaterial(m);
- return this;
- }
-
- public MaterialBuilder arcSmeltInto(Material m) {
- properties.ensureSet(PropertyKey.INGOT);
- properties.getProperty(PropertyKey.INGOT).setArcSmeltingInto(m);
- return this;
- }
-
- public MaterialBuilder macerateInto(Material m) {
- properties.ensureSet(PropertyKey.INGOT);
- properties.getProperty(PropertyKey.INGOT).setMacerateInto(m);
- return this;
- }
-
- public MaterialBuilder ingotSmeltInto(Material m) {
- properties.ensureSet(PropertyKey.INGOT);
- properties.getProperty(PropertyKey.INGOT).setSmeltingInto(m);
- return this;
- }
-
- public MaterialBuilder addOreByproducts(Material... byproducts) {
- properties.ensureSet(PropertyKey.ORE);
- properties.getProperty(PropertyKey.ORE).setOreByProducts(byproducts);
- return this;
- }
-
- public Material buildAndRegister() {
- materialInfo.setComponentList(ImmutableList.copyOf(composition));
- for (MaterialStack materialStack : materialInfo.getComponentList()) {
- Material material = materialStack.material();
- }
-
- var mat = new Material(materialInfo, properties, flags);
- if (formula != null) {
- mat.setFormula(formula);
- }
- materialInfo.verifyInfo(properties, averageRGB);
- mat.registerMaterial();
- if (ignoredTagPrefixes != null) {
- ignoredTagPrefixes.forEach(p -> p.setIgnored(mat));
- }
- return mat;
- }
-}
+public class MaterialBuilder {}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/registry/MaterialRegistry.java b/src/main/java/net/phasetranscrystal/breacore/api/material/registry/MaterialRegistry.java
index 501685c..13b7ebd 100644
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/registry/MaterialRegistry.java
+++ b/src/main/java/net/phasetranscrystal/breacore/api/material/registry/MaterialRegistry.java
@@ -1,9 +1,9 @@
package net.phasetranscrystal.breacore.api.material.registry;
import net.phasetranscrystal.breacore.BreakdownCore;
+import net.phasetranscrystal.breacore.api.material.MarkerMaterial;
import net.phasetranscrystal.breacore.api.material.Material;
import net.phasetranscrystal.breacore.api.registry.BreaRegistry;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterials;
import net.minecraft.core.Holder;
import net.minecraft.core.RegistrationInfo;
@@ -16,7 +16,7 @@
import java.util.*;
import java.util.stream.Stream;
-public final class MaterialRegistry extends BreaRegistry implements IMaterialRegistry {
+public class MaterialRegistry extends BreaRegistry implements IMaterialRegistry {
private final Set usedNamespaces = new HashSet<>();
private final Map fallbackMaterials = new HashMap<>();
@@ -42,7 +42,7 @@ public Material register(Material material) {
@Override
public Material getMaterial(Identifier name) {
- return getOrDefault(name, BreaMaterials.NULL);
+ return getOrDefault(name, MarkerMaterial.NULL);
}
@Override
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/stack/ItemMaterialInfo.java b/src/main/java/net/phasetranscrystal/breacore/api/material/stack/ItemMaterialInfo.java
deleted file mode 100644
index 40042e2..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/stack/ItemMaterialInfo.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.stack;
-
-import net.phasetranscrystal.breacore.api.material.Material;
-
-import it.unimi.dsi.fastutil.objects.Reference2LongMap;
-import it.unimi.dsi.fastutil.objects.Reference2LongOpenHashMap;
-import org.jetbrains.annotations.UnmodifiableView;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-public class ItemMaterialInfo {
-
- private final List sortedMaterials = new ArrayList<>();
- private int sortedHash = 0;
-
- public ItemMaterialInfo(MaterialStack... materialStacks) {
- var materials = new Reference2LongOpenHashMap();
- for (var mat : materialStacks) {
- materials.addTo(mat.material(), mat.amount());
- }
- setSortedMaterials(materials);
- }
-
- public ItemMaterialInfo(List materialStacks) {
- var materials = new Reference2LongOpenHashMap();
- for (var stack : materialStacks) {
- materials.addTo(stack.material(), stack.amount());
- }
- setSortedMaterials(materials);
- }
-
- public ItemMaterialInfo(Reference2LongMap materialList) {
- setSortedMaterials(materialList);
- }
-
- /**
- * Returns the first MaterialStack in the "materials" list
- */
- public MaterialStack getMaterial() {
- return sortedMaterials.isEmpty() ? MaterialStack.EMPTY : sortedMaterials.getFirst();
- }
-
- /**
- * Returns all MaterialStacks associated with this Object.
- */
- @UnmodifiableView
- public List getMaterials() {
- return Collections.unmodifiableList(sortedMaterials);
- }
-
- public void addMaterialStacks(List stacks) {
- var materials = new Reference2LongOpenHashMap();
- sortedMaterials.forEach(stack -> materials.addTo(stack.material(), stack.amount()));
- stacks.forEach(stack -> materials.addTo(stack.material(), stack.amount()));
- setSortedMaterials(materials);
- }
-
- private void setSortedMaterials(Reference2LongMap materials) {
- sortedMaterials.clear();
- materials.reference2LongEntrySet().stream()
- .sorted(Comparator.comparingLong(Reference2LongMap.Entry::getLongValue))
- .forEach(entry -> sortedMaterials.add(new MaterialStack(entry.getKey(), entry.getLongValue())));
- sortedHash = sortedMaterials.hashCode();
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ItemMaterialInfo that = (ItemMaterialInfo) o;
- return this.hashCode() == o.hashCode() && sortedMaterials.equals(that.sortedMaterials);
- }
-
- @Override
- public int hashCode() {
- return sortedHash;
- }
-
- @Override
- public String toString() {
- return sortedMaterials.isEmpty() ? "" : sortedMaterials.getFirst().material().toCamelCaseString();
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialEntry.java b/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialEntry.java
deleted file mode 100644
index eb8f5ce..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialEntry.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package net.phasetranscrystal.breacore.api.material.stack;
-
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.api.tag.TagPrefix;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterials;
-
-import com.google.common.base.Preconditions;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import java.util.Map;
-import java.util.WeakHashMap;
-
-public record MaterialEntry(@NotNull TagPrefix tagPrefix, @NotNull Material material) {
-
- public static final MaterialEntry NULL_ENTRY = new MaterialEntry(TagPrefix.NULL_PREFIX, BreaMaterials.NULL);
- private static final Map PARSE_CACHE = new WeakHashMap<>();
-
- public MaterialEntry {
- Preconditions.checkNotNull(tagPrefix, "MaterialEntry TagPrefix cannot be null!");
- Preconditions.checkNotNull(material, "MaterialEntry Material cannot be null!");
- }
-
- public MaterialEntry(TagPrefix tagPrefix) {
- this(tagPrefix, BreaMaterials.NULL);
- }
-
- public static @Nullable MaterialEntry of(Object o) {
- if (o instanceof MaterialEntry entry) return entry;
- if (o instanceof CharSequence chars) {
- var str = chars.toString().trim();
- var cached = PARSE_CACHE.get(str);
- if (cached != null) return cached;
-
- var values = str.split(":", 2);
- if (values.length > 1) {
- var prefix = TagPrefix.get(values[0]);
- if (prefix == null) throw new IllegalArgumentException("Invalid TagPrefix: " + values[0]);
- cached = new MaterialEntry(prefix, BreaMaterials.get(values[1]));
- PARSE_CACHE.put(str, cached);
- return cached;
- }
- }
- return null;
- }
-
- public boolean isEmpty() {
- return this == NULL_ENTRY || material() == BreaMaterials.NULL || tagPrefix().isEmpty();
- }
-
- @Override
- public String toString() {
- if (tagPrefix.isEmpty()) {
- return material.getIdentifier().toString();
- }
- var tags = tagPrefix.getItemTags(material);
- if (tags.isEmpty()) {
- return tagPrefix.name + "/" + material.getName();
- }
- return tags.getFirst().location().toString();
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialInstance.java b/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialInstance.java
new file mode 100644
index 0000000..ba33e2b
--- /dev/null
+++ b/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialInstance.java
@@ -0,0 +1,33 @@
+package net.phasetranscrystal.breacore.api.material.stack;
+
+import net.phasetranscrystal.breacore.api.material.MarkerMaterial;
+import net.phasetranscrystal.breacore.api.material.Material;
+import net.phasetranscrystal.breacore.api.registry.BreaRegistries;
+
+import net.minecraft.core.Holder;
+import net.minecraft.core.TypedInstance;
+import net.minecraft.core.component.DataComponentGetter;
+import net.minecraft.network.RegistryFriendlyByteBuf;
+import net.minecraft.network.codec.ByteBufCodecs;
+import net.minecraft.network.codec.StreamCodec;
+
+import com.mojang.serialization.Codec;
+import com.mojang.serialization.DataResult;
+
+public interface MaterialInstance extends TypedInstance, DataComponentGetter {
+
+ String MATERIAL_ID = "id";
+ String MATERIAL_AMOUNT = "amount";
+ String FIELD_COMPONENTS = "components";
+
+ Codec> MATERIAL_HOLDER_CODEC = BreaRegistries.MATERIALS
+ .holderByNameCodec()
+ .validate(material -> material.is(MarkerMaterial.NULL.builtInRegistryHolder()) ? DataResult.error(() -> "Material must not be breacore:null") : DataResult.success(material));
+
+ StreamCodec> MATERIAL_HOLDER_STREAM_CODEC = ByteBufCodecs.holderRegistry(BreaRegistries.MATERIAL_KEY);
+
+ Codec> MATERIAL_HOLDER_CODEC_WITH_BOUND_COMPONENTS = MATERIAL_HOLDER_CODEC.validate(
+ material -> !material.areComponentsBound() ? DataResult.error(() -> "Material " + material.getRegisteredName() + " does not have components yet") : DataResult.success(material));
+
+ int amount();
+}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialResource.java b/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialResource.java
new file mode 100644
index 0000000..dfe3451
--- /dev/null
+++ b/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialResource.java
@@ -0,0 +1,167 @@
+package net.phasetranscrystal.breacore.api.material.stack;
+
+import net.phasetranscrystal.breacore.api.material.MarkerMaterial;
+import net.phasetranscrystal.breacore.api.material.Material;
+
+import net.minecraft.core.Holder;
+import net.minecraft.core.component.DataComponentMap;
+import net.minecraft.core.component.DataComponentPatch;
+import net.minecraft.core.component.DataComponentType;
+import net.minecraft.network.RegistryFriendlyByteBuf;
+import net.minecraft.network.codec.StreamCodec;
+import net.minecraft.util.ExtraCodecs;
+import net.neoforged.neoforge.transfer.TransferPreconditions;
+import net.neoforged.neoforge.transfer.resource.DataComponentHolderResource;
+
+import com.mojang.serialization.Codec;
+
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+public class MaterialResource implements DataComponentHolderResource {
+
+ public static final MaterialResource EMPTY = new MaterialResource(MaterialStack.EMPTY);
+ public static final Codec CODEC = MaterialStack.fixedAmountCodec(1)
+ .xmap(MaterialResource::of, resource -> resource.toStack(1));
+ public static final Codec OPTIONAL_CODEC = ExtraCodecs.optionalEmptyMap(CODEC).xmap(
+ optional -> optional.orElse(MaterialResource.EMPTY),
+ resource -> resource.isEmpty() ? Optional.empty() : Optional.of(resource));
+ public static final StreamCodec STREAM_CODEC = StreamCodec.composite(
+ MaterialInstance.MATERIAL_HOLDER_STREAM_CODEC, MaterialResource::typeHolder,
+ DataComponentPatch.STREAM_CODEC, MaterialResource::getComponentsPatch,
+ MaterialResource::of);
+
+ public static MaterialResource of(MaterialStack stack) {
+ if (stack.isEmpty() || stack.isComponentsPatchEmpty()) {
+ return of(stack.getMaterial());
+ }
+ return new MaterialResource(stack.copyWithAmount(1));
+ }
+
+ public static MaterialResource of(Material material) {
+ if (material == MarkerMaterial.NULL) return EMPTY;
+ return material.computeDefaultResource(m -> new MaterialResource(new MaterialStack(m, 1)));
+ }
+
+ public static MaterialResource of(Holder material) {
+ return of(material.value());
+ }
+
+ public static MaterialResource of(Holder holder, DataComponentPatch patch) {
+ if (holder.value() == MarkerMaterial.NULL || patch.isEmpty())
+ return of(holder.value());
+ return new MaterialResource(new MaterialStack(holder, 1, patch));
+ }
+
+ private final MaterialStack innerStack;
+
+ private MaterialResource(MaterialStack innerStack) {
+ this.innerStack = innerStack;
+ }
+
+ @Override
+ public Material value() {
+ return innerStack.getMaterial();
+ }
+
+ public Material getMaterial() {
+ return value();
+ }
+
+ @Override
+ public Holder typeHolder() {
+ return innerStack.typeHolder();
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return innerStack.isEmpty();
+ }
+
+ @Override
+ public MaterialResource withMergedPatch(DataComponentPatch patch) {
+ if (isEmpty() || patch.isEmpty())
+ return this;
+ var stack = innerStack.copy();
+ stack.applyComponents(patch);
+ return MaterialResource.of(stack);
+ }
+
+ @Override
+ public MaterialResource with(DataComponentType type, D data) {
+ if (isEmpty()) return MaterialResource.EMPTY;
+ if (Objects.equals(get(type), data)) return this;
+ var stack = innerStack.copy();
+ stack.set(type, data);
+ return MaterialResource.of(stack);
+ }
+
+ @Override
+ public MaterialResource with(Supplier extends DataComponentType> type, D data) {
+ return with(type.get(), data);
+ }
+
+ @Override
+ public MaterialResource without(DataComponentType> type) {
+ if (isEmpty()) return MaterialResource.EMPTY;
+ if (get(type) == null) return this;
+ var stack = innerStack.copy();
+ stack.remove(type);
+ return MaterialResource.of(stack);
+ }
+
+ @Override
+ public MaterialResource without(Supplier extends DataComponentType>> type) {
+ return without(type.get());
+ }
+
+ @Override
+ public DataComponentMap getComponents() {
+ return innerStack.immutableComponents();
+ }
+
+ @Override
+ public DataComponentPatch getComponentsPatch() {
+ return innerStack.getComponentsPatch();
+ }
+
+ public MaterialStack toStack(int amount) {
+ TransferPreconditions.checkNonNegative(amount);
+ if (amount == 0) return MaterialStack.EMPTY;
+ return innerStack.copyWithAmount(amount);
+ }
+
+ @Override
+ public boolean isComponentsPatchEmpty() {
+ return innerStack.isComponentsPatchEmpty();
+ }
+
+ public boolean matches(MaterialStack stack) {
+ return MaterialStack.isSameMaterialSameComponents(stack, innerStack);
+ }
+
+ public boolean test(Predicate predicate) {
+ return predicate.test(innerStack);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (obj == null || this.getClass() != obj.getClass()) return false;
+ MaterialResource other = (MaterialResource) obj;
+ return MaterialStack.isSameMaterialSameComponents(this.innerStack, other.innerStack);
+ }
+
+ @Override
+ public int hashCode() {
+ return MaterialStack.hashMaterialAndComponents(innerStack);
+ }
+
+ @Override
+ public String toString() {
+ // Fluid type string with patch count
+ return value() + " [" + getComponentsPatch().size() + "]";
+ }
+}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialStack.java b/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialStack.java
index 45386c5..7cfe5d9 100644
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialStack.java
+++ b/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialStack.java
@@ -1,158 +1,298 @@
package net.phasetranscrystal.breacore.api.material.stack;
-import net.phasetranscrystal.brealib.util.FormattingUtil;
-
+import net.phasetranscrystal.breacore.api.material.MarkerMaterial;
import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterials;
-
-import org.jetbrains.annotations.NotNull;
-
-import java.util.Map;
-import java.util.WeakHashMap;
-
-/**
- * 表示具有特定数量的不可变材料堆栈。
- *
- * {@code MaterialStack} 将 {@link Material} 与数量配对。
- * 通常用于配方、库存和材料处理操作。
- * 该类是一个 {@code record},因此基于其组件自动提供 {@code equals()}、{@code hashCode()} 和 {@code toString()} 的实现。
- *
- *
- * 此类通过 {@link #EMPTY} 提供静态空实例,并支持从字符串表示解析,且为了提高性能而进行了缓存。
- *
- *
- * @param material 此堆栈中包含的材料;永不为 null
- * @param amount 材料的数量;可能为零或正数
- * @see Material
- * @see BreaMaterials
- * @see #EMPTY
- */
-public record MaterialStack(@NotNull Material material, long amount) {
- /**
- * 空材料堆栈实例。
- *
- * 此堆栈使用 {@link BreaMaterials#NULL} 作为其材料,数量为 0。
- * 建议使用此常量而不是创建新的空堆栈。
- *
- */
- public static final MaterialStack EMPTY = new MaterialStack(BreaMaterials.NULL, 0);
+import net.minecraft.core.Holder;
+import net.minecraft.core.component.*;
+import net.minecraft.network.RegistryFriendlyByteBuf;
+import net.minecraft.network.codec.StreamCodec;
+import net.minecraft.util.ExtraCodecs;
+import net.neoforged.neoforge.common.MutableDataComponentHolder;
- /**
- * 已解析材料堆栈的缓存,以避免冗余解析。
- *
- * 使用 {@link WeakHashMap} 允许在解析的字符串在其他地方不再使用时对缓存条目进行垃圾回收。
- *
- */
- private static final Map PARSE_CACHE = new WeakHashMap<>();
+import com.mojang.serialization.Codec;
+import com.mojang.serialization.MapCodec;
+import com.mojang.serialization.codecs.RecordCodecBuilder;
+import io.netty.handler.codec.DecoderException;
+import io.netty.handler.codec.EncoderException;
+import lombok.Setter;
+import org.jspecify.annotations.Nullable;
- /**
- * 将字符串表示解析为 {@code MaterialStack}。
- *
- * 字符串格式可以是以下之一:
- *
- * - {@code "MaterialName"} - 单个该材料
- * - {@code "Nx MaterialName"} - N 个该材料(例如,"3x Iron")
- *
- * 解析器对材料名称区分大小写,并期望有一个可选的计数前缀,用空格分隔。字符串周围的空格会被修剪。
- *
- *
- * 结果缓存在弱缓存中,以提高重复解析相同字符串时的性能。
- *
- *
- * @param str 要解析的字符串;可能为 null 或空
- * @return 解析后的材料堆栈;永不为 null,但如果找不到材料,则可能为 {@link #EMPTY}
- * @throws NumberFormatException 如果计数前缀不是有效的整数
- * @see BreaMaterials#get(String)
- * @see #toString()
- */
- public static MaterialStack fromString(CharSequence str) {
- String trimmed = str.toString().trim();
- String copy = trimmed;
+import java.util.*;
+import java.util.function.Predicate;
+
+public final class MaterialStack implements MutableDataComponentHolder, MaterialInstance, DataComponentHolder {
+
+ public static final MapCodec MAP_CODEC = MapCodec.recursive(
+ "MaterialStack",
+ c -> RecordCodecBuilder.mapCodec(
+ instance -> instance.group(
+ MATERIAL_HOLDER_CODEC_WITH_BOUND_COMPONENTS.fieldOf(MATERIAL_ID).forGetter(MaterialStack::typeHolder),
+ ExtraCodecs.POSITIVE_INT.fieldOf(MATERIAL_AMOUNT).forGetter(MaterialStack::getAmount),
+ DataComponentPatch.CODEC.optionalFieldOf(FIELD_COMPONENTS, DataComponentPatch.EMPTY)
+ .forGetter(stack -> stack.components.asPatch()))
+ .apply(instance, MaterialStack::new)));
+ public static final Codec CODEC = Codec.lazyInitialized(MAP_CODEC::codec);
+
+ public static Codec fixedAmountCodec(int amount) {
+ return Codec.lazyInitialized(
+ () -> RecordCodecBuilder.create(
+ instance -> instance.group(
+ MATERIAL_HOLDER_CODEC.fieldOf(MATERIAL_ID).forGetter(MaterialStack::typeHolder),
+ DataComponentPatch.CODEC.optionalFieldOf(FIELD_COMPONENTS, DataComponentPatch.EMPTY)
+ .forGetter(stack -> stack.components.asPatch()))
+ .apply(instance, (holder, patch) -> new MaterialStack(holder, amount, patch))));
+ }
+
+ public static final Codec OPTIONAL_CODEC = ExtraCodecs.optionalEmptyMap(CODEC)
+ .xmap(optional -> optional.orElse(MaterialStack.EMPTY), stack -> stack.isEmpty() ? Optional.empty() : Optional.of(stack));
+
+ public static final StreamCodec OPTIONAL_STREAM_CODEC = new StreamCodec() {
- var cached = PARSE_CACHE.get(trimmed);
+ @Override
+ public MaterialStack decode(RegistryFriendlyByteBuf buf) {
+ var amount = buf.readVarInt();
+ if (amount <= 0)
+ return MaterialStack.EMPTY;
+ else {
+ var holder = MATERIAL_HOLDER_STREAM_CODEC.decode(buf);
+ var patch = DataComponentPatch.STREAM_CODEC.decode(buf);
+ return new MaterialStack(holder, amount, patch);
+ }
+ }
- if (cached != null) {
- return cached;
+ @Override
+ public void encode(RegistryFriendlyByteBuf buf, MaterialStack stack) {
+ if (stack.isEmpty())
+ buf.writeVarInt(0);
+ else {
+ buf.writeVarInt(stack.getAmount());
+ MATERIAL_HOLDER_STREAM_CODEC.encode(buf, stack.typeHolder());
+ DataComponentPatch.STREAM_CODEC.encode(buf, stack.components.asPatch());
+ }
}
+ };
+ public static final StreamCodec STREAM_CODEC = new StreamCodec() {
- var count = 1;
- var spaceIndex = copy.indexOf(' ');
+ @Override
+ public MaterialStack decode(RegistryFriendlyByteBuf buf) {
+ var stack = MaterialStack.OPTIONAL_STREAM_CODEC.decode(buf);
+ if (stack.isEmpty())
+ throw new DecoderException("Empty MaterialStack not allowed");
+ return stack;
+ }
- if (spaceIndex >= 2 && copy.indexOf('x') == spaceIndex - 1) {
- count = Integer.parseInt(copy.substring(0, spaceIndex - 1));
- copy = copy.substring(spaceIndex + 1);
+ @Override
+ public void encode(RegistryFriendlyByteBuf buf, MaterialStack stack) {
+ if (stack.isEmpty())
+ throw new EncoderException("Empty MaterialStack not allowed");
+ MaterialStack.OPTIONAL_STREAM_CODEC.encode(buf, stack);
}
+ };
- cached = new MaterialStack(BreaMaterials.get(copy), count);
- PARSE_CACHE.put(trimmed, cached);
- return cached;
+ public static final MaterialStack EMPTY = new MaterialStack(null);
+ @Setter
+ private int amount;
+ private final @Nullable Holder material;
+ private final PatchedDataComponentMap components;
+
+ @Override
+ public DataComponentMap getComponents() {
+ return isEmpty() ? DataComponentMap.EMPTY : components;
+ }
+
+ public DataComponentPatch getComponentsPatch() {
+ return !this.isEmpty() ? this.components.asPatch() : DataComponentPatch.EMPTY;
+ }
+
+ public DataComponentMap immutableComponents() {
+ return !this.isEmpty() ? this.components.toImmutableMap() : DataComponentMap.EMPTY;
+ }
+
+ public boolean hasNonDefault(DataComponentType> type) {
+ return !isEmpty() && components.hasNonDefault(type);
+ }
+
+ public boolean isComponentsPatchEmpty() {
+ return this.isEmpty() || this.components.isPatchEmpty();
+ }
+
+ public MaterialStack(Material material, int amount, DataComponentPatch patch) {
+ this(material.builtInRegistryHolder(), amount, patch);
+ }
+
+ public MaterialStack(Material material, int amount) {
+ this(material.builtInRegistryHolder(), amount, DataComponentPatch.EMPTY);
+ }
+
+ public MaterialStack(Holder material, int amount, DataComponentPatch patch) {
+ this(material, amount, PatchedDataComponentMap.fromPatch(material.components(), patch));
+ }
+
+ public MaterialStack(Holder material, int amount) {
+ this(material, amount, DataComponentPatch.EMPTY);
+ }
+
+ public MaterialStack(Holder material, int amount, PatchedDataComponentMap components) {
+ this.material = material;
+ this.amount = amount;
+ this.components = components;
+ }
+
+ private MaterialStack(@Nullable Void unused) {
+ this.material = null;
+ this.components = new PatchedDataComponentMap(DataComponentMap.EMPTY);
+ }
+
+ public boolean isEmpty() {
+ return this == EMPTY || material.value().isSame(MarkerMaterial.NULL) || this.amount <= 0;
+ }
+
+ public MaterialStack split(int amount) {
+ int i = Math.min(amount, getAmount());
+ MaterialStack materialStack = this.copyWithAmount(i);
+ this.shrink(i);
+ return materialStack;
+ }
+
+ public MaterialStack copyAndClear() {
+ if (this.isEmpty()) {
+ return EMPTY;
+ } else {
+ MaterialStack materialStack = this.copy();
+ this.setAmount(0);
+ return materialStack;
+ }
+ }
+
+ public Material getMaterial() {
+ return typeHolder().value();
+ }
+
+ @Override
+ public Holder typeHolder() {
+ return isEmpty() ? MarkerMaterial.NULL.builtInRegistryHolder() : material;
+ }
+
+ public boolean is(Predicate> holderPredicate) {
+ return holderPredicate.test(this.typeHolder());
}
- /**
- * 创建此材料堆栈的副本。
- *
- * 由于 {@code MaterialStack} 是不可变的,如果堆栈为空(由 {@link #isEmpty()} 定义),则此方法返回相同实例,
- * 否则创建具有相同材料和数量的新实例。
- *
- *
- * @return 此材料堆栈的副本;如果为空,则可能是相同实例
- */
public MaterialStack copy() {
- if (isEmpty()) return EMPTY;
- return new MaterialStack(material, amount);
+ if (this.isEmpty()) {
+ return EMPTY;
+ } else {
+ return new MaterialStack(typeHolder(), amount(), this.components.copy());
+ }
+ }
+
+ public MaterialStack copyWithAmount(int amount) {
+ if (this.isEmpty()) {
+ return EMPTY;
+ } else {
+ MaterialStack materialStack = this.copy();
+ materialStack.setAmount(amount);
+ return materialStack;
+ }
+ }
+
+ public MaterialStack transmuteCopy(Material newMaterial) {
+ return transmuteCopy(newMaterial, amount());
+ }
+
+ public MaterialStack transmuteCopy(Material newMaterial, int newAmount) {
+ return isEmpty() ? EMPTY : transmuteCopyIgnoreEmpty(newMaterial, newAmount);
+ }
+
+ private MaterialStack transmuteCopyIgnoreEmpty(Material newMaterial, int newAmount) {
+ return new MaterialStack(newMaterial, newAmount, components.asPatch());
+ }
+
+ @Override
+ public String toString() {
+ return this.getAmount() + " " + this.getMaterial();
+ }
+
+ @Override
+ public @Nullable T set(DataComponentType componentType, @Nullable T value) {
+ return this.components.set(componentType, value);
+ }
+
+ public @Nullable T set(TypedDataComponent value) {
+ return components.set(value);
+ }
+
+ @Override
+ public @Nullable T remove(DataComponentType extends T> componentType) {
+ return this.components.remove(componentType);
+ }
+
+ @Override
+ public void applyComponents(DataComponentPatch patch) {
+ this.components.applyPatch(patch);
+ }
+
+ @Override
+ public void applyComponents(DataComponentMap components) {
+ this.components.setAll(components);
+ }
+
+ @Override
+ public int amount() {
+ return this.isEmpty() ? 0 : this.amount;
+ }
+
+ public int getAmount() {
+ return amount();
+ }
+
+ public void grow(int addedAmount) {
+ this.setAmount(this.getAmount() + addedAmount);
+ }
+
+ public void shrink(int removedAmount) {
+ this.grow(-removedAmount);
+ }
+
+ public static boolean matches(MaterialStack first, MaterialStack second) {
+ if (first == second) {
+ return true;
+ } else {
+ return first.getAmount() != second.getAmount() ? false : isSameMaterialSameComponents(first, second);
+ }
+ }
+
+ public static boolean isSameMaterial(MaterialStack first, MaterialStack second) {
+ return first.is(second.getMaterial());
}
/**
- * 检查此材料堆栈是否为空。
- *
- * 堆栈在以下情况下被视为空:
- *
- * - 材料为 {@link BreaMaterials#NULL},或
- * - 数量小于 1
- *
- *
+ * Checks if the two fluid stacks have the same fluid and components. Ignores amount.
*
- * @return 如果此堆栈为空则为 {@code true},否则为 {@code false}
+ * @return {@code true} if the two fluid stacks have the same fluid and components
*/
- public boolean isEmpty() {
- return this.material == BreaMaterials.NULL || this.amount < 1;
+ public static boolean isSameMaterialSameComponents(MaterialStack first, MaterialStack second) {
+ if (!first.is(second.getMaterial())) {
+ return false;
+ } else {
+ return first.isEmpty() && second.isEmpty() ? true : Objects.equals(first.components, second.components);
+ }
+ }
+
+ public static MapCodec lenientOptionalFieldOf(String fieldName) {
+ return CODEC.lenientOptionalFieldOf(fieldName)
+ .xmap(optional -> optional.orElse(EMPTY), stack -> stack.isEmpty() ? Optional.empty() : Optional.of(stack));
}
/**
- * 返回此材料堆栈的字符串表示。
- *
- * 格式取决于材料的属性:
- *
- * - 如果材料没有化学式或化学式为空:{@code "?"}
- * - 如果材料有多个成分:{@code "(formula)"}
- * - 否则:化学式
- *
- * 如果数量大于 1,则使用 {@link FormattingUtil#toSmallDownNumbers(String)} 以下标格式附加数量。
- *
- *
- * 如果堆栈 {@link #isEmpty()},则返回空字符串。
- *
- *
- * @return 此材料堆栈的格式化字符串表示
- * @see Material#getChemicalFormula()
- * @see Material#getMaterialComponents()
- * @see FormattingUtil#toSmallDownNumbers(String)
+ * Hashes the fluid and components of this stack, ignoring the amount.
*/
- @Override
- public @NotNull String toString() {
- String string = "";
- if (this.isEmpty()) return "";
- if (material.getChemicalFormula() == null || material.getChemicalFormula().isEmpty()) {
- string += "?";
- } else if (material.getMaterialComponents().size() > 1) {
- string += '(' + material.getChemicalFormula() + ')';
+ public static int hashMaterialAndComponents(@Nullable MaterialStack stack) {
+ if (stack != null) {
+ int i = 31 + stack.getMaterial().hashCode();
+ return 31 * i + stack.getComponents().hashCode();
} else {
- string += material.getChemicalFormula();
- }
- if (amount > 1) {
- string += FormattingUtil.toSmallDownNumbers(Long.toString(amount));
+ return 0;
}
- return string;
}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialStacksResourceHandler.java b/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialStacksResourceHandler.java
new file mode 100644
index 0000000..92d4406
--- /dev/null
+++ b/src/main/java/net/phasetranscrystal/breacore/api/material/stack/MaterialStacksResourceHandler.java
@@ -0,0 +1,42 @@
+package net.phasetranscrystal.breacore.api.material.stack;
+
+import net.minecraft.core.NonNullList;
+import net.neoforged.neoforge.transfer.StacksResourceHandler;
+
+import com.mojang.serialization.Codec;
+
+public class MaterialStacksResourceHandler extends StacksResourceHandler {
+
+ protected MaterialStacksResourceHandler(NonNullList stacks, MaterialStack emptyStack, Codec stackCodec) {
+ super(stacks, emptyStack, stackCodec);
+ }
+
+ protected MaterialStacksResourceHandler(int size, MaterialStack emptyStack, Codec stackCodec) {
+ super(size, emptyStack, stackCodec);
+ }
+
+ @Override
+ protected MaterialResource getResourceFrom(MaterialStack stack) {
+ return null;
+ }
+
+ @Override
+ protected int getAmountFrom(MaterialStack stack) {
+ return 0;
+ }
+
+ @Override
+ protected MaterialStack getStackFrom(MaterialResource resource, int amount) {
+ return null;
+ }
+
+ @Override
+ protected MaterialStack copyOf(MaterialStack stack) {
+ return null;
+ }
+
+ @Override
+ protected int getCapacity(int index, MaterialResource resource) {
+ return 0;
+ }
+}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/registry/BreaRegistries.java b/src/main/java/net/phasetranscrystal/breacore/api/registry/BreaRegistries.java
index 1f68328..f396be4 100644
--- a/src/main/java/net/phasetranscrystal/breacore/api/registry/BreaRegistries.java
+++ b/src/main/java/net/phasetranscrystal/breacore/api/registry/BreaRegistries.java
@@ -27,7 +27,7 @@ public class BreaRegistries {
public static final Identifier ROOT_REGISTRY_NAME = BreaLib.id("root");
public static final BreaRegistry> ROOT = new BreaRegistry<>(ROOT_REGISTRY_NAME);
// TODO ResourceKey
- public static final ResourceKey> MATERIAL_KEY = makeRegistryKey(BreaLib.id("material"));
+ public static final ResourceKey> MATERIAL_KEY = makeRegistryKey(BreaLib.id("oldmaterial"));
public static final ResourceKey> ELEMENT_KEY = makeRegistryKey(BreaLib.id("element"));
public static final BreaRegistry ELEMENTS = new BreaRegistry<>(ELEMENT_KEY);
public static final MaterialRegistry MATERIALS = new MaterialRegistry(MATERIAL_KEY);
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/tag/TagPrefix.java b/src/main/java/net/phasetranscrystal/breacore/api/tag/TagPrefix.java
deleted file mode 100644
index c2dff13..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/tag/TagPrefix.java
+++ /dev/null
@@ -1,423 +0,0 @@
-package net.phasetranscrystal.breacore.api.tag;
-
-import net.phasetranscrystal.brealib.util.FormattingUtil;
-import net.phasetranscrystal.brealib.util.memoization.CacheMemoizer;
-
-import net.phasetranscrystal.breacore.api.BreaApi;
-import net.phasetranscrystal.breacore.api.material.ItemMaterialData;
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.api.material.info.MaterialIconType;
-import net.phasetranscrystal.breacore.api.material.property.PropertyKey;
-import net.phasetranscrystal.breacore.api.material.stack.MaterialStack;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterialIconTypes;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterials;
-
-import net.minecraft.core.registries.Registries;
-import net.minecraft.network.chat.Component;
-import net.minecraft.network.chat.MutableComponent;
-import net.minecraft.resources.Identifier;
-import net.minecraft.tags.TagKey;
-import net.minecraft.world.item.Item;
-import net.minecraft.world.level.ItemLike;
-import net.minecraft.world.level.block.Block;
-import net.minecraft.world.level.block.state.BlockBehaviour;
-import net.minecraft.world.level.block.state.BlockState;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Table;
-import com.lowdragmc.lowdraglib2.utils.LocalizationUtils;
-import com.mojang.serialization.Codec;
-import com.mojang.serialization.DataResult;
-import it.unimi.dsi.fastutil.objects.Object2FloatMap;
-import it.unimi.dsi.fastutil.objects.Object2FloatOpenHashMap;
-import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.experimental.Accessors;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.annotations.Unmodifiable;
-
-import java.util.*;
-import java.util.function.*;
-
-import static net.phasetranscrystal.breacore.api.tag.TagPrefix.Conditions.*;
-
-@SuppressWarnings("unused")
-@Accessors(chain = true, fluent = true)
-public class TagPrefix {
-
- public final static Map PREFIXES = new HashMap<>();
- public static final Map ORES = new Object2ObjectLinkedOpenHashMap<>();
-
- public static final Codec CODEC = Codec.STRING.flatXmap(
- str -> Optional.ofNullable(get(str)).map(DataResult::success)
- .orElseGet(() -> DataResult.error(() -> "invalid TagPrefix: " + str)),
- prefix -> DataResult.success(prefix.name));
- public static final TagPrefix NULL_PREFIX = new TagPrefix("null");
- @Getter
- public final String name;
- protected final List tags = new ArrayList<>();
- @Getter
- protected final Set> miningToolTag = new HashSet<>();
- private final Map[]> ignoredMaterials = new HashMap<>();
- private final Object2FloatMap materialAmounts = new Object2FloatOpenHashMap<>();
- @Getter
- private final List secondaryMaterials = new ArrayList<>();
- @Setter
- @Getter
- public String langValue;
- @Getter
- @Setter
- private String idPattern;
- @Getter
- @Setter
- private long materialAmount = -1;
- @Setter
- @Getter
- private boolean unificationEnabled;
- @Setter
- @Getter
- private boolean generateRecycling = false;
- @Setter
- private boolean generateItem;
- @Setter
- private boolean generateBlock;
- @Getter
- private BlockProperties blockProperties = new BlockProperties(UnaryOperator.identity());
- @Getter
- @Setter
- private @Nullable Predicate generationCondition;
- @Nullable
- @Getter
- @Setter
- private MaterialIconType materialIconType;
- @Setter
- private Supplier>> itemTable;
- @Nullable
- @Getter
- @Setter
- private BiConsumer> tooltip;
- @Getter
- @Setter
- private int maxStackSize = 64;
-
- public TagPrefix(String name) {
- this.name = name;
- String lowerCaseUnder = FormattingUtil.toLowerCaseUnder(name);
- this.idPattern = "%s_" + lowerCaseUnder;
- this.langValue = "%s " + FormattingUtil.toEnglishName(lowerCaseUnder);
- PREFIXES.put(name, this);
- }
-
- public static TagPrefix get(String name) {
- return PREFIXES.get(name);
- }
-
- public static TagPrefix oreTagPrefix(String name, TagKey miningToolTag) {
- return new TagPrefix(name)
- .defaultTagPath("ores/%s")
- .prefixOnlyTagPath("ores_in_ground/%s")
- .unformattedTagPath("ores")
- .materialIconType(BreaMaterialIconTypes.ore)
- .miningToolTag(miningToolTag)
- .unificationEnabled(true)
- .generationCondition(hasOreProperty);
- }
-
- public static TagPrefix getPrefix(String prefixName) {
- return getPrefix(prefixName, null);
- }
-
- public static TagPrefix getPrefix(String prefixName, @Nullable TagPrefix replacement) {
- return PREFIXES.getOrDefault(prefixName, replacement);
- }
-
- public static Collection values() {
- return PREFIXES.values();
- }
-
- public boolean isEmpty() {
- return this == NULL_PREFIX;
- }
-
- public void addSecondaryMaterial(MaterialStack secondaryMaterial) {
- Preconditions.checkNotNull(secondaryMaterial, "secondaryMaterial");
- secondaryMaterials.add(secondaryMaterial);
- }
-
- public TagPrefix registerOre(Supplier stoneType, Supplier material,
- BlockBehaviour.Properties properties, Identifier baseModelLocation) {
- return registerOre(stoneType, material, properties, baseModelLocation, false);
- }
-
- public TagPrefix registerOre(Supplier stoneType, Supplier material,
- BlockBehaviour.Properties properties, Identifier baseModelLocation,
- boolean doubleDrops) {
- return registerOre(stoneType, material, properties, baseModelLocation, doubleDrops, false, false);
- }
-
- public TagPrefix registerOre(Supplier stoneType, Supplier material,
- BlockBehaviour.Properties properties, Identifier baseModelLocation,
- boolean doubleDrops, boolean isSand, boolean shouldDropAsItem) {
- return registerOre(stoneType, material, () -> properties, baseModelLocation, doubleDrops, isSand,
- shouldDropAsItem);
- }
-
- public TagPrefix registerOre(Supplier stoneType, Supplier material,
- Supplier properties, Identifier baseModelLocation,
- boolean doubleDrops, boolean isSand, boolean shouldDropAsItem) {
- ORES.put(this,
- new OreType(stoneType, material, properties, baseModelLocation, doubleDrops, isSand, shouldDropAsItem));
- return this;
- }
-
- public TagPrefix defaultTagPath(String path) {
- return this.defaultTagPath(path, false);
- }
-
- public TagPrefix defaultTagPath(String path, boolean isVanilla) {
- this.tags.add(TagType.withDefaultFormatter(path, isVanilla));
- return this;
- }
-
- public TagPrefix prefixTagPath(String path) {
- this.tags.add(TagType.withPrefixFormatter(path));
- return this;
- }
-
- public TagPrefix prefixOnlyTagPath(String path) {
- this.tags.add(TagType.withPrefixOnlyFormatter(path));
- return this;
- }
-
- public TagPrefix unformattedTagPath(String path) {
- return unformattedTagPath(path, false);
- }
-
- public TagPrefix unformattedTagPath(String path, boolean isVanilla) {
- this.tags.add(TagType.withNoFormatter(path, isVanilla));
- return this;
- }
-
- public TagPrefix customTagPath(String path, BiFunction> formatter) {
- this.tags.add(TagType.withCustomFormatter(path, formatter));
- return this;
- }
-
- public TagPrefix customTagPredicate(String path, boolean isVanilla, Predicate materialPredicate) {
- this.tags.add(TagType.withCustomFilter(path, isVanilla, materialPredicate));
- return this;
- }
-
- public TagPrefix miningToolTag(TagKey tag) {
- this.miningToolTag.add(tag);
- return this;
- }
-
- public TagPrefix blockProperties(UnaryOperator properties) {
- this.blockProperties = new BlockProperties(properties);
- return this;
- }
-
- public TagPrefix blockProperties(BlockProperties properties) {
- this.blockProperties = properties;
- return this;
- }
-
- public TagPrefix enableRecycling() {
- this.generateRecycling = true;
- return this;
- }
-
- public long getMaterialAmount(@NotNull Material material) {
- if (material.isNull() || !isAmountModified(material)) {
- return this.materialAmount;
- }
- return (long) (BreaApi.M * materialAmounts.getFloat(material));
- }
-
- @Unmodifiable
- public List> getItemParentTags() {
- return tags.stream()
- .filter(TagType::isParentTag)
- .map(type -> type.getTag(this, BreaMaterials.NULL))
- .toList();
- }
-
- @Unmodifiable
- public List> getItemTags(@NotNull Material mat) {
- return tags.stream()
- .filter(type -> !type.isParentTag())
- .map(type -> type.getTag(this, mat))
- .filter(Objects::nonNull)
- .toList();
- }
-
- @Unmodifiable
- public List> getAllItemTags(@NotNull Material mat) {
- return tags.stream()
- .map(type -> type.getTag(this, mat))
- .filter(Objects::nonNull)
- .toList();
- }
-
- @Unmodifiable
- public List> getBlockTags(@NotNull Material mat) {
- return tags.stream()
- .filter(type -> !type.isParentTag())
- .map(type -> type.getTag(this, mat))
- .map(itemTagKey -> TagKey.create(Registries.BLOCK, itemTagKey.location()))
- .toList();
- }
-
- @Unmodifiable
- public List> getAllBlockTags(@NotNull Material mat) {
- return tags.stream()
- .map(type -> type.getTag(this, mat))
- .map(itemTagKey -> TagKey.create(Registries.BLOCK, itemTagKey.location()))
- .toList();
- }
-
- public boolean hasItemTable() {
- return itemTable != null;
- }
-
- @SuppressWarnings("unchecked")
- public Supplier getItemFromTable(Material material) {
- return (Supplier) itemTable.get().get(this, material);
- }
-
- public boolean doGenerateItem() {
- return generateItem;
- }
-
- public boolean doGenerateItem(Material material) {
- return generateItem && !isIgnored(material) &&
- (generationCondition == null || generationCondition.test(material)) ||
- (hasItemTable() && this.itemTable.get() != null && getItemFromTable(material) != null);
- }
-
- public boolean doGenerateBlock() {
- return generateBlock;
- }
-
- public boolean doGenerateBlock(Material material) {
- return generateBlock && !isIgnored(material) &&
- (generationCondition == null || generationCondition.test(material)) ||
- hasItemTable() && this.itemTable.get() != null && getItemFromTable(material) != null;
- }
-
- public String getUnlocalizedName() {
- return "tagprefix." + FormattingUtil.toLowerCaseUnderscore(name);
- }
-
- public MutableComponent getLocalizedName(Material material) {
- return Component.translatable(getUnlocalizedName(material), material.getLocalizedName());
- }
-
- public String getUnlocalizedName(Material material) {
- String formattedPrefix = FormattingUtil.toLowerCaseUnderscore(this.name);
- String matSpecificKey = String.format("item.%s.%s", material.getModid(),
- this.idPattern.formatted(material.getName()));
- if (LocalizationUtils.exist(matSpecificKey)) {
- return matSpecificKey;
- }
- if (material.hasProperty(PropertyKey.POLYMER)) {
- String localizationKey = String.format("tagprefix.polymer.%s", formattedPrefix);
- // Not every polymer tagprefix prefix gets a special name
- if (LocalizationUtils.exist(localizationKey)) {
- return localizationKey;
- }
- }
-
- return getUnlocalizedName();
- }
-
- public boolean isIgnored(Material material) {
- return ignoredMaterials.containsKey(material);
- }
-
- @SafeVarargs
- public final void setIgnored(Material material, Supplier extends ItemLike>... items) {
- ignoredMaterials.put(material, items);
- if (items.length > 0) {
- ItemMaterialData.registerMaterialEntries(Arrays.asList(items), this, material);
- }
- }
-
- @SuppressWarnings("unchecked")
- public void setIgnored(Material material, ItemLike... items) {
- // go through setIgnoredBlock to wrap if this is a block prefix
- if (this.doGenerateBlock()) {
- this.setIgnoredBlock(material,
- Arrays.stream(items).filter(Block.class::isInstance).map(Block.class::cast).toArray(Block[]::new));
- } else {
- this.setIgnored(material,
- Arrays.stream(items).map(item -> (Supplier) () -> item).toArray(Supplier[]::new));
- }
- }
-
- @SuppressWarnings("unchecked")
- public void setIgnoredBlock(Material material, Block... items) {
- this.setIgnored(material, Arrays.stream(items).map(block -> CacheMemoizer.memoizeBlockSupplier(() -> block))
- .toArray(Supplier[]::new));
- }
-
- public void removeIgnored(Material material) {
- ignoredMaterials.remove(material);
- }
-
- public Map[]> getIgnored() {
- return new HashMap<>(ignoredMaterials);
- }
-
- @SuppressWarnings("unchecked")
- public void setIgnored(Material material) {
- this.ignoredMaterials.put(material, new Supplier[0]);
- }
-
- public boolean isAmountModified(Material material) {
- return materialAmounts.containsKey(material);
- }
-
- public void modifyMaterialAmount(@NotNull Material material, float amount) {
- materialAmounts.put(material, amount);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- TagPrefix tagPrefix = (TagPrefix) o;
- return name.equals(tagPrefix.name);
- }
-
- @Override
- public int hashCode() {
- return name.hashCode();
- }
-
- @Override
- public String toString() {
- return name;
- }
-
- public static class Conditions {
-
- public static final Predicate hasToolProperty = mat -> mat.hasProperty(PropertyKey.TOOL);
- // public static final Predicate hasNoCraftingToolProperty = hasToolProperty.and(mat ->
- // !mat.getProperty(PropertyKey.TOOL).isIgnoreCraftingTools());
- public static final Predicate hasOreProperty = mat -> mat.hasProperty(PropertyKey.ORE);
- public static final Predicate hasGemProperty = mat -> mat.hasProperty(PropertyKey.GEM);
- public static final Predicate hasDustProperty = mat -> mat.hasProperty(PropertyKey.DUST);
- public static final Predicate hasIngotProperty = mat -> mat.hasProperty(PropertyKey.INGOT);
- public static final Predicate hasBlastProperty = mat -> mat.hasProperty(PropertyKey.BLAST);
- }
-
- public record OreType(Supplier stoneType, Supplier material,
- Supplier template, Identifier baseModelLocation,
- boolean isDoubleDrops, boolean isSand, boolean shouldDropAsItem) {}
-
- public record BlockProperties(UnaryOperator properties) {}
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/tag/TagType.java b/src/main/java/net/phasetranscrystal/breacore/api/tag/TagType.java
deleted file mode 100644
index bdf5ebf..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/tag/TagType.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package net.phasetranscrystal.breacore.api.tag;
-
-import net.phasetranscrystal.brealib.util.FormattingUtil;
-
-import net.phasetranscrystal.breacore.api.material.Material;
-
-import net.minecraft.tags.TagKey;
-import net.minecraft.util.Util;
-import net.minecraft.world.item.Item;
-
-import lombok.Getter;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.function.BiFunction;
-import java.util.function.Predicate;
-
-public class TagType {
-
- private final String tagPath;
- @Getter
- private boolean isParentTag = false;
- // this is now memoized because creating tagprefix keys interns them and that's slow
- private BiFunction> formatter;
- private Predicate filter;
-
- private TagType(String tagPath) {
- this.tagPath = tagPath;
- }
-
- // formatter:off
-
- /**
- * 使用指定的路径创建一个标签,采用"默认"格式化器,意味着
- * 路径中包含1个"%s"格式化字符,用于材料名称。
- */
- public static @NotNull TagType withDefaultFormatter(String tagPath, boolean isVanilla) {
- TagType type = new TagType(tagPath);
- type.formatter = Util.memoize((prefix, mat) -> TagUtil.createItemTag(type.tagPath.formatted(mat.getName()), isVanilla));
- return type;
- }
-
- /**
- * 使用指定的路径创建一个标签,采用"默认"格式化器,意味着
- * 路径中包含2个"%s"格式化字符,第一个是前缀名称,
- * 第二个是材料名称。
- */
- public static @NotNull TagType withPrefixFormatter(String tagPath) {
- TagType type = new TagType(tagPath);
- type.formatter = Util.memoize((prefix, mat) -> TagUtil.createItemTag(type.tagPath.formatted(FormattingUtil.toLowerCaseUnderscore(prefix.name), mat.getName())));
- return type;
- }
-
- /**
- * 使用指定的路径创建一个标签,采用"默认"格式化器,意味着
- * 路径中包含1个"%s"格式化字符,用于前缀名称。
- */
- public static @NotNull TagType withPrefixOnlyFormatter(String tagPath) {
- TagType type = new TagType(tagPath);
- type.formatter = Util.memoize((prefix, mat) -> TagUtil.createItemTag(type.tagPath.formatted(FormattingUtil.toLowerCaseUnderscore(prefix.name))));
- type.isParentTag = true;
- return type;
- }
-
- public static @NotNull TagType withNoFormatter(String tagPath, boolean isVanilla) {
- TagType type = new TagType(tagPath);
- type.formatter = Util.memoize((prefix, material) -> TagUtil.createItemTag(type.tagPath, isVanilla));
- type.isParentTag = true;
- return type;
- }
-
- public static @NotNull TagType withCustomFormatter(String tagPath, BiFunction> formatter) {
- TagType type = new TagType(tagPath);
- type.formatter = Util.memoize(formatter);
- return type;
- }
-
- public static @NotNull TagType withCustomFilter(String tagPath, boolean isVanilla, Predicate filter) {
- TagType type = new TagType(tagPath);
- type.filter = filter;
- type.formatter = Util.memoize((prefix, material) -> TagUtil.createItemTag(type.tagPath, isVanilla));
- return type;
- }
- // spotless:on
-
- public TagKey- getTag(TagPrefix prefix, @NotNull Material material) {
- if (filter != null && !material.isNull() && !filter.test(material)) return null;
- return formatter.apply(prefix, material);
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/tag/TagUtil.java b/src/main/java/net/phasetranscrystal/breacore/api/tag/TagUtil.java
deleted file mode 100644
index a736ab7..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/api/tag/TagUtil.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package net.phasetranscrystal.breacore.api.tag;
-
-import net.phasetranscrystal.brealib.BreaLib;
-
-import net.minecraft.core.Registry;
-import net.minecraft.core.registries.Registries;
-import net.minecraft.resources.Identifier;
-import net.minecraft.resources.ResourceKey;
-import net.minecraft.tags.TagKey;
-import net.minecraft.world.item.Item;
-import net.minecraft.world.level.block.Block;
-import net.minecraft.world.level.material.Fluid;
-
-import org.jetbrains.annotations.NotNull;
-
-public class TagUtil {
-
- /**
- * 在 {@code c} 或 {@code minecraft} 命名空间下创建标签
- *
- * @param vanilla 是否使用原版命名空间替代通用命名空间
- * @return 标签 {@code #c:path} 或 {@code #minecraft:path}
- */
- public static @NotNull TagKey createTag(ResourceKey extends Registry> registryKey, String path,
- boolean vanilla) {
- if (vanilla) return TagKey.create(registryKey, Identifier.withDefaultNamespace(path));
- return TagKey.create(registryKey, Identifier.fromNamespaceAndPath("c", path));
- }
-
- /**
- * 在 {@code breacore} 命名空间下创建标签
- *
- * @return {@code #breacore:path}
- */
- public static @NotNull TagKey createModTag(ResourceKey extends Registry> registryKey, String path) {
- return TagKey.create(registryKey, BreaLib.id(path));
- }
-
- /**
- * 在 {@code c} 命名空间下创建方块标签
- *
- * @return 方块标签 {@code #c:path}
- */
- public static @NotNull TagKey createBlockTag(String path) {
- return createTag(Registries.BLOCK, path, false);
- }
-
- /**
- * 在 {@code c} 或 {@code minecraft} 命名空间下创建方块标签
- *
- * @param vanilla 是否使用原版命名空间替代通用命名空间
- * @return 方块标签 {@code #c:path} 或 {@code #minecraft:path}
- */
- public static @NotNull TagKey createBlockTag(String path, boolean vanilla) {
- return createTag(Registries.BLOCK, path, vanilla);
- }
-
- /**
- * 在 {@code breacore} 命名空间下创建方块标签
- *
- * @return 方块标签 {@code #breacore:path}
- */
- public static @NotNull TagKey createModBlockTag(String path) {
- return createModTag(Registries.BLOCK, path);
- }
-
- /**
- * 在 {@code c} 命名空间下创建物品标签
- *
- * @return 物品标签 {@code #c:path}
- */
- public static @NotNull TagKey
- createItemTag(String path) {
- return createTag(Registries.ITEM, path, false);
- }
-
- /**
- * 在 {@code c} 或 {@code minecraft} 命名空间下创建物品标签
- *
- * @param vanilla 是否使用原版命名空间替代通用命名空间
- * @return 物品标签 {@code #c:path} 或 {@code #minecraft:path}
- */
- public static @NotNull TagKey
- createItemTag(String path, boolean vanilla) {
- return createTag(Registries.ITEM, path, vanilla);
- }
-
- /**
- * 在 {@code breacore} 命名空间下创建物品标签
- *
- * @return 物品标签 {@code #breacore:path}
- */
- public static @NotNull TagKey
- createModItemTag(String path) {
- return createModTag(Registries.ITEM, path);
- }
-
- /**
- * 在 {@code c} 命名空间下创建流体标签
- *
- * @return 流体标签 {@code #c:path}
- */
- public static @NotNull TagKey createFluidTag(String path) {
- return createTag(Registries.FLUID, path, false);
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/client/ClientProxy.java b/src/main/java/net/phasetranscrystal/breacore/client/ClientProxy.java
index bcb5aa1..254c2f2 100644
--- a/src/main/java/net/phasetranscrystal/breacore/client/ClientProxy.java
+++ b/src/main/java/net/phasetranscrystal/breacore/client/ClientProxy.java
@@ -1,12 +1,10 @@
package net.phasetranscrystal.breacore.client;
-import net.phasetranscrystal.breacore.client.datagen.TextureCreater;
import net.phasetranscrystal.breacore.common.CommonProxy;
public class ClientProxy extends CommonProxy {
public ClientProxy() {
super();
- TextureCreater.init();
}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/client/datagen/TextureCreater.java b/src/main/java/net/phasetranscrystal/breacore/client/datagen/TextureCreater.java
deleted file mode 100644
index 22f91a0..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/client/datagen/TextureCreater.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package net.phasetranscrystal.breacore.client.datagen;
-
-import net.phasetranscrystal.breacore.BreakdownCore;
-import net.phasetranscrystal.breacore.api.item.TagPrefixItem;
-
-import net.minecraft.client.data.models.model.ModelTemplates;
-import net.minecraft.client.data.models.model.TextureMapping;
-import net.minecraft.client.data.models.model.TextureSlot;
-import net.minecraft.client.renderer.block.model.Material;
-import net.minecraft.data.DataGenerator;
-import net.minecraft.data.PackOutput;
-import net.minecraft.resources.Identifier;
-import net.minecraft.world.item.Item;
-import net.neoforged.bus.api.EventPriority;
-import net.neoforged.neoforge.data.event.GatherDataEvent;
-
-import com.tterrag.registrate.providers.DataGenContext;
-import com.tterrag.registrate.providers.generators.RegistrateItemModelGenerator;
-
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-
-import javax.imageio.ImageIO;
-
-public class TextureCreater {
-
- private static ClassLoader loader;
- private static DataGenerator dataGenerator;
-
- public static void init() {
- BreakdownCore.getModEventBus().addListener(EventPriority.HIGHEST, TextureCreater::onGatherData);
- loader = BreakdownCore.class.getClassLoader();
- }
-
- private static void onGatherData(GatherDataEvent.Client event) {
- dataGenerator = event.getGenerator();
- }
-
- public static void generageTagPrefixItemModel(DataGenContext
- ctx, RegistrateItemModelGenerator prov) {
- var modId = ctx.getId().getNamespace();
- var item = ctx.getEntry();
- var mat = item.material;
- var tagPrefix = item.tagPrefix;
- var iconSet = mat.getMaterialIconSet();
- var iconType = tagPrefix.materialIconType();
- var mapping = new TextureMapping();
-
- var sourceIcon = iconType.getItemTexturePath(iconSet, true);
- var ras = loader.getResourceAsStream("assets/" + modId + "/textures/" + sourceIcon.getPath() + ".png");
- while (!iconSet.isRootIconset) {
- iconSet = iconSet.parentIconset;
- sourceIcon = iconType.getItemTexturePath(iconSet, true);
- ras = loader.getResourceAsStream("assets/" + modId + "/textures/" + sourceIcon.getPath() + ".png");
- if (ras != null)
- break;
- }
- if (ras == null) {
- defaultItemModel(ctx, prov);
- return;
- }
- BufferedImage source = null;
- try {
- source = ImageIO.read(ras);
- var width = source.getWidth();
- var height = source.getHeight();
- var color = mat.getMaterialARGB(0);
- var tintRed = (color >> 16) & 0xff;
- var tintGreen = (color >> 8) & 0xff;
- var tintBlue = color & 0xff;
- var sourceData = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
- boolean genColor = mat.getMaterialARGB() != -1;
- for (var x = 0; x < width; x++) {
- for (var y = 0; y < height; y++) {
- int pixel = source.getRGB(x, y);
- int pixelAlpha = pixel >> 24 & 0xff;
- if (!genColor || pixelAlpha > 0) {
- int pixelRed = pixel >> 16 & 0xff;
- int pixelGreen = pixel >> 8 & 0xff;
- int pixelBlue = pixel & 0xff;
-
- // 混合颜色
- int blendedRed = (pixelRed * tintRed) / 255;
- int blendedGreen = (pixelGreen * tintGreen) / 255;
- int blendedBlue = (pixelBlue * tintBlue) / 255;
-
- int blendedPixel = (pixelAlpha << 24) | (blendedRed << 16) | (blendedGreen << 8) | blendedBlue;
- sourceData.setRGB(x, y, blendedPixel);
- } else {
- sourceData.setRGB(x, y, pixel);
- }
- }
- }
- var endrl = Identifier.fromNamespaceAndPath(modId,
- "item/" + iconSet.name + "/" +
- tagPrefix.idPattern().formatted(mat.getName()));
- mapping.put(TextureSlot.LAYER0, new Material(endrl));
- var output = dataGenerator.getPackOutput().getOutputFolder(PackOutput.Target.RESOURCE_PACK)
- .resolve(modId)
- .resolve("textures/" + endrl.getPath() + ".png");
- var of = output.toAbsolutePath().toFile();
- of.getParentFile().mkdirs();
- ImageIO.write(sourceData, "PNG", of);
- } catch (IOException e) {
- // throw new RuntimeException(e);
- }
- var mrl = ModelTemplates.FLAT_ITEM.create(item, mapping, prov.modelOutput);
- prov.createWithExistingModel(ctx.getEntry(), mrl);
- }
-
- public static void defaultItemModel(DataGenContext
- ctx, RegistrateItemModelGenerator prov) {
- prov.createFlatItemModel(ctx.getEntry(), ModelTemplates.FLAT_ITEM);
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/common/CommonProxy.java b/src/main/java/net/phasetranscrystal/breacore/common/CommonProxy.java
index 06be092..488ee1b 100644
--- a/src/main/java/net/phasetranscrystal/breacore/common/CommonProxy.java
+++ b/src/main/java/net/phasetranscrystal/breacore/common/CommonProxy.java
@@ -11,18 +11,13 @@
import net.phasetranscrystal.breacore.data.blockentity.BreaBlockEntities;
import net.phasetranscrystal.breacore.data.blocks.BreaBlocks;
import net.phasetranscrystal.breacore.data.datagen.BreaRegistrateDatagen;
-import net.phasetranscrystal.breacore.data.datagen.lang.MaterialLangGenerator;
import net.phasetranscrystal.breacore.data.entity.BreaEntityTypes;
import net.phasetranscrystal.breacore.data.fluids.BreaFluids;
import net.phasetranscrystal.breacore.data.items.BreaItems;
import net.phasetranscrystal.breacore.data.machine.BreaMachines;
import net.phasetranscrystal.breacore.data.materials.BreaElements;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterialIconSet;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterialIconTypes;
import net.phasetranscrystal.breacore.data.materials.BreaMaterials;
import net.phasetranscrystal.breacore.data.misc.BreaCreativeModeTabs;
-import net.phasetranscrystal.breacore.data.tagprefix.BreaTagPrefixes;
-import net.phasetranscrystal.breacore.mixins.AbstractRegistrateAccessor;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.ModContainer;
@@ -34,14 +29,6 @@
import net.neoforged.neoforge.event.BlockEntityTypeAddBlocksEvent;
import net.neoforged.neoforge.registries.DataPackRegistryEvent;
-import com.google.common.collect.Multimaps;
-import com.tterrag.registrate.providers.ProviderType;
-import com.tterrag.registrate.providers.RegistrateLangProvider;
-import com.tterrag.registrate.providers.RegistrateProvider;
-import com.tterrag.registrate.util.nullness.NonNullConsumer;
-
-import java.util.List;
-
public class CommonProxy {
public CommonProxy() {
@@ -55,10 +42,7 @@ public CommonProxy() {
public static void init() {
BreaElements.init();
- BreaMaterialIconSet.init();
- BreaMaterialIconTypes.init();
initMaterials();
- BreaTagPrefixes.init();
BreaFluids.init();
BreaCreativeModeTabs.init();
@@ -69,19 +53,13 @@ public static void init() {
BreaItems.init();
- AddonFinder.getAddonList().forEach(IBreaAddon::breaInitComplete);
+ AddonFinder.getAddonList().forEach(IBreaAddon::initComplete);
BreaRegistrateDatagen.init();
- // Register all material manager registries, for materials with mod ids.
+ // Register all oldmaterial manager registries, for materials with mod ids.
BreaApi.materialManager.getUsedNamespaces().forEach(namespace -> {
- // Force the material lang generator to be at index 0, so that addons' lang generators can override it.
+ // Force the oldmaterial lang generator to be at index 0, so that addons' lang generators can override it.
BreaRegistrate registrate = BreaRegistrate.createIgnoringListenerErrors(namespace);
- AbstractRegistrateAccessor accessor = (AbstractRegistrateAccessor) registrate;
- if (accessor.getDoDatagen().get()) {
- List> providers = Multimaps.asMap(accessor.getDatagens()).get(ProviderType.LANG);
- providers.addFirst((provider) -> MaterialLangGenerator.generate((RegistrateLangProvider) provider, namespace));
- }
-
ModList.get().getModContainerById(namespace).map(ModContainer::getEventBus).ifPresent(registrate::registerEventListeners);
});
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/common/block/StoneTypes.java b/src/main/java/net/phasetranscrystal/breacore/common/block/StoneTypes.java
deleted file mode 100644
index 91d02dd..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/common/block/StoneTypes.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package net.phasetranscrystal.breacore.common.block;
-
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.api.tag.TagPrefix;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterials;
-import net.phasetranscrystal.breacore.data.tagprefix.BreaTagPrefixes;
-
-import net.minecraft.util.StringRepresentable;
-import net.minecraft.world.level.block.Blocks;
-import net.minecraft.world.level.block.state.BlockState;
-import net.minecraft.world.level.material.MapColor;
-
-import lombok.Getter;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.function.Supplier;
-
-public enum StoneTypes implements StringRepresentable {
-
- STONE("stone", MapColor.STONE, true, () -> Blocks.STONE::defaultBlockState, BreaMaterials.Stone, false),
- GRANITE("granite", MapColor.DIRT, true, () -> Blocks.GRANITE::defaultBlockState, BreaMaterials.Granite, false),
- DIORITE("diorite", MapColor.QUARTZ, true, () -> Blocks.DIORITE::defaultBlockState, BreaMaterials.Diorite, false),
- ANDESITE("andesite", MapColor.STONE, true, () -> Blocks.ANDESITE::defaultBlockState, BreaMaterials.Andesite, false),
- DEEPSLATE("deepslate", MapColor.DEEPSLATE, true, () -> Blocks.DEEPSLATE::defaultBlockState, BreaMaterials.Deepslate, false),
- BASALT("basalt", MapColor.TERRACOTTA_BLACK, true, () -> Blocks.BASALT::defaultBlockState, BreaMaterials.Basalt, false),
- TUFF("tuff", MapColor.TERRACOTTA_GRAY, true, () -> Blocks.TUFF::defaultBlockState, BreaMaterials.Tuff, false),
- BLACKSTONE("blackstone", MapColor.COLOR_BLACK, true, () -> Blocks.BLACKSTONE::defaultBlockState, BreaMaterials.Blackstone, false),
- ;
-
- public final MapColor mapColor;
- @Getter
- public final boolean natural;
- @Getter
- public final Supplier> state;
- @Getter
- public final Material material;
- public final boolean generateBlocks;
- private final String name;
-
- StoneTypes(@NotNull String name, @NotNull MapColor mapColor, boolean natural, Supplier> state,
- Material material) {
- this(name, mapColor, natural, state, material, true);
- }
-
- StoneTypes(@NotNull String name, @NotNull MapColor mapColor, boolean natural, Supplier> state,
- Material material, boolean generateBlocks) {
- this.name = name;
- this.mapColor = mapColor;
- this.natural = natural;
- this.state = state;
- this.material = material;
- this.generateBlocks = generateBlocks;
- }
-
- public static void init() {}
-
- @NotNull
- @Override
- public String getSerializedName() {
- return this.name;
- }
-
- public TagPrefix getTagPrefix() {
- return BreaTagPrefixes.block;
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/blocks/BreaBlocks.java b/src/main/java/net/phasetranscrystal/breacore/data/blocks/BreaBlocks.java
index dc80a75..4129add 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/blocks/BreaBlocks.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/blocks/BreaBlocks.java
@@ -1,159 +1,18 @@
package net.phasetranscrystal.breacore.data.blocks;
-import net.phasetranscrystal.brealib.util.memoization.CacheMemoizer;
-
import net.phasetranscrystal.breacore.api.block.debug.CheckMatBlock;
import net.phasetranscrystal.breacore.api.block.debug.MuiTestBlock;
-import net.phasetranscrystal.breacore.api.material.ItemMaterialData;
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.api.material.stack.MaterialEntry;
-import net.phasetranscrystal.breacore.api.tag.TagPrefix;
-import net.phasetranscrystal.breacore.common.block.StoneBlockType;
-import net.phasetranscrystal.breacore.common.block.StoneTypes;
-import net.phasetranscrystal.breacore.data.items.MaterialItems;
-import net.phasetranscrystal.breacore.data.misc.BreaCreativeModeTabs;
-import net.phasetranscrystal.breacore.mixins.BlockPropertiesAccessor;
-
-import net.minecraft.client.data.models.model.TextureSlot;
-import net.minecraft.core.registries.BuiltInRegistries;
-import net.minecraft.resources.Identifier;
-import net.minecraft.tags.BlockTags;
-import net.minecraft.world.level.block.Block;
-import net.minecraft.world.level.block.Blocks;
-import net.minecraft.world.level.block.state.BlockBehaviour;
-import net.neoforged.neoforge.common.Tags;
-import com.google.common.collect.ImmutableTable;
-import com.google.common.collect.Table;
-import com.tterrag.registrate.builders.BlockBuilder;
import com.tterrag.registrate.util.entry.BlockEntry;
-import com.tterrag.registrate.util.nullness.NonNullFunction;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.function.Supplier;
-
-import static net.phasetranscrystal.breacore.common.registry.BreaRegistration.REGISTRATE;
public class BreaBlocks {
public static BlockEntry MatCheckBlock;
public static BlockEntry TestMuiBlock;
- public static Table> STONE_BLOCKS;
public static void init() {
DebugBlocks.init();
- // Decor Blocks
- generateStoneBlocks();
-
- // Procedural Blocks
- REGISTRATE.creativeModeTab(() -> BreaCreativeModeTabs.MATERIAL_BLOCK);
- BreaMaterialBlocks.generateMaterialBlocks(); // Compressed Blocks
- BreaMaterialBlocks.generateOreBlocks(); // Ore Blocks
- BreaMaterialBlocks.MATERIAL_BLOCKS = BreaMaterialBlocks.MATERIAL_BLOCKS_BUILDER.build();
-
- BreaMaterialBlocks.MATERIAL_BLOCKS_BUILDER = null;
- }
-
- public static
> NonNullFunction unificationBlock(@NotNull TagPrefix tagPrefix,
- @NotNull Material mat) {
- return builder -> {
- builder.onRegister(block -> {
- Supplier blockSupplier = CacheMemoizer.memoizeBlockSupplier(() -> block);
- MaterialEntry entry = new MaterialEntry(tagPrefix, mat);
- MaterialItems.toUnify.put(entry, blockSupplier);
- ItemMaterialData.registerMaterialEntry(blockSupplier, entry);
- });
- return builder;
- };
- }
-
- public static void generateStoneBlocks() {
- // Stone type blocks
- ImmutableTable.Builder> builder = ImmutableTable.builder();
- for (StoneTypes strata : StoneTypes.values()) {
- if (!strata.generateBlocks) continue;
- for (StoneBlockType type : StoneBlockType.values()) {
- String blockId = type.blockId.formatted(strata.getSerializedName());
- if (BuiltInRegistries.BLOCK.containsKey(Identifier.parse(blockId))) continue;
- var entry = REGISTRATE.block(blockId, Block::new)
- .initialProperties(() -> Blocks.STONE)
- .properties(p -> p.strength(type.hardness, type.resistance).mapColor(strata.mapColor))
- .transform(type == StoneBlockType.STONE ?
- BreaBlocks.unificationBlock(strata.getTagPrefix(), strata.getMaterial()) :
- builder2 -> builder2)
- .tag(BlockTags.MINEABLE_WITH_PICKAXE, Tags.Blocks.NEEDS_WOOD_TOOL)
- .loot((tables, block) -> {
- if (type == StoneBlockType.STONE) {
- tables.add(block, tables.createSingleItemTableWithSilkTouch(block,
- STONE_BLOCKS.get(StoneBlockType.COBBLE, strata).get()));
- } else {
- tables.add(block, tables.createSingleItemTable(block));
- }
- })
- .item()
- .build();
- if (type == StoneBlockType.STONE && strata.isNatural()) {
- entry.tag(BlockTags.STONE_ORE_REPLACEABLES, BlockTags.BASE_STONE_OVERWORLD,
- BlockTags.DRIPSTONE_REPLACEABLE, BlockTags.MOSS_REPLACEABLE);
- // .blockstate(GTModels.randomRotatedModel(GTCEu.id(ModelProvider.BLOCK_FOLDER + "/stones/" +
- // strata.getSerializedName() + "/" + type.id));
- } else {
- entry.blockstate(() -> (ctx, prov) -> {
- prov.create(ctx.getEntry(), prov.getBuilder()
- .texture(TextureSlot.ALL, prov.modLoc("block/stones/" + strata.getSerializedName() + "/" + type.id))
- .build(ctx.getEntry()));
- });
- }
- if (type == StoneBlockType.STONE) {
- entry.tag(Tags.Blocks.STONES);
- }
- if (type == StoneBlockType.COBBLE) {
- entry.tag(Tags.Blocks.COBBLESTONES);
- }
- builder.put(type, strata, entry.register());
- }
- }
- STONE_BLOCKS = builder.build();
- }
-
- /**
- * kinda nasty block property copy function because one doesn't exist.
- *
- * @param props the props to copy
- * @return a shallow copy of the block properties like {@link BlockBehaviour.Properties#ofFullCopy(BlockBehaviour)}
- * does
- */
- public static BlockBehaviour.Properties copy(BlockBehaviour.Properties props, BlockBehaviour.Properties newProps) {
- if (props == null) {
- return newProps;
- }
- newProps.destroyTime(((BlockPropertiesAccessor) props).getDestroyTime());
- newProps.explosionResistance(((BlockPropertiesAccessor) props).getExplosionResistance());
- if (!((BlockPropertiesAccessor) props).isHasCollision()) newProps.noCollision();
- if (((BlockPropertiesAccessor) props).isIsRandomlyTicking()) newProps.randomTicks();
- newProps.lightLevel(((BlockPropertiesAccessor) props).getLightEmission());
- newProps.mapColor(((BlockPropertiesAccessor) props).getMapColor());
- newProps.sound(((BlockPropertiesAccessor) props).getSoundType());
- newProps.friction(((BlockPropertiesAccessor) props).getFriction());
- newProps.speedFactor(((BlockPropertiesAccessor) props).getSpeedFactor());
- if (((BlockPropertiesAccessor) props).isDynamicShape()) newProps.dynamicShape();
- if (!((BlockPropertiesAccessor) props).isCanOcclude()) newProps.noOcclusion();
- if (((BlockPropertiesAccessor) props).isIsAir()) newProps.air();
- if (((BlockPropertiesAccessor) props).isIgnitedByLava()) newProps.ignitedByLava();
- if (((BlockPropertiesAccessor) props).isLiquid()) newProps.liquid();
- if (((BlockPropertiesAccessor) props).isForceSolidOff()) newProps.forceSolidOff();
- if (((BlockPropertiesAccessor) props).isForceSolidOn()) newProps.forceSolidOn();
- newProps.pushReaction(((BlockPropertiesAccessor) props).getPushReaction());
- if (((BlockPropertiesAccessor) props).isRequiresCorrectToolForDrops()) newProps.requiresCorrectToolForDrops();
- ((BlockPropertiesAccessor) newProps).setOffsetFunction(((BlockPropertiesAccessor) props).getOffsetFunction());
- if (!((BlockPropertiesAccessor) props).isSpawnTerrainParticles()) newProps.noTerrainParticles();
- ((BlockPropertiesAccessor) newProps)
- .setRequiredFeatures(((BlockPropertiesAccessor) props).getRequiredFeatures());
- newProps.emissiveRendering(((BlockPropertiesAccessor) props).getEmissiveRendering());
- newProps.instrument(((BlockPropertiesAccessor) props).getInstrument());
- if (((BlockPropertiesAccessor) props).isReplaceable()) newProps.replaceable();
- return newProps;
+ BreaMaterialBlocks.init();
}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/blocks/BreaMaterialBlocks.java b/src/main/java/net/phasetranscrystal/breacore/data/blocks/BreaMaterialBlocks.java
index f48650d..4189586 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/blocks/BreaMaterialBlocks.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/blocks/BreaMaterialBlocks.java
@@ -1,134 +1,6 @@
package net.phasetranscrystal.breacore.data.blocks;
-import net.phasetranscrystal.brealib.util.FormattingUtil;
-
-import net.phasetranscrystal.breacore.BreakdownCore;
-import net.phasetranscrystal.breacore.api.BreaApi;
-import net.phasetranscrystal.breacore.api.block.MaterialBlock;
-import net.phasetranscrystal.breacore.api.block.OreBlock;
-import net.phasetranscrystal.breacore.api.item.MaterialBlockItem;
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.api.material.property.PropertyKey;
-import net.phasetranscrystal.breacore.api.registry.registrate.BreaRegistrate;
-import net.phasetranscrystal.breacore.api.tag.TagPrefix;
-import net.phasetranscrystal.breacore.data.tagprefix.BreaTagPrefixes;
-
-import net.minecraft.client.data.models.model.ModelTemplates;
-import net.minecraft.client.data.models.model.TextureSlot;
-import net.minecraft.world.level.block.Blocks;
-
-import com.google.common.collect.ImmutableTable;
-import com.google.common.collect.Table;
-import com.tterrag.registrate.providers.ProviderType;
-import com.tterrag.registrate.util.entry.BlockEntry;
-import com.tterrag.registrate.util.nullness.NonNullBiConsumer;
-
public class BreaMaterialBlocks {
- // Reference Tables
- public static Table> MATERIAL_BLOCKS;
- // Reference Table Builders
- static ImmutableTable.Builder> MATERIAL_BLOCKS_BUILDER = ImmutableTable
- .builder();
-
- // Material Blocks
- public static void generateMaterialBlocks() {
- BreakdownCore.LOGGER.debug("Generating GTCEu Material Blocks...");
-
- for (TagPrefix tagPrefix : TagPrefix.values()) {
- if (!TagPrefix.ORES.containsKey(tagPrefix) && tagPrefix.doGenerateBlock()) {
- for (Material material : BreaApi.materialManager) {
- BreaRegistrate registrate = BreaRegistrate.createIgnoringListenerErrors(material.getModid());
- if (tagPrefix.doGenerateBlock(material)) {
- registerMaterialBlock(tagPrefix, material, registrate);
- }
- }
- }
- }
- BreakdownCore.LOGGER.debug("Generating GTCEu Material Blocks... Complete!");
- }
-
- private static void registerMaterialBlock(TagPrefix tagPrefix, Material material, BreaRegistrate registrate) {
- MATERIAL_BLOCKS_BUILDER.put(tagPrefix, material, registrate
- .block(tagPrefix.idPattern().formatted(material.getName()),
- properties -> new MaterialBlock(properties, tagPrefix, material))
- .initialProperties(() -> Blocks.IRON_BLOCK)
- .properties(p -> tagPrefix.blockProperties().properties().apply(p).noLootTable())
- .transform(BreaBlocks.unificationBlock(tagPrefix, material))
- .setData(ProviderType.BLOCKSTATE, NonNullBiConsumer.noop())
- .setData(ProviderType.LANG, NonNullBiConsumer.noop())
- .setData(ProviderType.LOOT, NonNullBiConsumer.noop())
- .blockstate(() -> (ctx, prov) -> {
- prov.create(ctx.getEntry(), prov.getBuilder()
- .texture(TextureSlot.ALL, ctx.getId())
- .parent(ModelTemplates.CUBE_ALL.model.get())
- .build(ctx.getEntry()));
- })
- // .color(() -> MaterialBlock::tintedColor)
- .item(MaterialBlockItem::new)
- .model(NonNullBiConsumer::noop)
- .model(() -> (ctx, prov) -> {
- prov.generateBlockItem(ctx.getEntry(), l -> l);
- })
- // .color(() -> MaterialBlockItem::tintColor)
- .build()
- .register());
- }
-
- // Material Ore Blocks
- public static void generateOreBlocks() {
- BreakdownCore.LOGGER.debug("Generating GTCEu Ore Blocks...");
- for (Material material : BreaApi.materialManager) {
- if (allowOreBlock(material)) {
- BreaRegistrate registrate = BreaRegistrate.createIgnoringListenerErrors(material.getModid());
- registerOreBlock(material, registrate);
- }
- }
- BreakdownCore.LOGGER.debug("Generating GTCEu Ore Blocks... Complete!");
- }
-
- private static boolean allowOreBlock(Material material) {
- return material.hasProperty(PropertyKey.ORE);
- }
-
- private static void registerOreBlock(Material material, BreaRegistrate registrate) {
- for (var ore : TagPrefix.ORES.entrySet()) {
- if (ore.getKey().isIgnored(material)) continue;
- var oreTag = ore.getKey();
- final TagPrefix.OreType oreType = ore.getValue();
- var entry = registrate
- .block("%s%s_ore".formatted(
- oreTag != BreaTagPrefixes.ore ? FormattingUtil.toLowerCaseUnder(oreTag.name) + "_" : "",
- material.getName()),
- properties -> new OreBlock(properties, oreTag, material, true))
- .initialProperties(() -> {
- if (oreType.stoneType().get().isAir()) { // if the block is not registered (yet), fallback to
- // stone
- return Blocks.IRON_ORE;
- }
- return oreType.stoneType().get().getBlock();
- })
- .properties(properties -> BreaBlocks.copy(oreType.template().get(), properties).noLootTable())
- .transform(BreaBlocks.unificationBlock(oreTag, material))
- .blockstate(NonNullBiConsumer::noop)
- .setData(ProviderType.LANG, NonNullBiConsumer.noop())
- .setData(ProviderType.LOOT, NonNullBiConsumer.noop())
- .blockstate(() -> (ctx, prov) -> {
- prov.create(ctx.getEntry(), prov.getBuilder()
- .texture(TextureSlot.ALL, ctx.getId())
- .parent(ModelTemplates.CUBE_ALL.model.get())
- .build(ctx.getEntry()));
- })
- // .color(() -> MaterialBlock::tintedColor)
- .item(MaterialBlockItem::new)
- .model(NonNullBiConsumer::noop)
- .model(() -> (ctx, prov) -> {
- prov.generateBlockItem(ctx.getEntry(), l -> l);
- })
- // .color(() -> MaterialBlockItem::tintColor)
- .build()
- .register();
- MATERIAL_BLOCKS_BUILDER.put(oreTag, material, entry);
- }
- }
+ public static void init() {}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/blocks/DebugBlocks.java b/src/main/java/net/phasetranscrystal/breacore/data/blocks/DebugBlocks.java
index 65b150f..a3176dc 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/blocks/DebugBlocks.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/blocks/DebugBlocks.java
@@ -7,7 +7,6 @@
import static net.phasetranscrystal.breacore.common.registry.BreaRegistration.REGISTRATE;
import static net.phasetranscrystal.breacore.data.blocks.BreaBlocks.*;
-import static net.phasetranscrystal.breacore.data.tags.CustomTags.DEBUG_ITEMS;
public class DebugBlocks {
@@ -16,16 +15,14 @@ public class DebugBlocks {
}
public static void init() {
- MatCheckBlock = REGISTRATE.block("matcheckblock", CheckMatBlock::new)
+ MatCheckBlock = REGISTRATE.block("mat_check", CheckMatBlock::new)
.item()
- .tag(DEBUG_ITEMS)
.build()
.lang("Material Check Block")
.register();
TestMuiBlock = REGISTRATE.block("mui_test_block", MuiTestBlock::new)
.simpleBlockEntity(TestBlockEntity::new)
.item()
- .tag(DEBUG_ITEMS)
.build()
.lang("MUI Test Block")
.register();
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/BreaRegistrateDatagen.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/BreaRegistrateDatagen.java
index 82ec132..1dab1e9 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/BreaRegistrateDatagen.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/datagen/BreaRegistrateDatagen.java
@@ -1,27 +1,6 @@
package net.phasetranscrystal.breacore.data.datagen;
-import net.phasetranscrystal.breacore.common.registry.BreaRegistration;
-import net.phasetranscrystal.breacore.data.datagen.datamap.DataMapsHandler;
-import net.phasetranscrystal.breacore.data.datagen.lang.LangHandler;
-import net.phasetranscrystal.breacore.data.datagen.tag.BlockTagLoader;
-import net.phasetranscrystal.breacore.data.datagen.tag.EntityTypeTagLoader;
-import net.phasetranscrystal.breacore.data.datagen.tag.FluidTagLoader;
-import net.phasetranscrystal.breacore.data.datagen.tag.ItemTagLoader;
-
-import net.minecraft.data.DataProvider;
-
-import com.tterrag.registrate.providers.ProviderType;
-
public class BreaRegistrateDatagen {
- public static void init() {
- DataProvider.INDENT_WIDTH.set(4);
-
- BreaRegistration.REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, ItemTagLoader::init);
- BreaRegistration.REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, BlockTagLoader::init);
- BreaRegistration.REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, FluidTagLoader::init);
- BreaRegistration.REGISTRATE.addDataGenerator(ProviderType.ENTITY_TAGS, EntityTypeTagLoader::init);
- BreaRegistration.REGISTRATE.addDataGenerator(ProviderType.LANG, LangHandler::init);
- BreaRegistration.REGISTRATE.addDataGenerator(ProviderType.DATA_MAP, DataMapsHandler::init);
- }
+ public static void init() {}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/TagsHandler.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/TagsHandler.java
deleted file mode 100644
index b4eb7b1..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/TagsHandler.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen;
-
-import net.minecraft.world.item.Items;
-
-import static net.phasetranscrystal.breacore.api.material.ItemMaterialData.registerMaterialEntry;
-import static net.phasetranscrystal.breacore.api.material.MarkerMaterials.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaMaterials.*;
-import static net.phasetranscrystal.breacore.data.tagprefix.BreaTagPrefixes.*;
-
-public class TagsHandler {
-
- public static void initExtraUnificationEntries() {
- registerMaterialEntry(Items.CLAY_BALL, ingot, Clay);
-
- registerMaterialEntry(Items.BLACK_DYE, dye, Color.Black);
- registerMaterialEntry(Items.RED_DYE, dye, Color.Red);
- registerMaterialEntry(Items.GREEN_DYE, dye, Color.Green);
- registerMaterialEntry(Items.BROWN_DYE, dye, Color.Brown);
- registerMaterialEntry(Items.BLUE_DYE, dye, Color.Blue);
- registerMaterialEntry(Items.PURPLE_DYE, dye, Color.Purple);
- registerMaterialEntry(Items.CYAN_DYE, dye, Color.Cyan);
- registerMaterialEntry(Items.LIGHT_GRAY_DYE, dye, Color.LightGray);
- registerMaterialEntry(Items.GRAY_DYE, dye, Color.Gray);
- registerMaterialEntry(Items.PINK_DYE, dye, Color.Pink);
- registerMaterialEntry(Items.LIME_DYE, dye, Color.Lime);
- registerMaterialEntry(Items.YELLOW_DYE, dye, Color.Yellow);
- registerMaterialEntry(Items.LIGHT_BLUE_DYE, dye, Color.LightBlue);
- registerMaterialEntry(Items.MAGENTA_DYE, dye, Color.Magenta);
- registerMaterialEntry(Items.ORANGE_DYE, dye, Color.Orange);
- registerMaterialEntry(Items.WHITE_DYE, dye, Color.White);
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/datamap/DataMapsHandler.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/datamap/DataMapsHandler.java
deleted file mode 100644
index 2742d78..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/datamap/DataMapsHandler.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.datamap;
-
-import net.minecraft.core.registries.Registries;
-import net.minecraft.resources.ResourceKey;
-import net.minecraft.world.item.Item;
-import net.minecraft.world.level.block.Block;
-
-import com.tterrag.registrate.providers.RegistrateDataMapProvider;
-import com.tterrag.registrate.util.entry.RegistryEntry;
-import org.jetbrains.annotations.NotNull;
-
-public class DataMapsHandler {
-
- public static void init(RegistrateDataMapProvider provider) {}
-
- private static ResourceKey- getItemKey(@NotNull RegistryEntry entry) {
- return entry.getSibling(Registries.ITEM).getKey();
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/AdvancementLang.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/AdvancementLang.java
deleted file mode 100644
index eee2528..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/AdvancementLang.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.lang;
-
-import com.tterrag.registrate.providers.RegistrateLangProvider;
-
-public class AdvancementLang {
-
- public static void init(RegistrateLangProvider provider) {}
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/BlockLang.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/BlockLang.java
deleted file mode 100644
index fa7f45d..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/BlockLang.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.lang;
-
-import com.tterrag.registrate.providers.RegistrateLangProvider;
-
-public class BlockLang {
-
- public static void init(RegistrateLangProvider provider) {
- initCasingLang(provider);
- }
-
- private static void initCasingLang(RegistrateLangProvider provider) {}
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/ConfigurationLang.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/ConfigurationLang.java
deleted file mode 100644
index 9636043..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/ConfigurationLang.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.lang;
-
-import com.tterrag.registrate.providers.RegistrateLangProvider;
-
-public class ConfigurationLang {
-
- public static void init(RegistrateLangProvider provider) {}
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/IntegrationLang.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/IntegrationLang.java
deleted file mode 100644
index cef79b6..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/IntegrationLang.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.lang;
-
-import com.tterrag.registrate.providers.RegistrateLangProvider;
-
-public class IntegrationLang {
-
- public static void init(RegistrateLangProvider provider) {
- initRecipeViewerLang(provider);
- initWailaLikeLang(provider);
- initMinimapLang(provider);
- initOwnershipLang(provider);
- }
-
- /**
- * JEI, REI, EMI
- */
- private static void initRecipeViewerLang(RegistrateLangProvider provider) {}
-
- private static void initWailaLikeLang(RegistrateLangProvider provider) {}
-
- private static void initMinimapLang(RegistrateLangProvider provider) {}
-
- private static void initOwnershipLang(RegistrateLangProvider provider) {}
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/ItemLang.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/ItemLang.java
deleted file mode 100644
index 9403b77..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/ItemLang.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.lang;
-
-import net.phasetranscrystal.breacore.api.tag.TagPrefix;
-
-import com.tterrag.registrate.providers.RegistrateLangProvider;
-
-import static net.phasetranscrystal.breacore.data.datagen.lang.LangHandler.replace;
-
-public class ItemLang {
-
- public static void init(RegistrateLangProvider provider) {
- initGeneratedNames(provider);
- initItemNames(provider);
- initItemTooltips(provider);
- }
-
- private static void initGeneratedNames(RegistrateLangProvider provider) {
- // TagPrefix
- for (TagPrefix tagPrefix : TagPrefix.values()) {
- provider.add(tagPrefix.getUnlocalizedName(), tagPrefix.langValue);
- }
- provider.add("tagprefix.polymer.plate", "%s Sheet");
- provider.add("tagprefix.polymer.foil", "Thin %s Sheet");
- provider.add("tagprefix.polymer.nugget", "%s Chip");
- provider.add("tagprefix.polymer.dense_plate", "Dense %s Sheet");
- provider.add("tagprefix.polymer.double_plate", "Double %s Sheet");
- provider.add("tagprefix.polymer.tiny_dust", "Tiny Pile of %s Pulp");
- provider.add("tagprefix.polymer.small_dust", "Small Pile of %s Pulp");
- provider.add("tagprefix.polymer.dust", "%s Pulp");
- provider.add("tagprefix.polymer.ingot", "%s Ingot");
- }
-
- private static void initItemNames(RegistrateLangProvider provider) {
- replace(provider, "item.breacore.tungsten_steel_fluid_cell", "%s Tungstensteel Cell");
- }
-
- private static void initItemTooltips(RegistrateLangProvider provider) {}
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/LangHandler.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/LangHandler.java
deleted file mode 100644
index 47b35e8..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/LangHandler.java
+++ /dev/null
@@ -1,278 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.lang;
-
-import net.minecraft.network.chat.Component;
-import net.minecraft.network.chat.MutableComponent;
-import net.neoforged.neoforge.common.data.LanguageProvider;
-
-import com.lowdragmc.lowdraglib2.utils.LocalizationUtils;
-import com.tterrag.registrate.providers.RegistrateLangProvider;
-import org.jetbrains.annotations.NotNull;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-public class LangHandler {
-
- public static void init(RegistrateLangProvider provider) {
- AdvancementLang.init(provider);
- BlockLang.init(provider);
- IntegrationLang.init(provider);
- ItemLang.init(provider);
- MachineLang.init(provider);
- ToolLang.init(provider);
- ConfigurationLang.init(provider);
- }
-
- /**
- * Returns the sub-key consisting of the given key plus the given index.
- * E.g.,
- *
- *
- * getSubKey("terminal.fluid_prospector.tier", 0)
- *
- *
- * returns the String:
- *
- *
- *
- * "terminal.fluid_prospector.tier.0"
- *
- *
- * @param key Base key of the sub-key.
- * @param index Index of the sub-key.
- * @return Sub-key consisting of key and index.
- */
- protected static String getSubKey(String key, int index) {
- return key + "." + index;
- }
-
- /**
- * Registers multiple values under the same key with a given provider.
- *
- * For example, a cumbersome way to add translations would be the following:
- *
- *
- * provider.add("terminal.fluid_prospector.tier.0", "radius size 1");
- * provider.add("terminal.fluid_prospector.tier.1", "radius size 2");
- * provider.add("terminal.fluid_prospector.tier.2", "radius size 3");
- *
- *
- * Instead, multiLang can be used for the same result:
- *
- *
- * multiLang(provider, "terminal.fluid_prospector.tier", "radius size 1", "radius size 2", "radius size 3");
- *
- *
- * In situations requiring a large number of generated translations, the
- * following could be used instead, which
- * generates translations for 100 tiers:
- *
- *
- * multiLang(provider, "terminal.fluid_prospector.tier", IntStream.of(100)
- * .map(i -> i + 1)
- * .mapToObj(Integer::toString)
- * .map(i -> "radius size " + i)
- * .toArray(String[]::new));
- *
- *
- * @param provider The provider to add to.
- * @param key Base key of the key-value-pairs. The real key for each
- * translation will be appended by ".0" for
- * the first, ".1" for the second, etc. This ensures that the
- * keys are unique.
- * @param values All translation values.
- */
- protected static void multiLang(RegistrateLangProvider provider, String key, String... values) {
- for (var i = 0; i < values.length; i++) {
- provider.add(getSubKey(key, i), values[i]);
- }
- }
-
- /**
- * Gets all translation components from a multi lang's sub-keys.
- * E.g., given a multi lang:
- *
- *
- * multiLang(provider, "terminal.fluid_prospector.tier", "radius size 1", "radius size 2", "radius size 3");
- *
- *
- * The following code can be used to print out the translations:
- *
- *
- * for (var component : getMultiLang("terminal.fluid_prospector.tier")) {
- * System.out.println(component.getString());
- * }
- *
- *
- * Result:
- *
- *
- * radius size 1
- * radius size 2
- * radius size 3
- *
- *
- * @param key Base key of the multi lang. E.g. "terminal.fluid_prospector.tier".
- * @return Returns all translation components from a multi lang's sub-keys
- */
- public static List getMultiLang(String key) {
- var outputKeys = new ArrayList();
- var i = 0;
- var next = getSubKey(key, i);
- while (LocalizationUtils.exist(next)) {
- outputKeys.add(next);
- next = getSubKey(key, ++i);
- }
- return outputKeys.stream().map(Component::translatable).collect(Collectors.toList());
- }
-
- /**
- * Gets all translation components from a multi lang's sub-keys. Supports
- * additional arguments for the translation
- * components.
- * E.g., given a multi lang:
- *
- *
- * multiLang(provider, "terminal.fluid_prospector.tier", "radius size 1", "radius size 2", "radius size 3");
- *
- *
- * The following code can be used to print out the translations:
- *
- *
- * for (var component : getMultiLang("terminal.fluid_prospector.tier")) {
- * System.out.println(component.getString());
- * }
- *
- *
- * Result:
- *
- *
- * radius size 1
- * radius size 2
- * radius size 3
- *
- *
- * @param key Base key of the multi lang. E.g. "terminal.fluid_prospector.tier".
- * @return Returns all translation components from a multi lang's sub-keys.
- */
- public static List getMultiLang(String key, Object... args) {
- var outputKeys = new ArrayList();
- var i = 0;
- var next = getSubKey(key, i);
- while (LocalizationUtils.exist(next)) {
- outputKeys.add(next);
- next = getSubKey(key, ++i);
- }
- return outputKeys.stream().map(k -> Component.translatable(k, args)).collect(Collectors.toList());
- }
-
- /**
- * See {@link #getMultiLang(String)}. If no multiline key is available, get
- * single instead.
- *
- * @param key Base key of the multi lang. E.g. "terminal.fluid_prospector.tier".
- * @return Returns all translation components from a multi lang's sub-keys.
- */
- public static List getSingleOrMultiLang(String key) {
- List multiLang = getMultiLang(key);
-
- if (!multiLang.isEmpty()) {
- return multiLang;
- }
-
- return List.of(Component.translatable(key));
- }
-
- /**
- * Gets a single translation from a multi lang.
- *
- * @param key Base key of the multi lang. E.g. "gtceu.gui.overclock.enabled".
- * @param index Index of the single translation. E.g. 3 would return
- * "gtceu.gui.overclock.enabled.3".
- * @return Returns a single translation from a multi lang.
- */
- public static MutableComponent getFromMultiLang(String key, int index) {
- return Component.translatable(getSubKey(key, index));
- }
-
- /**
- * Gets a single translation from a multi lang. Supports additional arguments
- * for the translation component.
- *
- * @param key Base key of the multi lang. E.g. "gtceu.gui.overclock.enabled".
- * @param index Index of the single translation. E.g. 3 would return
- * "gtceu.gui.overclock.enabled.3".
- * @return Returns a single translation from a multi lang.
- */
- public static MutableComponent getFromMultiLang(String key, int index, Object... args) {
- return Component.translatable(getSubKey(key, index), args);
- }
-
- /**
- * Adds one key-value-pair to the given lang provider per line in the given
- * multiline (a multiline is a String
- * containing newline characters).
- * Example:
- *
- *
- * multilineLang(provider, "gtceu.gui.overclock.enabled", "Overclocking Enabled.\nClick to Disable");
- *
- *
- * This results in the following translations:
- *
- *
- * "gtceu.gui.overclock.enabled.0": "Overclocking Enabled.",
- * "gtceu.gui.overclock.enabled.1": "Click to Disable",
- *
- *
- * @param provider The provider to add to.
- * @param key Base key of the key-value-pair. The real key for each line
- * will be appended by ".0" for the
- * first line, ".1" for the second, etc. This ensures that the
- * keys are unique.
- * @param multiline The multiline string. It is a multiline because it contains
- * at least one newline character '\n'.
- */
- protected static void multilineLang(RegistrateLangProvider provider, String key, String multiline) {
- var lines = multiline.split("\n");
- multiLang(provider, key, lines);
- }
-
- /**
- * Replace a value in a language provider's mappings
- *
- * @param provider the provider whose mappings should be modified
- * @param key the key for the value
- * @param value the value to use in place of the old one
- */
- public static void replace(@NotNull RegistrateLangProvider provider, @NotNull String key,
- @NotNull String value) {
- try {
- // the regular lang mappings
- Field field = LanguageProvider.class.getDeclaredField("data");
- field.setAccessible(true);
- // noinspection unchecked
- Map map = (Map) field.get(provider);
- map.put(key, value);
-
- // upside-down lang mappings
- Field upsideDownField = RegistrateLangProvider.class.getDeclaredField("upsideDown");
- upsideDownField.setAccessible(true);
- // noinspection unchecked
- map = (Map) field.get(upsideDownField.get(provider));
-
- Method toUpsideDown = RegistrateLangProvider.class.getDeclaredMethod("toUpsideDown",
- String.class);
- toUpsideDown.setAccessible(true);
-
- map.put(key, (String) toUpsideDown.invoke(provider, value));
- } catch (NoSuchFieldException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
- throw new RuntimeException("Error replacing entry in datagen.", e);
- }
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/MachineLang.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/MachineLang.java
deleted file mode 100644
index 4965ed9..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/MachineLang.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.lang;
-
-import com.tterrag.registrate.providers.RegistrateLangProvider;
-
-public class MachineLang {
-
- protected static void init(RegistrateLangProvider provider) {}
-
- public static void standardTooltips(RegistrateLangProvider provider, String root, String machine,
- String lowTier,
- String midTier, String highTier) {}
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/MaterialLangGenerator.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/MaterialLangGenerator.java
deleted file mode 100644
index ee09d62..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/MaterialLangGenerator.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.lang;
-
-import net.phasetranscrystal.breacore.api.BreaApi;
-
-import com.tterrag.registrate.providers.RegistrateLangProvider;
-
-import static net.phasetranscrystal.brealib.util.FormattingUtil.toEnglishName;
-
-public class MaterialLangGenerator {
-
- public static void generate(RegistrateLangProvider provider, final String modId) {
- BreaApi.materialManager.stream()
- .filter(mat -> mat.getModid().equals(modId))
- .forEach(material -> {
- provider.add(material.getUnlocalizedName(), toEnglishName(material.getName()));
- });
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/ToolLang.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/ToolLang.java
deleted file mode 100644
index ae69d31..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/lang/ToolLang.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.lang;
-
-import com.tterrag.registrate.providers.RegistrateLangProvider;
-
-public class ToolLang {
-
- public static void init(RegistrateLangProvider provider) {
- initDeathMessages(provider);
- initToolInfo(provider);
- }
-
- private static void initDeathMessages(RegistrateLangProvider provider) {}
-
- private static void initToolInfo(RegistrateLangProvider provider) {}
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/BiomeTagsLoader.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/BiomeTagsLoader.java
deleted file mode 100644
index 0c25841..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/BiomeTagsLoader.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.tag;
-
-import net.phasetranscrystal.breacore.BreakdownCore;
-import net.phasetranscrystal.breacore.data.tags.CustomTags;
-
-import net.minecraft.core.HolderLookup;
-import net.minecraft.data.PackOutput;
-import net.minecraft.data.tags.BiomeTagsProvider;
-import net.minecraft.tags.BiomeTags;
-import net.neoforged.neoforge.common.Tags;
-
-import java.util.concurrent.CompletableFuture;
-
-public class BiomeTagsLoader extends BiomeTagsProvider {
-
- public BiomeTagsLoader(PackOutput output, CompletableFuture provider) {
- super(output, provider, BreakdownCore.MOD_ID);
- }
-
- @Override
- protected void addTags(HolderLookup.Provider provider) {
- tag(CustomTags.HAS_RUBBER_TREE).addTag(Tags.Biomes.IS_SWAMP).addTag(BiomeTags.IS_FOREST).addTag(BiomeTags.IS_JUNGLE);
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/BlockTagLoader.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/BlockTagLoader.java
deleted file mode 100644
index 6ed2a9c..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/BlockTagLoader.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.tag;
-
-import net.phasetranscrystal.breacore.data.tags.CustomTags;
-
-import net.minecraft.tags.BlockTags;
-import net.minecraft.world.level.block.Block;
-import net.neoforged.neoforge.common.Tags;
-
-import com.tterrag.registrate.providers.RegistrateTagsProvider;
-
-public class BlockTagLoader {
-
- public static void init(RegistrateTagsProvider.Intrinsic provider) {
- provider.tag(CustomTags.ENDSTONE_ORE_REPLACEABLES)
- .addTag(Tags.Blocks.END_STONES);
-
- provider.tag(BlockTags.INCORRECT_FOR_DIAMOND_TOOL)
- .addTag(Tags.Blocks.NEEDS_NETHERITE_TOOL)
- .addTag(CustomTags.NEEDS_DURANIUM_TOOL)
- .addTag(CustomTags.NEEDS_NEUTRONIUM_TOOL);
- provider.tag(BlockTags.INCORRECT_FOR_NETHERITE_TOOL)
- .addTag(CustomTags.NEEDS_DURANIUM_TOOL)
- .addTag(CustomTags.NEEDS_NEUTRONIUM_TOOL);
- provider.tag(CustomTags.INCORRECT_FOR_DURANIUM_TOOL)
- .addTag(CustomTags.NEEDS_NEUTRONIUM_TOOL);
-
- // this is awful. I don't care, though.
-
- // provider.tag(BlockTags.MINEABLE_WITH_AXE)
- // .add(TagEntry.element(GTMachines.WOODEN_DRUM.getId()))
- // .add(TagEntry.element(GTMachines.WOODEN_CRATE.getId()));
-
- // always add the wrench/pickaxe tag as a valid tag to mineable/wrench etc.
- provider.tag(CustomTags.MINEABLE_WITH_WRENCH)
- .addTag(CustomTags.MINEABLE_WITH_CONFIG_VALID_PICKAXE_WRENCH);
- provider.tag(CustomTags.MINEABLE_WITH_WIRE_CUTTER)
- .addTag(CustomTags.MINEABLE_WITH_CONFIG_VALID_PICKAXE_WIRE_CUTTER);
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/DamageTagsLoader.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/DamageTagsLoader.java
deleted file mode 100644
index 691664c..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/DamageTagsLoader.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.tag;
-
-import net.phasetranscrystal.breacore.BreakdownCore;
-
-import net.minecraft.core.HolderLookup;
-import net.minecraft.core.Registry;
-import net.minecraft.data.PackOutput;
-import net.minecraft.data.tags.TagsProvider;
-import net.minecraft.resources.ResourceKey;
-import net.minecraft.world.damagesource.DamageType;
-
-import java.util.concurrent.CompletableFuture;
-
-public class DamageTagsLoader extends TagsProvider {
-
- protected DamageTagsLoader(PackOutput output, ResourceKey extends Registry> registryKey, CompletableFuture lookupProvider) {
- super(output, registryKey, lookupProvider, BreakdownCore.MOD_ID);
- }
-
- @Override
- protected void addTags(HolderLookup.Provider provider) {
- // DamageTypeData.allInNamespace(BreakdownCore.MOD_ID).forEach(damageTypeData ->
- // damageTypeData.tags.forEach(damageTypeTagKey -> tag(damageTypeTagKey).add(damageTypeData.key)));
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/EntityTypeTagLoader.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/EntityTypeTagLoader.java
deleted file mode 100644
index 48fb67d..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/EntityTypeTagLoader.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.tag;
-
-import net.phasetranscrystal.breacore.data.tags.CustomTags;
-
-import net.minecraft.tags.TagKey;
-import net.minecraft.world.entity.EntityType;
-
-import com.tterrag.registrate.providers.RegistrateTagsProvider;
-
-public class EntityTypeTagLoader {
-
- public static void init(RegistrateTagsProvider.Intrinsic> provider) {
- create(provider, CustomTags.HEAT_IMMUNE, EntityType.BLAZE, EntityType.MAGMA_CUBE, EntityType.WITHER_SKELETON,
- EntityType.WITHER);
- create(provider, CustomTags.CHEMICAL_IMMUNE, EntityType.SKELETON, EntityType.STRAY);
- create(provider, CustomTags.IRON_GOLEMS, EntityType.IRON_GOLEM);
- create(provider, CustomTags.SPIDERS, EntityType.SPIDER, EntityType.CAVE_SPIDER);
- }
-
- public static void create(RegistrateTagsProvider.Intrinsic> provider, TagKey> tagKey,
- EntityType>... rls) {
- var builder = provider.tag(tagKey);
- for (EntityType> entityType : rls) {
- builder.add(entityType);
- }
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/FluidTagLoader.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/FluidTagLoader.java
deleted file mode 100644
index c144fb3..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/FluidTagLoader.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.tag;
-
-import net.minecraft.tags.TagKey;
-import net.minecraft.world.level.material.Fluid;
-
-import com.tterrag.registrate.providers.RegistrateTagsProvider;
-
-public class FluidTagLoader {
-
- public static void init(RegistrateTagsProvider.Intrinsic provider) {}
-
- public static void create(RegistrateTagsProvider.Intrinsic provider, TagKey tag, Fluid... fluids) {
- var builder = provider.tag(tag);
- for (Fluid fluid : fluids) {
- builder.add(fluid);
- }
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/ItemTagLoader.java b/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/ItemTagLoader.java
deleted file mode 100644
index 0c2d060..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/datagen/tag/ItemTagLoader.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package net.phasetranscrystal.breacore.data.datagen.tag;
-
-import net.phasetranscrystal.breacore.api.material.ChemicalHelper;
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.api.tag.TagPrefix;
-import net.phasetranscrystal.breacore.data.items.MaterialItems;
-import net.phasetranscrystal.breacore.data.tagprefix.BreaTagPrefixes;
-import net.phasetranscrystal.breacore.data.tags.CustomTags;
-
-import net.minecraft.data.tags.TagAppender;
-import net.minecraft.resources.Identifier;
-import net.minecraft.tags.ItemTags;
-import net.minecraft.tags.TagKey;
-import net.minecraft.world.item.Item;
-import net.minecraft.world.item.Items;
-import net.neoforged.neoforge.common.Tags;
-
-import com.tterrag.registrate.providers.RegistrateTagsProvider;
-
-import java.util.Objects;
-
-import static net.phasetranscrystal.breacore.api.material.MarkerMaterials.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaMaterials.*;
-import static net.phasetranscrystal.breacore.data.tagprefix.BreaTagPrefixes.*;
-
-public class ItemTagLoader {
-
- public static void init(RegistrateTagsProvider.Intrinsic- provider) {
- addTag(provider, lens, Color.White)
- .add(MaterialItems.MATERIAL_ITEMS.get(lens, Glass).get())
- .add(MaterialItems.MATERIAL_ITEMS.get(lens, NetherStar).get());
- addTag(provider, lens, Color.LightBlue).add(MaterialItems.MATERIAL_ITEMS.get(lens, Diamond).get());
- addTag(provider, lens, Color.Green).add(MaterialItems.MATERIAL_ITEMS.get(lens, Emerald).get());
- addTag(provider, lens, Color.Purple).add(MaterialItems.MATERIAL_ITEMS.get(lens, Amethyst).get());
-
- provider.tag(CustomTags.PISTONS)
- .add(Items.PISTON)
- .add(Items.STICKY_PISTON);
-
- // add treated wood stick to vanilla sticks tag
- // noinspection DataFlowIssue ChemicalHelper#getTag can't return null with treated wood rod
- provider.tag(Tags.Items.RODS_WOODEN)
- .add(MaterialItems.MATERIAL_ITEMS.get(BreaTagPrefixes.rod, TreatedWood).get());
-
- // add treated and untreated wood plates to vanilla planks tag
- provider.tag(ItemTags.PLANKS)
- .add(MaterialItems.MATERIAL_ITEMS.get(plate, TreatedWood).get())
- .add(MaterialItems.MATERIAL_ITEMS.get(plate, Wood).get());
- }
-
- private static TagAppender
- addTag(RegistrateTagsProvider.Intrinsic
- provider,
- TagPrefix prefix, Material material) {
- return provider.tag(Objects.requireNonNull(ChemicalHelper.getTag(prefix, material),
- "%s/%s doesn't have any tags!".formatted(prefix, material)));
- }
-
- private static void create(RegistrateTagsProvider.Intrinsic
- provider, TagPrefix prefix, Material material,
- Item... rls) {
- create(provider, ChemicalHelper.getTag(prefix, material), rls);
- }
-
- @SafeVarargs
- public static void create(RegistrateTagsProvider.Intrinsic
- provider, TagKey
- tagKey, TagKey
- ... rls) {
- var builder = provider.tag(tagKey);
- for (TagKey
- tag : rls) {
- builder.addTag(tag);
- }
- }
-
- public static void create(RegistrateTagsProvider.Intrinsic
- provider, TagKey
- tagKey, Item... rls) {
- var builder = provider.tag(tagKey);
- for (Item item : rls) {
- builder.add(item);
- }
- }
-
- private static Identifier rl(String name) {
- return Identifier.parse(name);
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/fluids/BreaFluids.java b/src/main/java/net/phasetranscrystal/breacore/data/fluids/BreaFluids.java
index 95748ac..ba37e26 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/fluids/BreaFluids.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/fluids/BreaFluids.java
@@ -1,64 +1,6 @@
package net.phasetranscrystal.breacore.data.fluids;
-import net.phasetranscrystal.brealib.BreaLib;
-
-import net.phasetranscrystal.breacore.api.BreaApi;
-import net.phasetranscrystal.breacore.api.fluid.potion.PotionFluid;
-import net.phasetranscrystal.breacore.api.fluid.store.FluidStorageKeys;
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.api.material.property.PropertyKey;
-import net.phasetranscrystal.breacore.api.registry.registrate.BreaRegistrate;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterials;
-import net.phasetranscrystal.breacore.data.misc.BreaCreativeModeTabs;
-import net.phasetranscrystal.breacore.data.tags.CustomTags;
-
-import net.minecraft.world.level.material.Fluid;
-import net.minecraft.world.level.material.Fluids;
-import net.neoforged.neoforge.common.NeoForgeMod;
-
-import com.tterrag.registrate.util.entry.FluidEntry;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.function.Supplier;
-
-import static net.phasetranscrystal.breacore.common.registry.BreaRegistration.REGISTRATE;
-
public class BreaFluids {
- @SuppressWarnings("UnstableApiUsage")
- public static final FluidEntry POTION = REGISTRATE
- .fluid("potion", BreaLib.id("block/fluids/fluid.potion"), BreaLib.id("block/fluids/fluid.potion"),
- PotionFluid.PotionFluidType::new, PotionFluid::new)
- .lang("Potion")
- .source(PotionFluid::new).noBlock().noBucket()
- .tag(CustomTags.POTION_FLUIDS)
- .register();
-
- public static void init() {
- // Register fluids for non-materials
- handleNonMaterialFluids(BreaMaterials.Water, Fluids.WATER);
- handleNonMaterialFluids(BreaMaterials.Lava, Fluids.LAVA);
- handleNonMaterialFluids(BreaMaterials.Milk, NeoForgeMod.MILK);
- NeoForgeMod.enableMilkFluid();
-
- // register fluids for materials
- REGISTRATE.creativeModeTab(() -> BreaCreativeModeTabs.MATERIAL_FLUID);
- for (var material : BreaApi.materialManager) {
- var fluidProperty = material.getProperty(PropertyKey.FLUID);
-
- if (fluidProperty != null) {
- BreaRegistrate registrate = BreaRegistrate.createIgnoringListenerErrors(material.getModid());
- fluidProperty.registerFluids(material, registrate);
- }
- }
- }
-
- public static void handleNonMaterialFluids(@NotNull Material material, @NotNull Fluid fluid) {
- handleNonMaterialFluids(material, () -> fluid);
- }
-
- public static void handleNonMaterialFluids(@NotNull Material material, @NotNull Supplier fluid) {
- var property = material.getProperty(PropertyKey.FLUID);
- property.getStorage().store(FluidStorageKeys.LIQUID, fluid, null);
- }
+ public static void init() {}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/items/BreaItems.java b/src/main/java/net/phasetranscrystal/breacore/data/items/BreaItems.java
index b83fb68..7647794 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/items/BreaItems.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/items/BreaItems.java
@@ -1,108 +1,9 @@
package net.phasetranscrystal.breacore.data.items;
-import net.phasetranscrystal.brealib.util.memoization.CacheMemoizer;
-
-import net.phasetranscrystal.breacore.api.item.ComponentItem;
-import net.phasetranscrystal.breacore.api.item.IComponentItem;
-import net.phasetranscrystal.breacore.api.item.TagPrefixItem;
-import net.phasetranscrystal.breacore.api.item.component.IItemComponent;
-import net.phasetranscrystal.breacore.api.material.ChemicalHelper;
-import net.phasetranscrystal.breacore.api.material.ItemMaterialData;
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.api.material.stack.ItemMaterialInfo;
-import net.phasetranscrystal.breacore.api.material.stack.MaterialEntry;
-import net.phasetranscrystal.breacore.api.tag.TagPrefix;
-
-import net.minecraft.core.cauldron.CauldronInteraction;
-import net.minecraft.stats.Stats;
-import net.minecraft.world.InteractionResult;
-import net.minecraft.world.item.Item;
-import net.minecraft.world.level.ItemLike;
-import net.minecraft.world.level.block.LayeredCauldronBlock;
-
-import com.tterrag.registrate.builders.ItemBuilder;
-import com.tterrag.registrate.providers.DataGenContext;
-import com.tterrag.registrate.providers.RegistrateLangProvider;
-import com.tterrag.registrate.util.nullness.NonNullBiConsumer;
-import com.tterrag.registrate.util.nullness.NonNullConsumer;
-import com.tterrag.registrate.util.nullness.NonNullFunction;
-import org.apache.commons.lang3.StringUtils;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.function.Supplier;
-import java.util.stream.Collectors;
-
public class BreaItems {
public static void init() {
DebugItems.init();
MaterialItems.init();
}
-
- public static NonNullConsumer materialInfo(ItemMaterialInfo materialInfo) {
- return item -> ItemMaterialData.registerMaterialInfo(item, materialInfo);
- }
-
- public static
> NonNullFunction unificationItem(@NotNull TagPrefix tagPrefix, @NotNull Material mat) {
- return builder -> {
- builder.onRegister(item -> {
- Supplier supplier = CacheMemoizer.memoize(() -> item);
- MaterialEntry entry = new MaterialEntry(tagPrefix, mat);
- MaterialItems.toUnify.put(entry, supplier);
- ItemMaterialData.registerMaterialEntry(supplier, entry);
- });
- return builder;
- };
- }
-
- public static void cauldronInteraction(T item) {
- if (item instanceof TagPrefixItem tagPrefixItem &&
- MaterialItems.purifyMap.containsKey(tagPrefixItem.tagPrefix)) {
- CauldronInteraction.WATER.map().put(item, (state, world, pos, player, hand, stack) -> {
- if (!world.isClientSide()) {
- Item stackItem = stack.getItem();
- if (stackItem instanceof TagPrefixItem prefixItem) {
- if (!MaterialItems.purifyMap.containsKey(prefixItem.tagPrefix))
- return InteractionResult.PASS;
- if (!state.hasProperty(LayeredCauldronBlock.LEVEL)) {
- return InteractionResult.PASS;
- }
- int level = state.getValue(LayeredCauldronBlock.LEVEL);
- if (level == 0)
- return InteractionResult.PASS;
- player.setItemInHand(hand, ChemicalHelper.get(MaterialItems.purifyMap.get(prefixItem.tagPrefix), prefixItem.material, stack.getCount()));
- player.awardStat(Stats.USE_CAULDRON);
- player.awardStat(Stats.ITEM_USED.get(stackItem));
- LayeredCauldronBlock.lowerFillLevel(state, world, pos);
- }
- }
- return world.isClientSide() ? InteractionResult.SUCCESS : InteractionResult.CONSUME;
- });
-
- }
- }
-
- public static NonNullConsumer burnTime(int burnTime) {
- return item -> item.burnTime(burnTime);
- }
-
- public static NonNullConsumer attach(IItemComponent components) {
- return item -> item.attachComponents(components);
- }
-
- public static NonNullConsumer attach(IItemComponent... components) {
- return item -> item.attachComponents(components);
- }
-
- @NotNull
- private static <
- T extends Item> NonNullBiConsumer, RegistrateLangProvider> reverseLangValue() {
- return (ctx, prov) -> {
- var names = Arrays.stream(ctx.getName().split("/.")).collect(Collectors.toList());
- Collections.reverse(names);
- prov.add(ctx.get(), names.stream().map(StringUtils::capitalize).collect(Collectors.joining(" ")));
- };
- }
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/items/DebugItems.java b/src/main/java/net/phasetranscrystal/breacore/data/items/DebugItems.java
index 69ac60f..26f9f1b 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/items/DebugItems.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/items/DebugItems.java
@@ -3,8 +3,6 @@
import net.phasetranscrystal.breacore.data.misc.BreaCreativeModeTabs;
import static net.phasetranscrystal.breacore.common.registry.BreaRegistration.REGISTRATE;
-import static net.phasetranscrystal.breacore.data.items.BreaItems.*;
-import static net.phasetranscrystal.breacore.data.tags.CustomTags.DEBUG_ITEMS;
public class DebugItems {
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/items/MaterialItems.java b/src/main/java/net/phasetranscrystal/breacore/data/items/MaterialItems.java
index 59effa4..279b09b 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/items/MaterialItems.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/items/MaterialItems.java
@@ -1,69 +1,8 @@
package net.phasetranscrystal.breacore.data.items;
-import net.phasetranscrystal.breacore.api.BreaApi;
-import net.phasetranscrystal.breacore.api.item.TagPrefixItem;
-import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.api.material.stack.MaterialEntry;
-import net.phasetranscrystal.breacore.api.registry.registrate.BreaRegistrate;
-import net.phasetranscrystal.breacore.api.tag.TagPrefix;
-import net.phasetranscrystal.breacore.client.datagen.TextureCreater;
-
-import net.minecraft.world.level.ItemLike;
-
-import com.google.common.collect.ImmutableTable;
-import com.google.common.collect.Table;
-import com.tterrag.registrate.providers.ProviderType;
-import com.tterrag.registrate.util.entry.ItemEntry;
-import com.tterrag.registrate.util.nullness.NonNullBiConsumer;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Supplier;
-
-import static net.phasetranscrystal.breacore.common.registry.BreaRegistration.REGISTRATE;
import static net.phasetranscrystal.breacore.data.misc.BreaCreativeModeTabs.*;
public class MaterialItems {
- // Reference Maps
- public static final Map> toUnify = new HashMap<>();
- public static final Map purifyMap = new HashMap<>();
- // Reference Tables
- public static Table> MATERIAL_ITEMS;
- // Reference Table Builders
- static ImmutableTable.Builder> MATERIAL_ITEMS_BUILDER = ImmutableTable
- .builder();
-
- static {
-
- }
-
- public static void init() {
- REGISTRATE.creativeModeTab(() -> MATERIAL_ITEM);
- for (var tagPrefix : TagPrefix.values()) {
- if (tagPrefix.doGenerateItem()) {
- for (Material material : BreaApi.materialManager) {
- BreaRegistrate registrate = BreaRegistrate.createIgnoringListenerErrors(material.getModid());
- if (tagPrefix.doGenerateItem(material)) {
- generateMaterialItem(tagPrefix, material, registrate);
- }
- }
- }
- }
- MATERIAL_ITEMS = MATERIAL_ITEMS_BUILDER.build();
- }
-
- private static void generateMaterialItem(TagPrefix tagPrefix, Material material, BreaRegistrate registrate) {
- MATERIAL_ITEMS_BUILDER.put(tagPrefix, material, registrate
- .item(tagPrefix.idPattern().formatted(material.getName()),
- properties -> new TagPrefixItem(properties, tagPrefix, material))
- .onRegister(TagPrefixItem::onRegister)
- .setData(ProviderType.LANG, NonNullBiConsumer.noop())
- .transform(BreaItems.unificationItem(tagPrefix, material))
- .properties(p -> p.stacksTo(tagPrefix.maxStackSize()))
- .model(NonNullBiConsumer::noop)
- .model(() -> TextureCreater::generageTagPrefixItemModel)
- .onRegister(BreaItems::cauldronInteraction)
- .register());
- }
+ public static void init() {}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/machine/BreaMachines.java b/src/main/java/net/phasetranscrystal/breacore/data/machine/BreaMachines.java
index 2c5de1b..3786dbf 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/machine/BreaMachines.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/machine/BreaMachines.java
@@ -9,5 +9,7 @@ public class BreaMachines {
REGISTRATE.creativeModeTab(() -> MACHINE);
}
- public static void init() {}
+ public static void init() {
+ DebugMachines.init();
+ }
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/machine/DebugMachines.java b/src/main/java/net/phasetranscrystal/breacore/data/machine/DebugMachines.java
index c20921d..7ab6100 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/machine/DebugMachines.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/machine/DebugMachines.java
@@ -4,4 +4,5 @@
public class DebugMachines {
+ public static void init() {}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/materials/BreaElements.java b/src/main/java/net/phasetranscrystal/breacore/data/materials/BreaElements.java
index 95cb8b1..9e9fd1c 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/materials/BreaElements.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/materials/BreaElements.java
@@ -3,6 +3,8 @@
import net.phasetranscrystal.brealib.BreaLib;
import net.phasetranscrystal.breacore.api.BreaApi;
+import net.phasetranscrystal.breacore.api.addon.AddonFinder;
+import net.phasetranscrystal.breacore.api.addon.IBreaAddon;
import net.phasetranscrystal.breacore.api.material.Element;
import net.minecraft.core.Holder;
@@ -13,6 +15,10 @@
public class BreaElements {
+ static {
+ ELEMENTS.unfreeze(true);
+ }
+
public static final Element H = createAndRegister(1, 0, -1, null, "Hydrogen", "H", false);
public static final Element D = createAndRegister(1, 1, -1, "H", "Deuterium", "D", true);
public static final Element T = createAndRegister(1, 2, -1, "D", "Tritium", "T", true);
@@ -139,10 +145,6 @@ public class BreaElements {
public static final Element Ts = createAndRegister(117, 177, -1, null, "Tennessine", "Ts", false);
public static final Element Og = createAndRegister(118, 176, -1, null, "Oganesson", "Og", false);
- static {
- ELEMENTS.unfreeze(true);
- }
-
public static Element createAndRegister(long protons, long neutrons, long halfLifeSeconds, String decayTo,
String name, String symbol, boolean isIsotope) {
Element element = new Element(protons, neutrons, halfLifeSeconds, decayTo, name, symbol, isIsotope);
@@ -151,6 +153,7 @@ public static Element createAndRegister(long protons, long neutrons, long halfLi
}
public static void init() {
+ AddonFinder.getAddonList().forEach(IBreaAddon::addElement);
BreaApi.postRegisterEvent(ELEMENTS);
ELEMENTS.freeze();
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/materials/BreaMaterialIconSet.java b/src/main/java/net/phasetranscrystal/breacore/data/materials/BreaMaterialIconSet.java
deleted file mode 100644
index 547e1c2..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/materials/BreaMaterialIconSet.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package net.phasetranscrystal.breacore.data.materials;
-
-import net.phasetranscrystal.breacore.api.material.info.MaterialIconSet;
-
-public class BreaMaterialIconSet {
-
- public static final MaterialIconSet DULL = MaterialIconSet.DULL;
- public static final MaterialIconSet FLUID = new MaterialIconSet("fluid");
-
- public static void init() {}
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/materials/BreaMaterialIconTypes.java b/src/main/java/net/phasetranscrystal/breacore/data/materials/BreaMaterialIconTypes.java
deleted file mode 100644
index 3f7927a..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/materials/BreaMaterialIconTypes.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package net.phasetranscrystal.breacore.data.materials;
-
-import net.phasetranscrystal.breacore.api.material.info.MaterialIconType;
-
-public class BreaMaterialIconTypes {
-
- public static final MaterialIconType dustTiny = new MaterialIconType("dustTiny");
- public static final MaterialIconType dustSmall = new MaterialIconType("dustSmall");
- public static final MaterialIconType dust = new MaterialIconType("dust");
- public static final MaterialIconType dustImpure = new MaterialIconType("dustImpure");
- public static final MaterialIconType dustPure = new MaterialIconType("dustPure");
- public static final MaterialIconType rawOre = new MaterialIconType("rawOre");
- public static final MaterialIconType rawOreBlock = new MaterialIconType("rawOreBlock");
- public static final MaterialIconType crushed = new MaterialIconType("crushed");
- public static final MaterialIconType crushedPurified = new MaterialIconType("crushedPurified");
- public static final MaterialIconType crushedRefined = new MaterialIconType("crushedRefined");
- public static final MaterialIconType gem = new MaterialIconType("gem");
- public static final MaterialIconType gemChipped = new MaterialIconType("gemChipped");
- public static final MaterialIconType gemFlawed = new MaterialIconType("gemFlawed");
- public static final MaterialIconType gemFlawless = new MaterialIconType("gemFlawless");
- public static final MaterialIconType gemExquisite = new MaterialIconType("gemExquisite");
- public static final MaterialIconType nugget = new MaterialIconType("nugget");
- public static final MaterialIconType ingot = new MaterialIconType("ingot");
- public static final MaterialIconType ingotHot = new MaterialIconType("ingotHot");
- public static final MaterialIconType ingotDouble = new MaterialIconType("ingotDouble");
- public static final MaterialIconType ingotTriple = new MaterialIconType("ingotTriple");
- public static final MaterialIconType ingotQuadruple = new MaterialIconType("ingotQuadruple");
- public static final MaterialIconType ingotQuintuple = new MaterialIconType("ingotQuintuple");
- public static final MaterialIconType plate = new MaterialIconType("plate");
- public static final MaterialIconType plateDouble = new MaterialIconType("plateDouble");
- public static final MaterialIconType plateTriple = new MaterialIconType("plateTriple");
- public static final MaterialIconType plateQuadruple = new MaterialIconType("plateQuadruple");
- public static final MaterialIconType plateQuintuple = new MaterialIconType("plateQuintuple");
- public static final MaterialIconType plateDense = new MaterialIconType("plateDense");
- public static final MaterialIconType rod = new MaterialIconType("rod");
- public static final MaterialIconType lens = new MaterialIconType("lens");
- public static final MaterialIconType round = new MaterialIconType("round");
- public static final MaterialIconType bolt = new MaterialIconType("bolt");
- public static final MaterialIconType screw = new MaterialIconType("screw");
- public static final MaterialIconType ring = new MaterialIconType("ring");
- public static final MaterialIconType wireFine = new MaterialIconType("wireFine");
- public static final MaterialIconType gearSmall = new MaterialIconType("gearSmall");
- public static final MaterialIconType rotor = new MaterialIconType("rotor");
- public static final MaterialIconType rodLong = new MaterialIconType("rodLong");
- public static final MaterialIconType springSmall = new MaterialIconType("springSmall");
- public static final MaterialIconType spring = new MaterialIconType("spring");
- public static final MaterialIconType gear = new MaterialIconType("gear");
- public static final MaterialIconType foil = new MaterialIconType("foil");
- public static final MaterialIconType toolHeadSword = new MaterialIconType("toolHeadSword");
- public static final MaterialIconType toolHeadPickaxe = new MaterialIconType("toolHeadPickaxe");
- public static final MaterialIconType toolHeadShovel = new MaterialIconType("toolHeadShovel");
- public static final MaterialIconType toolHeadAxe = new MaterialIconType("toolHeadAxe");
- public static final MaterialIconType toolHeadHoe = new MaterialIconType("toolHeadHoe");
- public static final MaterialIconType toolHeadHammer = new MaterialIconType("toolHeadHammer");
- public static final MaterialIconType toolHeadFile = new MaterialIconType("toolHeadFile");
- public static final MaterialIconType toolHeadSaw = new MaterialIconType("toolHeadSaw");
- public static final MaterialIconType toolHeadBuzzSaw = new MaterialIconType("toolHeadBuzzSaw");
- public static final MaterialIconType toolHeadDrill = new MaterialIconType("toolHeadDrill");
- public static final MaterialIconType toolHeadChainsaw = new MaterialIconType("toolHeadChainsaw");
- public static final MaterialIconType toolHeadScythe = new MaterialIconType("toolHeadScythe");
- public static final MaterialIconType toolHeadScrewdriver = new MaterialIconType("toolHeadScrewdriver");
- public static final MaterialIconType toolHeadWrench = new MaterialIconType("toolHeadWrench");
- public static final MaterialIconType toolHeadWireCutter = new MaterialIconType("toolHeadWireCutter");
- public static final MaterialIconType turbineBlade = new MaterialIconType("turbineBlade");
- // BLOCK TEXTURES
- public static final MaterialIconType liquid = new MaterialIconType("liquid");
- public static final MaterialIconType gas = new MaterialIconType("gas");
- public static final MaterialIconType plasma = new MaterialIconType("plasma");
- public static final MaterialIconType molten = new MaterialIconType("molten");
- public static final MaterialIconType block = new MaterialIconType("block");
- public static final MaterialIconType ore = new MaterialIconType("ore");
- public static final MaterialIconType oreSmall = new MaterialIconType("oreSmall");
- public static final MaterialIconType frameGt = new MaterialIconType("frameGt");
- public static final MaterialIconType wire = new MaterialIconType("wire");
- // USED FOR GREGIFICATION ADDON
- public static final MaterialIconType seed = new MaterialIconType("seed");
- public static final MaterialIconType crop = new MaterialIconType("crop");
- public static final MaterialIconType essence = new MaterialIconType("essence");
-
- public static void init() {}
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/materials/BreaMaterials.java b/src/main/java/net/phasetranscrystal/breacore/data/materials/BreaMaterials.java
index 0d2119d..66b4f53 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/materials/BreaMaterials.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/materials/BreaMaterials.java
@@ -1,38 +1,19 @@
package net.phasetranscrystal.breacore.data.materials;
-import net.phasetranscrystal.brealib.BreaLib;
-
import net.phasetranscrystal.breacore.BreakdownCore;
import net.phasetranscrystal.breacore.api.BreaApi;
+import net.phasetranscrystal.breacore.api.addon.AddonFinder;
+import net.phasetranscrystal.breacore.api.addon.IBreaAddon;
import net.phasetranscrystal.breacore.api.material.MarkerMaterial;
-import net.phasetranscrystal.breacore.api.material.MarkerMaterials;
import net.phasetranscrystal.breacore.api.material.Material;
-import net.phasetranscrystal.breacore.api.material.info.MaterialFlag;
-import net.phasetranscrystal.breacore.api.material.stack.MaterialStack;
-import net.phasetranscrystal.breacore.api.tag.TagPrefix;
import net.phasetranscrystal.breacore.data.materials.material.*;
import net.minecraft.resources.Identifier;
-import net.minecraft.world.item.Items;
-import net.minecraft.world.level.ItemLike;
-import net.minecraft.world.level.block.Blocks;
import org.jetbrains.annotations.NotNull;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import static net.phasetranscrystal.breacore.api.material.info.MaterialFlags.*;
-import static net.phasetranscrystal.breacore.api.tag.TagPrefix.ORES;
-import static net.phasetranscrystal.breacore.data.tagprefix.BreaTagPrefixes.*;
-
public class BreaMaterials {
- public static final List STD_METAL = new ArrayList<>();
- public static final List EXT_METAL = new ArrayList<>();
- public static final List EXT2_METAL = new ArrayList<>();
- public static final MarkerMaterial NULL = new MarkerMaterial(BreaLib.id("null"));
/// 化学颜料
public static Material[] CHEMICAL_DYES;
// region 元素周期表材料
@@ -284,16 +265,6 @@ public class BreaMaterials {
// 空气
public static Material LiquidEnderAir;
- static {
- STD_METAL.add(GENERATE_PLATE);
-
- EXT_METAL.addAll(STD_METAL);
- EXT_METAL.add(GENERATE_ROD);
-
- EXT2_METAL.addAll(EXT_METAL);
- EXT2_METAL.addAll(Arrays.asList(GENERATE_LONG_ROD, GENERATE_BOLT_SCREW));
- }
-
public static void init() {
MarkerMaterials.register();
ElementMaterials.register();
@@ -305,6 +276,8 @@ public static void init() {
MaterialFlagAddition.register();
+ AddonFinder.getAddonList().forEach(IBreaAddon::addMaterial);
+
CHEMICAL_DYES = new Material[] {
DyeWhite, DyeOrange,
DyeMagenta, DyeLightBlue,
@@ -315,155 +288,16 @@ public static void init() {
DyeBrown, DyeGreen,
DyeRed, DyeBlack
};
-
- gem.setIgnored(Diamond, Items.DIAMOND);
- gem.setIgnored(Emerald, Items.EMERALD);
- gem.setIgnored(Lapis, Items.LAPIS_LAZULI);
- gem.setIgnored(NetherQuartz, Items.QUARTZ);
- gem.setIgnored(Coal, Items.COAL);
- gem.setIgnored(Amethyst, Items.AMETHYST_SHARD);
- gem.setIgnored(EchoShard, Items.ECHO_SHARD);
- excludeAllGems(Charcoal, Items.CHARCOAL);
- excludeAllGems(Flint, Items.FLINT);
- excludeAllGems(EnderPearl, Items.ENDER_PEARL);
- excludeAllGems(EnderEye, Items.ENDER_EYE);
- excludeAllGems(NetherStar, Items.NETHER_STAR);
-
- dust.setIgnored(Redstone, Items.REDSTONE);
- dust.setIgnored(Glowstone, Items.GLOWSTONE_DUST);
- dust.setIgnored(Gunpowder, Items.GUNPOWDER);
- dust.setIgnored(Sugar, Items.SUGAR);
- dust.setIgnored(Bone, Items.BONE_MEAL);
- dust.setIgnored(Blaze, Items.BLAZE_POWDER);
-
- rod.setIgnored(Wood, Items.STICK);
- rod.setIgnored(Bone, Items.BONE);
- rod.setIgnored(Blaze, Items.BLAZE_ROD);
- rod.setIgnored(Paper);
-
- ingot.setIgnored(Iron, Items.IRON_INGOT);
- ingot.setIgnored(Gold, Items.GOLD_INGOT);
- ingot.setIgnored(Copper, Items.COPPER_INGOT);
- ingot.setIgnored(Netherite, Items.NETHERITE_INGOT);
- ingot.setIgnored(Brick, Items.BRICK);
- ingot.setIgnored(Wax, Items.HONEYCOMB);
-
- nugget.setIgnored(Gold, Items.GOLD_NUGGET);
- nugget.setIgnored(Iron, Items.IRON_NUGGET);
-
- plate.setIgnored(Paper, Items.PAPER);
-
- block.setIgnored(Iron, Blocks.IRON_BLOCK);
- block.setIgnored(Gold, Blocks.GOLD_BLOCK);
- block.setIgnored(Copper, Blocks.COPPER_BLOCK);
- block.setIgnored(Netherite, Items.NETHERITE_BLOCK);
- block.setIgnored(Lapis, Blocks.LAPIS_BLOCK);
- block.setIgnored(Emerald, Blocks.EMERALD_BLOCK);
- block.setIgnored(Redstone, Blocks.REDSTONE_BLOCK);
- block.setIgnored(Diamond, Blocks.DIAMOND_BLOCK);
- block.setIgnored(Coal, Blocks.COAL_BLOCK);
- block.setIgnored(Amethyst, Blocks.AMETHYST_BLOCK);
- block.setIgnored(Glass, Blocks.GLASS);
- block.setIgnored(Glowstone, Blocks.GLOWSTONE);
- block.setIgnored(Wood);
- block.setIgnored(TreatedWood);
- block.setIgnored(Clay, Blocks.CLAY);
- block.setIgnored(Brick, Blocks.BRICKS);
- block.setIgnored(Bone, Blocks.BONE_BLOCK);
- block.setIgnored(NetherQuartz, Blocks.QUARTZ_BLOCK);
- block.setIgnored(Ice, Blocks.ICE);
- block.setIgnored(Concrete, Blocks.WHITE_CONCRETE, Blocks.ORANGE_CONCRETE, Blocks.MAGENTA_CONCRETE,
- Blocks.LIGHT_BLUE_CONCRETE, Blocks.YELLOW_CONCRETE, Blocks.LIME_CONCRETE,
- Blocks.PINK_CONCRETE, Blocks.GRAY_CONCRETE, Blocks.LIGHT_GRAY_CONCRETE, Blocks.CYAN_CONCRETE,
- Blocks.PURPLE_CONCRETE, Blocks.BLUE_CONCRETE,
- Blocks.BROWN_CONCRETE, Blocks.GREEN_CONCRETE, Blocks.RED_CONCRETE, Blocks.BLACK_CONCRETE);
- block.setIgnored(Blaze);
- block.setIgnored(Wax, Blocks.HONEYCOMB_BLOCK);
-
- rock.setIgnored(Granite, Blocks.GRANITE);
- rock.setIgnored(Granite, Blocks.POLISHED_GRANITE);
- rock.setIgnored(Andesite, Blocks.ANDESITE);
- rock.setIgnored(Andesite, Blocks.POLISHED_ANDESITE);
- rock.setIgnored(Diorite, Blocks.DIORITE);
- rock.setIgnored(Diorite, Blocks.POLISHED_DIORITE);
- rock.setIgnored(Stone, Blocks.STONE);
- rock.setIgnored(Calcite, Blocks.CALCITE);
- rock.setIgnored(Netherrack, Blocks.NETHERRACK);
- rock.setIgnored(Obsidian, Blocks.OBSIDIAN);
- rock.setIgnored(Endstone, Blocks.END_STONE);
- rock.setIgnored(Deepslate, Blocks.DEEPSLATE);
- rock.setIgnored(Basalt, Blocks.BASALT);
- rock.setIgnored(Blackstone, Blocks.BLACKSTONE);
- block.setIgnored(Sculk, Blocks.SCULK);
-
- for (TagPrefix prefix : ORES.keySet()) {
- TagPrefix.OreType oreType = ORES.get(prefix);
- if (oreType.shouldDropAsItem() && oreType.material() != null) {
- prefix.addSecondaryMaterial(new MaterialStack(oreType.material().get(), dust.materialAmount()));
- }
- }
-
- dye.setIgnored(DyeBlack, Items.BLACK_DYE);
- dye.setIgnored(DyeRed, Items.RED_DYE);
- dye.setIgnored(DyeGreen, Items.GREEN_DYE);
- dye.setIgnored(DyeBrown, Items.BROWN_DYE);
- dye.setIgnored(DyeBlue, Items.BLUE_DYE);
- dye.setIgnored(DyePurple, Items.PURPLE_DYE);
- dye.setIgnored(DyeCyan, Items.CYAN_DYE);
- dye.setIgnored(DyeLightGray, Items.LIGHT_GRAY_DYE);
- dye.setIgnored(DyeGray, Items.GRAY_DYE);
- dye.setIgnored(DyePink, Items.PINK_DYE);
- dye.setIgnored(DyeLime, Items.LIME_DYE);
- dye.setIgnored(DyeYellow, Items.YELLOW_DYE);
- dye.setIgnored(DyeLightBlue, Items.LIGHT_BLUE_DYE);
- dye.setIgnored(DyeMagenta, Items.MAGENTA_DYE);
- dye.setIgnored(DyeOrange, Items.ORANGE_DYE);
- dye.setIgnored(DyeWhite, Items.WHITE_DYE);
-
- // register vanilla materials
-
- rawOre.setIgnored(Gold, Items.RAW_GOLD);
- rawOre.setIgnored(Iron, Items.RAW_IRON);
- rawOre.setIgnored(Copper, Items.RAW_COPPER);
- rawOreBlock.setIgnored(Gold, Blocks.RAW_GOLD_BLOCK);
- rawOreBlock.setIgnored(Iron, Blocks.RAW_IRON_BLOCK);
- rawOreBlock.setIgnored(Copper, Blocks.RAW_COPPER_BLOCK);
-
- block.modifyMaterialAmount(Amethyst, 4);
- block.modifyMaterialAmount(EchoShard, 4);
- block.modifyMaterialAmount(Glowstone, 4);
- block.modifyMaterialAmount(NetherQuartz, 4);
- block.modifyMaterialAmount(CertusQuartz, 4);
- block.modifyMaterialAmount(Brick, 4);
- block.modifyMaterialAmount(Clay, 4);
-
- block.modifyMaterialAmount(Concrete, 1);
- block.modifyMaterialAmount(Glass, 1);
- block.modifyMaterialAmount(Ice, 1);
- block.modifyMaterialAmount(Obsidian, 1);
- block.modifyMaterialAmount(Sculk, 1);
- block.modifyMaterialAmount(Wax, 4);
-
- rod.modifyMaterialAmount(Blaze, 4);
- rod.modifyMaterialAmount(Bone, 5);
}
@NotNull
public static Material get(String name) {
var mat = BreaApi.materialManager.getMaterial(Identifier.parse(name));
- // mat could be null here due to the registrate grabbing a material that isn't in the map
+ // mat could be null here due to the registrate grabbing a oldmaterial that isn't in the map
if (mat == null) {
BreakdownCore.LOGGER.warn("{} is not a known Material", name);
- return BreaMaterials.NULL;
+ return MarkerMaterial.NULL;
}
return mat;
}
-
- // region MISC
- private static void excludeAllGems(Material material, ItemLike... items) {
- gem.setIgnored(material, items);
- excludeAllGemsButNormal(material);
- }
-
- private static void excludeAllGemsButNormal(Material material) {}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/materials/material/ElementMaterials.java b/src/main/java/net/phasetranscrystal/breacore/data/materials/material/ElementMaterials.java
index 043dae5..6820b5e 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/materials/material/ElementMaterials.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/materials/material/ElementMaterials.java
@@ -1,870 +1,858 @@
package net.phasetranscrystal.breacore.data.materials.material;
-import net.phasetranscrystal.brealib.BreaLib;
-
-import net.phasetranscrystal.breacore.api.fluid.FluidRegisterBuilder;
-import net.phasetranscrystal.breacore.api.fluid.FluidState;
-import net.phasetranscrystal.breacore.api.fluid.attribute.FluidAttributes;
-import net.phasetranscrystal.breacore.api.fluid.store.FluidStorageKeys;
-import net.phasetranscrystal.breacore.api.material.property.PropertyKey;
-import net.phasetranscrystal.breacore.api.material.registry.MaterialBuilder;
-
-import static net.phasetranscrystal.breacore.api.material.info.MaterialFlags.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaElements.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaMaterialIconSet.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaMaterials.*;
-
public class ElementMaterials {
public static void register() {
- Actinium = new MaterialBuilder(BreaLib.id("actinium"))
- .color(0xC3D1FF).secondaryColor(0x397090).iconSet(DULL)
- .element(Ac)
- .buildAndRegister();
-
- Aluminium = new MaterialBuilder(BreaLib.id("aluminium"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(933))
- .ore()
- .color(0x7db9d8).secondaryColor(0x756ac9c)
- .appendFlags(EXT2_METAL, GENERATE_GEAR, GENERATE_SMALL_GEAR, GENERATE_RING, GENERATE_FRAME,
- GENERATE_SPRING, GENERATE_SPRING_SMALL, GENERATE_FINE_WIRE)
- .element(Al)
- .blast(1700)
- .buildAndRegister();
-
- Americium = new MaterialBuilder(BreaLib.id("americium"))
- .ingot(3)
- .liquid(new FluidRegisterBuilder().temperature(1449))
- .plasma()
- .color(0x287869).iconSet(DULL)
- .appendFlags(EXT_METAL, GENERATE_FOIL, GENERATE_FINE_WIRE)
- .element(Am)
- .buildAndRegister();
-
- Antimony = new MaterialBuilder(BreaLib.id("antimony"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(904))
- .color(0xeaeaff).secondaryColor(0x8181bd).iconSet(DULL)
- .flags(MORTAR_GRINDABLE)
- .element(Sb)
- .buildAndRegister();
-
- Argon = new MaterialBuilder(BreaLib.id("argon"))
- .gas().plasma()
- .color(0x00FF00)
- .element(Ar)
- .buildAndRegister();
-
- Arsenic = new MaterialBuilder(BreaLib.id("arsenic"))
- .dust()
- .gas(new FluidRegisterBuilder()
- .state(FluidState.GAS)
- .temperature(887))
- .color(0x9c9c8d).secondaryColor(0x676756)
- .element(As)
- .buildAndRegister();
-
- Astatine = new MaterialBuilder(BreaLib.id("astatine"))
- .color(0x65204f).secondaryColor(0x17212b)
- .element(At)
- .buildAndRegister();
-
- Barium = new MaterialBuilder(BreaLib.id("barium"))
- .dust()
- .color(0xede192).secondaryColor(0xa7ad4d).iconSet(DULL)
- .element(Ba)
- .buildAndRegister();
-
- Berkelium = new MaterialBuilder(BreaLib.id("berkelium"))
- .color(0x645A88).iconSet(DULL)
- .element(Bk)
- .buildAndRegister();
-
- Beryllium = new MaterialBuilder(BreaLib.id("beryllium"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(1560))
- .ore()
- .color(0x73d73d).secondaryColor(0x184537).iconSet(DULL)
- .appendFlags(STD_METAL)
- .element(Be)
- .buildAndRegister();
-
- Bismuth = new MaterialBuilder(BreaLib.id("bismuth"))
- .ingot(1)
- .liquid(new FluidRegisterBuilder().temperature(545))
- .color(0x5fdddd).secondaryColor(0x517385).iconSet(DULL)
- .element(Bi)
- .buildAndRegister();
-
- Bohrium = new MaterialBuilder(BreaLib.id("bohrium"))
- .color(0xde67ff).secondaryColor(0xDC57FF).iconSet(DULL)
- .element(Bh)
- .buildAndRegister();
-
- Boron = new MaterialBuilder(BreaLib.id("boron"))
- .dust()
- .color(0xbffdbf).secondaryColor(0x6d7058)
- .element(B)
- .buildAndRegister();
-
- Bromine = new MaterialBuilder(BreaLib.id("bromine"))
- .liquid(new FluidRegisterBuilder().attribute(FluidAttributes.ACID))
- .color(0x912200).secondaryColor(0x080101).iconSet(DULL)
- .element(Br)
- .buildAndRegister();
-
- Caesium = new MaterialBuilder(BreaLib.id("caesium"))
- .dust()
- .color(0xd1821c).secondaryColor(0x231f14).iconSet(DULL)
- .element(Cs)
- .buildAndRegister();
-
- Calcium = new MaterialBuilder(BreaLib.id("calcium"))
- .dust()
- .color(0xFFF5DE).secondaryColor(0xa4a4a4).iconSet(DULL)
- .element(Ca)
- .buildAndRegister();
-
- Californium = new MaterialBuilder(BreaLib.id("californium"))
- .color(0xA85A12).iconSet(DULL)
- .element(Cf)
- .buildAndRegister();
-
- Carbon = new MaterialBuilder(BreaLib.id("carbon"))
- .dust()
- .liquid(new FluidRegisterBuilder().temperature(4600))
- .color(0x333030).secondaryColor(0x221c1c)
- .element(C)
- .buildAndRegister();
-
- Cadmium = new MaterialBuilder(BreaLib.id("cadmium"))
- .dust()
- .color(0x636377).secondaryColor(0x431a34).iconSet(DULL)
- .element(Cd)
- .buildAndRegister();
-
- Cerium = new MaterialBuilder(BreaLib.id("cerium"))
- .dust()
- .liquid(new FluidRegisterBuilder().temperature(1068))
- .color(0x87917D).secondaryColor(0x5e6458).iconSet(DULL)
- .element(Ce)
- .buildAndRegister();
-
- Chlorine = new MaterialBuilder(BreaLib.id("chlorine"))
- .gas(new FluidRegisterBuilder().state(FluidState.GAS).customStill())
- .element(Cl)
- // TODO hazard
- .buildAndRegister();
-
- Chromium = new MaterialBuilder(BreaLib.id("chromium"))
- .ingot(3)
- .liquid(new FluidRegisterBuilder().temperature(2180))
- .color(0xf3e0ea).secondaryColor(0x441f2e).iconSet(DULL)
- .appendFlags(EXT_METAL, GENERATE_ROTOR)
- .element(Cr)
- .blast(1700)
- .buildAndRegister();
-
- Cobalt = new MaterialBuilder(BreaLib.id("cobalt"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(1768))
- .ore() // leave for TiCon ore processing
- .color(0x5050FA).secondaryColor(0x2d2d7a).iconSet(DULL)
- .appendFlags(EXT_METAL, GENERATE_FINE_WIRE)
- .element(Co)
- .buildAndRegister();
-
- Copernicium = new MaterialBuilder(BreaLib.id("copernicium"))
- .color(0x565c5d).secondaryColor(0xffd34b).iconSet(DULL)
- .element(Cn)
- // .radioactiveHazard(1)
- .buildAndRegister();
-
- Copper = new MaterialBuilder(BreaLib.id("copper"))
- .ingot(1)
- .liquid(new FluidRegisterBuilder().temperature(1358))
- .ore()
- .color(0xe77c56).secondaryColor(0xe4673e).iconSet(DULL)
- .appendFlags(EXT_METAL, MORTAR_GRINDABLE, GENERATE_SPRING, GENERATE_SPRING_SMALL, GENERATE_RING,
- GENERATE_FINE_WIRE, GENERATE_ROTOR)
- .element(Cu)
- .buildAndRegister();
-
- Curium = new MaterialBuilder(BreaLib.id("curium"))
- .color(0x7B544E).iconSet(DULL)
- .element(Cm)
- // .radioactiveHazard(1)
- .buildAndRegister();
-
- Darmstadtium = new MaterialBuilder(BreaLib.id("darmstadtium"))
- .ingot().fluid()
- .color(0x578062).iconSet(DULL)
- .appendFlags(EXT2_METAL, GENERATE_ROTOR, GENERATE_DENSE, GENERATE_SMALL_GEAR)
- .element(Ds)
- .buildAndRegister();
-
- Deuterium = new MaterialBuilder(BreaLib.id("deuterium"))
- .gas(new FluidRegisterBuilder().state(FluidState.GAS).customStill())
- .element(D)
- .buildAndRegister();
-
- Dubnium = new MaterialBuilder(BreaLib.id("dubnium"))
- .color(0xc7ddde).secondaryColor(0x00f3ff).iconSet(DULL)
- .element(Db)
- .buildAndRegister();
-
- Dysprosium = new MaterialBuilder(BreaLib.id("dysprosium"))
- .color(0x6a664b).secondaryColor(0x423307)
- .iconSet(DULL)
- .element(Dy)
- .buildAndRegister();
-
- Einsteinium = new MaterialBuilder(BreaLib.id("einsteinium"))
- .color(0xCE9F00).iconSet(DULL)
- .element(Es)
- .buildAndRegister();
-
- Erbium = new MaterialBuilder(BreaLib.id("erbium"))
- .color(0xeccbdb).secondaryColor(0x5d625a)
- .iconSet(DULL)
- .element(Er)
- .buildAndRegister();
-
- Europium = new MaterialBuilder(BreaLib.id("europium"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(1099))
- .color(0x20FFFF).secondaryColor(0x429393).iconSet(DULL)
- .appendFlags(STD_METAL, GENERATE_LONG_ROD, GENERATE_FINE_WIRE, GENERATE_SPRING, GENERATE_FOIL,
- GENERATE_FRAME)
- .element(Eu)
- .blast(b -> b.temp(6000))
- .buildAndRegister();
-
- Fermium = new MaterialBuilder(BreaLib.id("fermium"))
- .color(0xc99fe7).secondaryColor(0x890085).iconSet(DULL)
- .element(Fm)
- // .radioactiveHazard(1)
- .buildAndRegister();
-
- Flerovium = new MaterialBuilder(BreaLib.id("flerovium"))
- .color(0x2a384e).secondaryColor(0xd2ff00)
- .iconSet(DULL)
- .element(Fl)
- .buildAndRegister();
-
- Fluorine = new MaterialBuilder(BreaLib.id("fluorine"))
- .gas(new FluidRegisterBuilder().state(FluidState.GAS).customStill())
- .element(F)
- .buildAndRegister();
-
- Francium = new MaterialBuilder(BreaLib.id("francium"))
- .color(0xAAAAAA).secondaryColor(0x0000ff).iconSet(DULL)
- .element(Fr)
- .buildAndRegister();
-
- Gadolinium = new MaterialBuilder(BreaLib.id("gadolinium"))
- .color(0x828a7a).secondaryColor(0x363420).iconSet(DULL)
- .element(Gd)
- .buildAndRegister();
-
- Gallium = new MaterialBuilder(BreaLib.id("gallium"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(303))
- .color(0x7a84ca).secondaryColor(0x13132e).iconSet(DULL)
- .appendFlags(STD_METAL, GENERATE_FOIL)
- .element(Ga)
- .buildAndRegister();
-
- Germanium = new MaterialBuilder(BreaLib.id("germanium"))
- .color(0x4a4a4a).secondaryColor(0x2d2612).iconSet(DULL)
- .element(Ge)
- .buildAndRegister();
-
- Gold = new MaterialBuilder(BreaLib.id("gold"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(1337))
- .ore()
- .color(0xfdf55f).secondaryColor(0xf25833).iconSet(DULL)
- .appendFlags(EXT2_METAL, GENERATE_RING, MORTAR_GRINDABLE, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES,
- GENERATE_SPRING, GENERATE_SPRING_SMALL, GENERATE_FINE_WIRE, GENERATE_FOIL)
- .element(Au)
- .buildAndRegister();
-
- Hafnium = new MaterialBuilder(BreaLib.id("hafnium"))
- .color(0x99999A).secondaryColor(0x2b4a3a).iconSet(DULL)
- .element(Hf)
- .buildAndRegister();
-
- Hassium = new MaterialBuilder(BreaLib.id("hassium"))
- .color(0x738786).secondaryColor(0x62ffd5)
- .iconSet(DULL)
- .element(Hs)
- .buildAndRegister();
-
- Holmium = new MaterialBuilder(BreaLib.id("holmium"))
- .color(0xf6fc9c).secondaryColor(0xa3a3a3)
- .iconSet(DULL)
- .element(Ho)
- .buildAndRegister();
-
- Hydrogen = new MaterialBuilder(BreaLib.id("hydrogen"))
- .gas()
- .color(0x0000B5)
- .element(H)
- .buildAndRegister();
-
- Helium = new MaterialBuilder(BreaLib.id("helium"))
- .gas(new FluidRegisterBuilder().state(FluidState.GAS).customStill())
- .plasma()
- .liquid(new FluidRegisterBuilder()
- .temperature(4)
- .color(0xFCFF90)
- .name("liquid_helium")
- .translation("gtceu.fluid.liquid_generic"))
- .element(He)
- .buildAndRegister();
- Helium.getProperty(PropertyKey.FLUID).setPrimaryKey(FluidStorageKeys.GAS);
-
- Helium3 = new MaterialBuilder(BreaLib.id("helium_3"))
- .gas(new FluidRegisterBuilder()
- .customStill()
- .translation("gtceu.fluid.generic"))
- .element(He3)
- .buildAndRegister();
-
- Indium = new MaterialBuilder(BreaLib.id("indium"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(430))
- .color(0x5c3588).secondaryColor(0x2b0b4a).iconSet(DULL)
- .element(In)
- .buildAndRegister();
-
- Iodine = new MaterialBuilder(BreaLib.id("iodine"))
- .dust()
- .color(0x3e4467).secondaryColor(0x021e40).iconSet(DULL)
- .element(I)
- .buildAndRegister();
-
- Iridium = new MaterialBuilder(BreaLib.id("iridium"))
- .ingot(3)
- .liquid(new FluidRegisterBuilder().temperature(2719))
- .color(0x99fede).secondaryColor(0x6cd1cf).iconSet(DULL)
- .appendFlags(EXT2_METAL, GENERATE_FINE_WIRE, GENERATE_GEAR, GENERATE_FRAME)
- .element(Ir)
- .blast(b -> b.temp(4500))
- .buildAndRegister();
-
- Iron = new MaterialBuilder(BreaLib.id("iron"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(1811))
- .plasma()
- .ore()
- .color(0xeeeeee).secondaryColor(0x979797).iconSet(DULL)
- .appendFlags(EXT2_METAL, MORTAR_GRINDABLE, GENERATE_ROTOR, GENERATE_SMALL_GEAR, GENERATE_GEAR,
- GENERATE_SPRING_SMALL, GENERATE_SPRING, GENERATE_ROUND, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES,
- BLAST_FURNACE_CALCITE_TRIPLE)
- .element(Fe)
- .buildAndRegister();
-
- Krypton = new MaterialBuilder(BreaLib.id("krypton"))
- .gas(new FluidRegisterBuilder()
- .customStill()
- .translation("gtceu.fluid.generic"))
- .color(0x80FF80)
- .element(Kr)
- .buildAndRegister();
-
- Lanthanum = new MaterialBuilder(BreaLib.id("lanthanum"))
- .dust()
- .liquid(new FluidRegisterBuilder().temperature(1193))
- .color(0xd17d50).secondaryColor(0x4a3560).iconSet(DULL)
- .element(La)
- .buildAndRegister();
-
- Lawrencium = new MaterialBuilder(BreaLib.id("lawrencium"))
- .color(0x5D7575)
- .iconSet(DULL)
- .element(Lr)
- .buildAndRegister();
-
- Lead = new MaterialBuilder(BreaLib.id("lead"))
- .ingot(1)
- .liquid(new FluidRegisterBuilder().temperature(600))
- .ore()
- .color(0x7e6f82).secondaryColor(0x290633)
- .appendFlags(EXT2_METAL, MORTAR_GRINDABLE, GENERATE_ROTOR, GENERATE_SPRING, GENERATE_SPRING_SMALL,
- GENERATE_FINE_WIRE)
- .element(Pb)
- .buildAndRegister();
-
- Lithium = new MaterialBuilder(BreaLib.id("lithium"))
- .dust()
- .liquid(new FluidRegisterBuilder().temperature(454))
- .ore()
- .color(0xd7e7ee).secondaryColor(0xBDC7DB)
- .element(Li)
- .buildAndRegister();
-
- Livermorium = new MaterialBuilder(BreaLib.id("livermorium"))
- .color(0x939393).secondaryColor(0xff5e5e).iconSet(DULL)
- .element(Lv)
- .buildAndRegister();
-
- Lutetium = new MaterialBuilder(BreaLib.id("lutetium"))
- .dust()
- .liquid(new FluidRegisterBuilder().temperature(1925))
- .color(0x00ccff).secondaryColor(0x4c687a).iconSet(DULL)
- .element(Lu)
- .buildAndRegister();
-
- Magnesium = new MaterialBuilder(BreaLib.id("magnesium"))
- .dust()
- .liquid(new FluidRegisterBuilder().temperature(923))
- .color(0xd6e3ff).secondaryColor(0x594d19).iconSet(DULL)
- .element(Mg)
- .buildAndRegister();
-
- Mendelevium = new MaterialBuilder(BreaLib.id("mendelevium"))
- .color(0x1D4ACF).iconSet(DULL)
- .element(Md)
- .buildAndRegister();
-
- Manganese = new MaterialBuilder(BreaLib.id("manganese"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(1519))
- .color(0x88a669).secondaryColor(0xCDE1B9)
- .appendFlags(STD_METAL, GENERATE_FOIL, GENERATE_BOLT_SCREW)
- .element(Mn)
- .buildAndRegister();
-
- Meitnerium = new MaterialBuilder(BreaLib.id("meitnerium"))
- .color(0x4f3c82).secondaryColor(0x6e90ff).iconSet(DULL)
- .element(Mt)
- .buildAndRegister();
-
- Mercury = new MaterialBuilder(BreaLib.id("mercury"))
- .fluid()
- .color(0xE6DCDC).iconSet(DULL)
- .element(Hg)
- .buildAndRegister();
-
- Molybdenum = new MaterialBuilder(BreaLib.id("molybdenum"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(2896))
- .ore()
- .color(0xc1c1ce).secondaryColor(0x404068).iconSet(DULL)
- .element(Mo)
- .flags(GENERATE_FOIL, GENERATE_BOLT_SCREW)
- .buildAndRegister();
-
- Moscovium = new MaterialBuilder(BreaLib.id("moscovium"))
- .color(0x2a1b40).secondaryColor(0xbd91ff).iconSet(DULL)
- .element(Mc)
- .buildAndRegister();
-
- Neodymium = new MaterialBuilder(BreaLib.id("neodymium"))
- .ingot().fluid().ore()
- .color(0x6c5863).secondaryColor(0x2c1919).iconSet(DULL)
- .appendFlags(STD_METAL, GENERATE_ROD, GENERATE_BOLT_SCREW)
- .element(Nd)
- .blast(1297)
- .buildAndRegister();
-
- Neon = new MaterialBuilder(BreaLib.id("neon"))
- .gas()
- .color(0xFAB4B4)
- .element(Ne)
- .buildAndRegister();
-
- Neptunium = new MaterialBuilder(BreaLib.id("neptunium"))
- .color(0x284D7B).iconSet(DULL)
- .element(Np)
- // .radioactiveHazard(1)
- .buildAndRegister();
-
- Nickel = new MaterialBuilder(BreaLib.id("nickel"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(1728))
- .plasma()
- .ore()
- .color(0xccdff5).secondaryColor(0x59563a).iconSet(DULL)
- .appendFlags(STD_METAL, MORTAR_GRINDABLE)
- .element(Ni)
- .buildAndRegister();
-
- Nihonium = new MaterialBuilder(BreaLib.id("nihonium"))
- .color(0x323957).secondaryColor(0xbfabff).iconSet(DULL)
- .element(Nh)
- .buildAndRegister();
-
- Niobium = new MaterialBuilder(BreaLib.id("niobium"))
- .ingot().fluid()
- .color(0xb494b4).secondaryColor(0x4b3f4d).iconSet(DULL)
- .element(Nb)
- .blast(b -> b.temp(2750))
- .buildAndRegister();
-
- Nitrogen = new MaterialBuilder(BreaLib.id("nitrogen"))
- .gas().plasma()
- .color(0x00BFC1)
- .element(N)
- .buildAndRegister();
-
- Nobelium = new MaterialBuilder(BreaLib.id("nobelium"))
- .color(0x3e4758).secondaryColor(0x43deff)
- .iconSet(DULL)
- .element(No)
- .buildAndRegister();
-
- Oganesson = new MaterialBuilder(BreaLib.id("oganesson"))
- .color(0x443936).secondaryColor(0xff1dbd).iconSet(DULL)
- .element(Og)
- .buildAndRegister();
-
- Osmium = new MaterialBuilder(BreaLib.id("osmium"))
- .ingot(4)
- .liquid(new FluidRegisterBuilder().temperature(3306))
- .color(0x54afff).secondaryColor(0x6e6eff).iconSet(DULL)
- .appendFlags(EXT2_METAL, GENERATE_FOIL)
- .element(Os)
- .blast(b -> b.temp(4500))
- .buildAndRegister();
-
- Oxygen = new MaterialBuilder(BreaLib.id("oxygen"))
- .gas()
- .liquid(new FluidRegisterBuilder()
- .temperature(85)
- .color(0x6688DD)
- .name("liquid_oxygen")
- .translation("gtceu.fluid.liquid_generic"))
- .plasma()
- .color(0x4CC3FF)
- .element(O)
- .buildAndRegister();
- Oxygen.getProperty(PropertyKey.FLUID).setPrimaryKey(FluidStorageKeys.GAS);
-
- Palladium = new MaterialBuilder(BreaLib.id("palladium"))
- .ingot().fluid().ore()
- .color(0xbd92b5).secondaryColor(0x535b14).iconSet(DULL)
- .appendFlags(EXT_METAL, GENERATE_FOIL, GENERATE_FINE_WIRE)
- .element(Pd)
- .blast(b -> b.temp(1828))
- .buildAndRegister();
-
- Phosphorus = new MaterialBuilder(BreaLib.id("phosphorus"))
- .dust()
- .color(0x77332c).secondaryColor(0x220202)
- .element(P)
- .buildAndRegister();
-
- Polonium = new MaterialBuilder(BreaLib.id("polonium"))
- .color(0x163b27).secondaryColor(0x00ff78)
- .iconSet(DULL)
- .element(Po)
- // .radioactiveHazard(1)
- .buildAndRegister();
-
- Platinum = new MaterialBuilder(BreaLib.id("platinum"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(2041))
- .ore()
- .color(0xfff4ba).secondaryColor(0x8d8d71).iconSet(DULL)
- .appendFlags(EXT2_METAL, GENERATE_FOIL, GENERATE_FINE_WIRE, GENERATE_RING, GENERATE_SPRING_SMALL,
- GENERATE_SPRING)
- .element(Pt)
- .buildAndRegister();
-
- Plutonium239 = new MaterialBuilder(BreaLib.id("plutonium_239"))
- .ingot(3)
- .liquid(new FluidRegisterBuilder().temperature(913))
- .ore(true)
- .color(0xba2727).secondaryColor(0x222730).iconSet(DULL)
- .element(Pu239)
- .buildAndRegister();
-
- Plutonium241 = new MaterialBuilder(BreaLib.id("plutonium_241"))
- .ingot(3)
- .liquid(new FluidRegisterBuilder().temperature(913))
- .color(0xff4c4c).secondaryColor(0x222730).iconSet(DULL)
- .appendFlags(EXT_METAL)
- .element(Pu241)
- .buildAndRegister();
-
- Potassium = new MaterialBuilder(BreaLib.id("potassium"))
- .dust(1)
- .liquid(new FluidRegisterBuilder().temperature(337))
- .color(0xd2e1f2).secondaryColor(0x6189b8).iconSet(DULL)
- .element(K)
- .buildAndRegister();
-
- Praseodymium = new MaterialBuilder(BreaLib.id("praseodymium"))
- .color(0x718060).secondaryColor(0x3f3447).iconSet(DULL)
- .element(Pr)
- .buildAndRegister();
-
- Promethium = new MaterialBuilder(BreaLib.id("promethium"))
- .color(0x814947).secondaryColor(0xd0ff71)
- .iconSet(DULL)
- .element(Pm)
- // .radioactiveHazard(1)
- .buildAndRegister();
-
- Protactinium = new MaterialBuilder(BreaLib.id("protactinium"))
- .color(0xA78B6D).iconSet(DULL)
- .element(Pa)
- // .radioactiveHazard(1)
- .buildAndRegister();
-
- Radon = new MaterialBuilder(BreaLib.id("radon"))
- .gas()
- .color(0xFF39FF)
- .element(Rn)
- .buildAndRegister();
-
- Radium = new MaterialBuilder(BreaLib.id("radium"))
- .color(0x838361).secondaryColor(0x89ff21).iconSet(DULL)
- .element(Ra)
- // .radioactiveHazard(1)
- .buildAndRegister();
-
- Rhenium = new MaterialBuilder(BreaLib.id("rhenium"))
- .color(0xcbcfd7).secondaryColor(0x37393d).iconSet(DULL)
- .element(Re)
- .buildAndRegister();
-
- Rhodium = new MaterialBuilder(BreaLib.id("rhodium"))
- .ingot().fluid()
- .color(0xfd46b1).secondaryColor(0xDC0C58).iconSet(DULL)
- .appendFlags(EXT2_METAL, GENERATE_GEAR, GENERATE_FINE_WIRE)
- .element(Rh)
- .blast(b -> b.temp(2237))
- .buildAndRegister();
-
- Roentgenium = new MaterialBuilder(BreaLib.id("roentgenium"))
- .color(0x388c48).secondaryColor(0x198a92).iconSet(DULL)
- .element(Rg)
- .buildAndRegister();
-
- Rubidium = new MaterialBuilder(BreaLib.id("rubidium"))
- .color(0xde0f0f).secondaryColor(0x3a1f1f).iconSet(DULL)
- .element(Rb)
- .buildAndRegister();
-
- Ruthenium = new MaterialBuilder(BreaLib.id("ruthenium"))
- .ingot().fluid()
- .color(0xa2cde0).secondaryColor(0x3c7285).iconSet(DULL)
- .flags(GENERATE_FOIL, GENERATE_GEAR)
- .element(Ru)
- .blast(b -> b.temp(2607))
- .buildAndRegister();
-
- Rutherfordium = new MaterialBuilder(BreaLib.id("rutherfordium"))
- .color(0x6b6157).secondaryColor(0xFFF6A1).iconSet(DULL)
- .element(Rf)
- .buildAndRegister();
-
- Samarium = new MaterialBuilder(BreaLib.id("samarium"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(1345))
- .color(0xc2c289).secondaryColor(0x235254).iconSet(DULL)
- .flags(GENERATE_LONG_ROD)
- .element(Sm)
- .blast(b -> b.temp(5400))
- .buildAndRegister();
-
- Scandium = new MaterialBuilder(BreaLib.id("scandium"))
- .color(0xb1b2ac).secondaryColor(0x1c3433)
- .iconSet(DULL)
- .element(Sc)
- .buildAndRegister();
-
- Seaborgium = new MaterialBuilder(BreaLib.id("seaborgium"))
- .color(0x19C5FF).secondaryColor(0xff19b2).iconSet(DULL)
- .element(Sg)
- .buildAndRegister();
-
- Selenium = new MaterialBuilder(BreaLib.id("selenium"))
- .color(0xffdf77).secondaryColor(0x055d28).iconSet(DULL)
- .element(Se)
- .buildAndRegister();
-
- Silicon = new MaterialBuilder(BreaLib.id("silicon"))
- .ingot().fluid()
- .color(0x707078).secondaryColor(0x10293b).iconSet(DULL)
- .flags(GENERATE_FOIL)
- .element(Si)
- .blast(2273) // no gas tier for silicon
- .buildAndRegister();
-
- Silver = new MaterialBuilder(BreaLib.id("silver"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(1235))
- .ore()
- .color(0xDCDCFF).secondaryColor(0x5a4705).iconSet(DULL)
- .appendFlags(EXT2_METAL, MORTAR_GRINDABLE, GENERATE_FINE_WIRE, GENERATE_RING)
- .element(Ag)
- .buildAndRegister();
-
- Sodium = new MaterialBuilder(BreaLib.id("sodium"))
- .dust()
- .color(0x7c80ff).secondaryColor(0x2b30a3).iconSet(DULL)
- .element(Na)
- .buildAndRegister();
-
- Strontium = new MaterialBuilder(BreaLib.id("strontium"))
- .color(0x7a7953).secondaryColor(0x4c0b06).iconSet(DULL)
- .element(Sr)
- .buildAndRegister();
-
- Sulfur = new MaterialBuilder(BreaLib.id("sulfur"))
- .dust().ore()
- .color(0xfdff31).secondaryColor(0xffb400)
- .flags(FLAMMABLE)
- .element(S)
- .buildAndRegister();
-
- Tantalum = new MaterialBuilder(BreaLib.id("tantalum"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(3290))
- .color(0xa8a7c6).secondaryColor(0x1f2b20).iconSet(DULL)
- .appendFlags(STD_METAL, GENERATE_FOIL, GENERATE_FINE_WIRE)
- .element(Ta)
- .buildAndRegister();
-
- Technetium = new MaterialBuilder(BreaLib.id("technetium"))
- .color(0x7430e1).secondaryColor(0x7430e1).iconSet(DULL)
- .element(Tc)
- // .radioactiveHazard(1)
- .buildAndRegister();
-
- Tellurium = new MaterialBuilder(BreaLib.id("tellurium"))
- .color(0x8fea66).secondaryColor(0x00bfff)
- .iconSet(DULL)
- .element(Te)
- .buildAndRegister();
-
- Tennessine = new MaterialBuilder(BreaLib.id("tennessine"))
- .color(0x785cc4).secondaryColor(0x7959d4).iconSet(DULL)
- .element(Ts)
- .buildAndRegister();
-
- Terbium = new MaterialBuilder(BreaLib.id("terbium"))
- .color(0xcedab4).secondaryColor(0x263640)
- .iconSet(DULL)
- .element(Tb)
- .buildAndRegister();
-
- Thorium = new MaterialBuilder(BreaLib.id("thorium"))
- .ingot()
- .liquid(new FluidRegisterBuilder().temperature(2023))
- .ore()
- .color(0x25411b).secondaryColor(0x051E05).iconSet(DULL)
- .appendFlags(STD_METAL, GENERATE_ROD)
- .element(Th)
- .buildAndRegister();
-
- Thallium = new MaterialBuilder(BreaLib.id("thallium"))
- .color(0x5d6b8e).secondaryColor(0x815b63).iconSet(DULL)
- .element(Tl)
- // .poison(PoisonProperty.PoisonType.CONTACT)
- .buildAndRegister();
-
- Thulium = new MaterialBuilder(BreaLib.id("thulium"))
- .color(0x467681).secondaryColor(0x682c2c)
- .iconSet(DULL)
- .element(Tm)
- .buildAndRegister();
-
- Tin = new MaterialBuilder(BreaLib.id("tin"))
- .ingot(1)
- .liquid(new FluidRegisterBuilder().temperature(505))
- .plasma()
- .ore()
- .color(0xfafeff).secondaryColor(0x4e676c)
- .appendFlags(EXT2_METAL, MORTAR_GRINDABLE, GENERATE_ROTOR, GENERATE_SPRING, GENERATE_SPRING_SMALL,
- GENERATE_FINE_WIRE)
- .element(Sn)
- .buildAndRegister();
-
- Titanium = new MaterialBuilder(BreaLib.id("titanium")) // todo Ore? Look at EBF recipe here if we do Ti
- // ores
- .ingot(3).fluid()
- .color(0xed8eea).secondaryColor(0xff64bc).iconSet(DULL)
- .appendFlags(EXT2_METAL, GENERATE_ROTOR, GENERATE_SMALL_GEAR, GENERATE_GEAR, GENERATE_FRAME)
- .element(Ti)
- .blast(b -> b.temp(1941))
- .buildAndRegister();
-
- Tritium = new MaterialBuilder(BreaLib.id("tritium"))
- .gas(new FluidRegisterBuilder().state(FluidState.GAS).customStill())
- .color(0xff316b).secondaryColor(0xd00000)
- .iconSet(DULL)
- .element(T)
- .buildAndRegister();
-
- Tungsten = new MaterialBuilder(BreaLib.id("tungsten"))
- .ingot(3)
- .liquid(new FluidRegisterBuilder().temperature(3695))
- .color(0x3b3a32).secondaryColor(0x2a2800).iconSet(DULL)
- .appendFlags(EXT2_METAL, GENERATE_SPRING, GENERATE_SPRING_SMALL, GENERATE_FOIL, GENERATE_GEAR,
- GENERATE_FRAME)
- .element(W)
- .blast(b -> b.temp(3600))
- .buildAndRegister();
-
- Uranium238 = new MaterialBuilder(BreaLib.id("uranium_238"))
- .ingot(3)
- .liquid(new FluidRegisterBuilder().temperature(1405))
- .color(0x1d891d).secondaryColor(0x33342c).iconSet(DULL)
- .appendFlags(EXT_METAL)
- .element(U238)
- .buildAndRegister();
-
- Uranium235 = new MaterialBuilder(BreaLib.id("uranium_235"))
- .ingot(3)
- .liquid(new FluidRegisterBuilder().temperature(1405))
- .color(0x46FA46).secondaryColor(0x33342c).iconSet(DULL)
- .appendFlags(EXT_METAL)
- .element(U235)
- .buildAndRegister();
-
- Vanadium = new MaterialBuilder(BreaLib.id("vanadium"))
- .ingot().fluid()
- .color(0x696d76).secondaryColor(0x240808).iconSet(DULL)
- .element(V)
- .blast(2183)
- .buildAndRegister();
-
- Xenon = new MaterialBuilder(BreaLib.id("xenon"))
- .gas()
- .color(0x00FFFF)
- .element(Xe)
- .buildAndRegister();
-
- Ytterbium = new MaterialBuilder(BreaLib.id("ytterbium"))
- .color(0xA7A7A7).iconSet(DULL)
- .element(Yb)
- .buildAndRegister();
-
- Yttrium = new MaterialBuilder(BreaLib.id("yttrium"))
- .ingot().fluid()
- .color(0x7d8072).secondaryColor(0x15161a).iconSet(DULL)
- .element(Y)
- .blast(1799)
- .buildAndRegister();
-
- Zinc = new MaterialBuilder(BreaLib.id("zinc"))
- .ingot(1)
- .liquid(new FluidRegisterBuilder().temperature(693))
- .color(0xEBEBFA).secondaryColor(0x232c30).iconSet(DULL)
- .appendFlags(STD_METAL, MORTAR_GRINDABLE, GENERATE_FOIL, GENERATE_RING, GENERATE_FINE_WIRE)
- .element(Zn)
- .buildAndRegister();
-
- Zirconium = new MaterialBuilder(BreaLib.id("zirconium"))
- .color(0xb99b7e).secondaryColor(0x271813).iconSet(DULL)
- .element(Zr)
- .buildAndRegister();
+ /*
+ * Actinium = new MaterialBuilder(BreaLib.id("actinium"))
+ * .color(0xC3D1FF).secondaryColor(0x397090).iconSet(DULL)
+ * .element(Ac)
+ * .buildAndRegister();
+ *
+ * Aluminium = new MaterialBuilder(BreaLib.id("aluminium"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(933))
+ * .ore()
+ * .color(0x7db9d8).secondaryColor(0x756ac9c)
+ * .appendFlags(EXT2_METAL, GENERATE_GEAR, GENERATE_SMALL_GEAR, GENERATE_RING, GENERATE_FRAME,
+ * GENERATE_SPRING, GENERATE_SPRING_SMALL, GENERATE_FINE_WIRE)
+ * .element(Al)
+ * .blast(1700)
+ * .buildAndRegister();
+ *
+ * Americium = new MaterialBuilder(BreaLib.id("americium"))
+ * .ingot(3)
+ * .liquid(new FluidRegisterBuilder().temperature(1449))
+ * .plasma()
+ * .color(0x287869).iconSet(DULL)
+ * .appendFlags(EXT_METAL, GENERATE_FOIL, GENERATE_FINE_WIRE)
+ * .element(Am)
+ * .buildAndRegister();
+ *
+ * Antimony = new MaterialBuilder(BreaLib.id("antimony"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(904))
+ * .color(0xeaeaff).secondaryColor(0x8181bd).iconSet(DULL)
+ * .flags(MORTAR_GRINDABLE)
+ * .element(Sb)
+ * .buildAndRegister();
+ *
+ * Argon = new MaterialBuilder(BreaLib.id("argon"))
+ * .gas().plasma()
+ * .color(0x00FF00)
+ * .element(Ar)
+ * .buildAndRegister();
+ *
+ * Arsenic = new MaterialBuilder(BreaLib.id("arsenic"))
+ * .dust()
+ * .gas(new FluidRegisterBuilder()
+ * .state(FluidState.GAS)
+ * .temperature(887))
+ * .color(0x9c9c8d).secondaryColor(0x676756)
+ * .element(As)
+ * .buildAndRegister();
+ *
+ * Astatine = new MaterialBuilder(BreaLib.id("astatine"))
+ * .color(0x65204f).secondaryColor(0x17212b)
+ * .element(At)
+ * .buildAndRegister();
+ *
+ * Barium = new MaterialBuilder(BreaLib.id("barium"))
+ * .dust()
+ * .color(0xede192).secondaryColor(0xa7ad4d).iconSet(DULL)
+ * .element(Ba)
+ * .buildAndRegister();
+ *
+ * Berkelium = new MaterialBuilder(BreaLib.id("berkelium"))
+ * .color(0x645A88).iconSet(DULL)
+ * .element(Bk)
+ * .buildAndRegister();
+ *
+ * Beryllium = new MaterialBuilder(BreaLib.id("beryllium"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(1560))
+ * .ore()
+ * .color(0x73d73d).secondaryColor(0x184537).iconSet(DULL)
+ * .appendFlags(STD_METAL)
+ * .element(Be)
+ * .buildAndRegister();
+ *
+ * Bismuth = new MaterialBuilder(BreaLib.id("bismuth"))
+ * .ingot(1)
+ * .liquid(new FluidRegisterBuilder().temperature(545))
+ * .color(0x5fdddd).secondaryColor(0x517385).iconSet(DULL)
+ * .element(Bi)
+ * .buildAndRegister();
+ *
+ * Bohrium = new MaterialBuilder(BreaLib.id("bohrium"))
+ * .color(0xde67ff).secondaryColor(0xDC57FF).iconSet(DULL)
+ * .element(Bh)
+ * .buildAndRegister();
+ *
+ * Boron = new MaterialBuilder(BreaLib.id("boron"))
+ * .dust()
+ * .color(0xbffdbf).secondaryColor(0x6d7058)
+ * .element(B)
+ * .buildAndRegister();
+ *
+ * Bromine = new MaterialBuilder(BreaLib.id("bromine"))
+ * .liquid(new FluidRegisterBuilder().attribute(FluidAttributes.ACID))
+ * .color(0x912200).secondaryColor(0x080101).iconSet(DULL)
+ * .element(Br)
+ * .buildAndRegister();
+ *
+ * Caesium = new MaterialBuilder(BreaLib.id("caesium"))
+ * .dust()
+ * .color(0xd1821c).secondaryColor(0x231f14).iconSet(DULL)
+ * .element(Cs)
+ * .buildAndRegister();
+ *
+ * Calcium = new MaterialBuilder(BreaLib.id("calcium"))
+ * .dust()
+ * .color(0xFFF5DE).secondaryColor(0xa4a4a4).iconSet(DULL)
+ * .element(Ca)
+ * .buildAndRegister();
+ *
+ * Californium = new MaterialBuilder(BreaLib.id("californium"))
+ * .color(0xA85A12).iconSet(DULL)
+ * .element(Cf)
+ * .buildAndRegister();
+ *
+ * Carbon = new MaterialBuilder(BreaLib.id("carbon"))
+ * .dust()
+ * .liquid(new FluidRegisterBuilder().temperature(4600))
+ * .color(0x333030).secondaryColor(0x221c1c)
+ * .element(C)
+ * .buildAndRegister();
+ *
+ * Cadmium = new MaterialBuilder(BreaLib.id("cadmium"))
+ * .dust()
+ * .color(0x636377).secondaryColor(0x431a34).iconSet(DULL)
+ * .element(Cd)
+ * .buildAndRegister();
+ *
+ * Cerium = new MaterialBuilder(BreaLib.id("cerium"))
+ * .dust()
+ * .liquid(new FluidRegisterBuilder().temperature(1068))
+ * .color(0x87917D).secondaryColor(0x5e6458).iconSet(DULL)
+ * .element(Ce)
+ * .buildAndRegister();
+ *
+ * Chlorine = new MaterialBuilder(BreaLib.id("chlorine"))
+ * .gas(new FluidRegisterBuilder().state(FluidState.GAS).customStill())
+ * .element(Cl)
+ * // TODO hazard
+ * .buildAndRegister();
+ *
+ * Chromium = new MaterialBuilder(BreaLib.id("chromium"))
+ * .ingot(3)
+ * .liquid(new FluidRegisterBuilder().temperature(2180))
+ * .color(0xf3e0ea).secondaryColor(0x441f2e).iconSet(DULL)
+ * .appendFlags(EXT_METAL, GENERATE_ROTOR)
+ * .element(Cr)
+ * .blast(1700)
+ * .buildAndRegister();
+ *
+ * Cobalt = new MaterialBuilder(BreaLib.id("cobalt"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(1768))
+ * .ore() // leave for TiCon ore processing
+ * .color(0x5050FA).secondaryColor(0x2d2d7a).iconSet(DULL)
+ * .appendFlags(EXT_METAL, GENERATE_FINE_WIRE)
+ * .element(Co)
+ * .buildAndRegister();
+ *
+ * Copernicium = new MaterialBuilder(BreaLib.id("copernicium"))
+ * .color(0x565c5d).secondaryColor(0xffd34b).iconSet(DULL)
+ * .element(Cn)
+ * // .radioactiveHazard(1)
+ * .buildAndRegister();
+ *
+ * Copper = new MaterialBuilder(BreaLib.id("copper"))
+ * .ingot(1)
+ * .liquid(new FluidRegisterBuilder().temperature(1358))
+ * .ore()
+ * .color(0xe77c56).secondaryColor(0xe4673e).iconSet(DULL)
+ * .appendFlags(EXT_METAL, MORTAR_GRINDABLE, GENERATE_SPRING, GENERATE_SPRING_SMALL, GENERATE_RING,
+ * GENERATE_FINE_WIRE, GENERATE_ROTOR)
+ * .element(Cu)
+ * .buildAndRegister();
+ *
+ * Curium = new MaterialBuilder(BreaLib.id("curium"))
+ * .color(0x7B544E).iconSet(DULL)
+ * .element(Cm)
+ * // .radioactiveHazard(1)
+ * .buildAndRegister();
+ *
+ * Darmstadtium = new MaterialBuilder(BreaLib.id("darmstadtium"))
+ * .ingot().fluid()
+ * .color(0x578062).iconSet(DULL)
+ * .appendFlags(EXT2_METAL, GENERATE_ROTOR, GENERATE_DENSE, GENERATE_SMALL_GEAR)
+ * .element(Ds)
+ * .buildAndRegister();
+ *
+ * Deuterium = new MaterialBuilder(BreaLib.id("deuterium"))
+ * .gas(new FluidRegisterBuilder().state(FluidState.GAS).customStill())
+ * .element(D)
+ * .buildAndRegister();
+ *
+ * Dubnium = new MaterialBuilder(BreaLib.id("dubnium"))
+ * .color(0xc7ddde).secondaryColor(0x00f3ff).iconSet(DULL)
+ * .element(Db)
+ * .buildAndRegister();
+ *
+ * Dysprosium = new MaterialBuilder(BreaLib.id("dysprosium"))
+ * .color(0x6a664b).secondaryColor(0x423307)
+ * .iconSet(DULL)
+ * .element(Dy)
+ * .buildAndRegister();
+ *
+ * Einsteinium = new MaterialBuilder(BreaLib.id("einsteinium"))
+ * .color(0xCE9F00).iconSet(DULL)
+ * .element(Es)
+ * .buildAndRegister();
+ *
+ * Erbium = new MaterialBuilder(BreaLib.id("erbium"))
+ * .color(0xeccbdb).secondaryColor(0x5d625a)
+ * .iconSet(DULL)
+ * .element(Er)
+ * .buildAndRegister();
+ *
+ * Europium = new MaterialBuilder(BreaLib.id("europium"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(1099))
+ * .color(0x20FFFF).secondaryColor(0x429393).iconSet(DULL)
+ * .appendFlags(STD_METAL, GENERATE_LONG_ROD, GENERATE_FINE_WIRE, GENERATE_SPRING, GENERATE_FOIL,
+ * GENERATE_FRAME)
+ * .element(Eu)
+ * .blast(b -> b.temp(6000))
+ * .buildAndRegister();
+ *
+ * Fermium = new MaterialBuilder(BreaLib.id("fermium"))
+ * .color(0xc99fe7).secondaryColor(0x890085).iconSet(DULL)
+ * .element(Fm)
+ * // .radioactiveHazard(1)
+ * .buildAndRegister();
+ *
+ * Flerovium = new MaterialBuilder(BreaLib.id("flerovium"))
+ * .color(0x2a384e).secondaryColor(0xd2ff00)
+ * .iconSet(DULL)
+ * .element(Fl)
+ * .buildAndRegister();
+ *
+ * Fluorine = new MaterialBuilder(BreaLib.id("fluorine"))
+ * .gas(new FluidRegisterBuilder().state(FluidState.GAS).customStill())
+ * .element(F)
+ * .buildAndRegister();
+ *
+ * Francium = new MaterialBuilder(BreaLib.id("francium"))
+ * .color(0xAAAAAA).secondaryColor(0x0000ff).iconSet(DULL)
+ * .element(Fr)
+ * .buildAndRegister();
+ *
+ * Gadolinium = new MaterialBuilder(BreaLib.id("gadolinium"))
+ * .color(0x828a7a).secondaryColor(0x363420).iconSet(DULL)
+ * .element(Gd)
+ * .buildAndRegister();
+ *
+ * Gallium = new MaterialBuilder(BreaLib.id("gallium"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(303))
+ * .color(0x7a84ca).secondaryColor(0x13132e).iconSet(DULL)
+ * .appendFlags(STD_METAL, GENERATE_FOIL)
+ * .element(Ga)
+ * .buildAndRegister();
+ *
+ * Germanium = new MaterialBuilder(BreaLib.id("germanium"))
+ * .color(0x4a4a4a).secondaryColor(0x2d2612).iconSet(DULL)
+ * .element(Ge)
+ * .buildAndRegister();
+ *
+ * Gold = new MaterialBuilder(BreaLib.id("gold"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(1337))
+ * .ore()
+ * .color(0xfdf55f).secondaryColor(0xf25833).iconSet(DULL)
+ * .appendFlags(EXT2_METAL, GENERATE_RING, MORTAR_GRINDABLE, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES,
+ * GENERATE_SPRING, GENERATE_SPRING_SMALL, GENERATE_FINE_WIRE, GENERATE_FOIL)
+ * .element(Au)
+ * .buildAndRegister();
+ *
+ * Hafnium = new MaterialBuilder(BreaLib.id("hafnium"))
+ * .color(0x99999A).secondaryColor(0x2b4a3a).iconSet(DULL)
+ * .element(Hf)
+ * .buildAndRegister();
+ *
+ * Hassium = new MaterialBuilder(BreaLib.id("hassium"))
+ * .color(0x738786).secondaryColor(0x62ffd5)
+ * .iconSet(DULL)
+ * .element(Hs)
+ * .buildAndRegister();
+ *
+ * Holmium = new MaterialBuilder(BreaLib.id("holmium"))
+ * .color(0xf6fc9c).secondaryColor(0xa3a3a3)
+ * .iconSet(DULL)
+ * .element(Ho)
+ * .buildAndRegister();
+ *
+ * Hydrogen = new MaterialBuilder(BreaLib.id("hydrogen"))
+ * .gas()
+ * .color(0x0000B5)
+ * .element(H)
+ * .buildAndRegister();
+ *
+ * Helium = new MaterialBuilder(BreaLib.id("helium"))
+ * .gas(new FluidRegisterBuilder().state(FluidState.GAS).customStill())
+ * .plasma()
+ * .liquid(new FluidRegisterBuilder()
+ * .temperature(4)
+ * .color(0xFCFF90)
+ * .name("liquid_helium")
+ * .translation("gtceu.fluid.liquid_generic"))
+ * .element(He)
+ * .buildAndRegister();
+ * Helium.getProperty(PropertyKey.FLUID).setPrimaryKey(FluidStorageKeys.GAS);
+ *
+ * Helium3 = new MaterialBuilder(BreaLib.id("helium_3"))
+ * .gas(new FluidRegisterBuilder()
+ * .customStill()
+ * .translation("gtceu.fluid.generic"))
+ * .element(He3)
+ * .buildAndRegister();
+ *
+ * Indium = new MaterialBuilder(BreaLib.id("indium"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(430))
+ * .color(0x5c3588).secondaryColor(0x2b0b4a).iconSet(DULL)
+ * .element(In)
+ * .buildAndRegister();
+ *
+ * Iodine = new MaterialBuilder(BreaLib.id("iodine"))
+ * .dust()
+ * .color(0x3e4467).secondaryColor(0x021e40).iconSet(DULL)
+ * .element(I)
+ * .buildAndRegister();
+ *
+ * Iridium = new MaterialBuilder(BreaLib.id("iridium"))
+ * .ingot(3)
+ * .liquid(new FluidRegisterBuilder().temperature(2719))
+ * .color(0x99fede).secondaryColor(0x6cd1cf).iconSet(DULL)
+ * .appendFlags(EXT2_METAL, GENERATE_FINE_WIRE, GENERATE_GEAR, GENERATE_FRAME)
+ * .element(Ir)
+ * .blast(b -> b.temp(4500))
+ * .buildAndRegister();
+ *
+ * Iron = new MaterialBuilder(BreaLib.id("iron"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(1811))
+ * .plasma()
+ * .ore()
+ * .color(0xeeeeee).secondaryColor(0x979797).iconSet(DULL)
+ * .appendFlags(EXT2_METAL, MORTAR_GRINDABLE, GENERATE_ROTOR, GENERATE_SMALL_GEAR, GENERATE_GEAR,
+ * GENERATE_SPRING_SMALL, GENERATE_SPRING, GENERATE_ROUND, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES,
+ * BLAST_FURNACE_CALCITE_TRIPLE)
+ * .element(Fe)
+ * .buildAndRegister();
+ *
+ * Krypton = new MaterialBuilder(BreaLib.id("krypton"))
+ * .gas(new FluidRegisterBuilder()
+ * .customStill()
+ * .translation("gtceu.fluid.generic"))
+ * .color(0x80FF80)
+ * .element(Kr)
+ * .buildAndRegister();
+ *
+ * Lanthanum = new MaterialBuilder(BreaLib.id("lanthanum"))
+ * .dust()
+ * .liquid(new FluidRegisterBuilder().temperature(1193))
+ * .color(0xd17d50).secondaryColor(0x4a3560).iconSet(DULL)
+ * .element(La)
+ * .buildAndRegister();
+ *
+ * Lawrencium = new MaterialBuilder(BreaLib.id("lawrencium"))
+ * .color(0x5D7575)
+ * .iconSet(DULL)
+ * .element(Lr)
+ * .buildAndRegister();
+ *
+ * Lead = new MaterialBuilder(BreaLib.id("lead"))
+ * .ingot(1)
+ * .liquid(new FluidRegisterBuilder().temperature(600))
+ * .ore()
+ * .color(0x7e6f82).secondaryColor(0x290633)
+ * .appendFlags(EXT2_METAL, MORTAR_GRINDABLE, GENERATE_ROTOR, GENERATE_SPRING, GENERATE_SPRING_SMALL,
+ * GENERATE_FINE_WIRE)
+ * .element(Pb)
+ * .buildAndRegister();
+ *
+ * Lithium = new MaterialBuilder(BreaLib.id("lithium"))
+ * .dust()
+ * .liquid(new FluidRegisterBuilder().temperature(454))
+ * .ore()
+ * .color(0xd7e7ee).secondaryColor(0xBDC7DB)
+ * .element(Li)
+ * .buildAndRegister();
+ *
+ * Livermorium = new MaterialBuilder(BreaLib.id("livermorium"))
+ * .color(0x939393).secondaryColor(0xff5e5e).iconSet(DULL)
+ * .element(Lv)
+ * .buildAndRegister();
+ *
+ * Lutetium = new MaterialBuilder(BreaLib.id("lutetium"))
+ * .dust()
+ * .liquid(new FluidRegisterBuilder().temperature(1925))
+ * .color(0x00ccff).secondaryColor(0x4c687a).iconSet(DULL)
+ * .element(Lu)
+ * .buildAndRegister();
+ *
+ * Magnesium = new MaterialBuilder(BreaLib.id("magnesium"))
+ * .dust()
+ * .liquid(new FluidRegisterBuilder().temperature(923))
+ * .color(0xd6e3ff).secondaryColor(0x594d19).iconSet(DULL)
+ * .element(Mg)
+ * .buildAndRegister();
+ *
+ * Mendelevium = new MaterialBuilder(BreaLib.id("mendelevium"))
+ * .color(0x1D4ACF).iconSet(DULL)
+ * .element(Md)
+ * .buildAndRegister();
+ *
+ * Manganese = new MaterialBuilder(BreaLib.id("manganese"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(1519))
+ * .color(0x88a669).secondaryColor(0xCDE1B9)
+ * .appendFlags(STD_METAL, GENERATE_FOIL, GENERATE_BOLT_SCREW)
+ * .element(Mn)
+ * .buildAndRegister();
+ *
+ * Meitnerium = new MaterialBuilder(BreaLib.id("meitnerium"))
+ * .color(0x4f3c82).secondaryColor(0x6e90ff).iconSet(DULL)
+ * .element(Mt)
+ * .buildAndRegister();
+ *
+ * Mercury = new MaterialBuilder(BreaLib.id("mercury"))
+ * .fluid()
+ * .color(0xE6DCDC).iconSet(DULL)
+ * .element(Hg)
+ * .buildAndRegister();
+ *
+ * Molybdenum = new MaterialBuilder(BreaLib.id("molybdenum"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(2896))
+ * .ore()
+ * .color(0xc1c1ce).secondaryColor(0x404068).iconSet(DULL)
+ * .element(Mo)
+ * .flags(GENERATE_FOIL, GENERATE_BOLT_SCREW)
+ * .buildAndRegister();
+ *
+ * Moscovium = new MaterialBuilder(BreaLib.id("moscovium"))
+ * .color(0x2a1b40).secondaryColor(0xbd91ff).iconSet(DULL)
+ * .element(Mc)
+ * .buildAndRegister();
+ *
+ * Neodymium = new MaterialBuilder(BreaLib.id("neodymium"))
+ * .ingot().fluid().ore()
+ * .color(0x6c5863).secondaryColor(0x2c1919).iconSet(DULL)
+ * .appendFlags(STD_METAL, GENERATE_ROD, GENERATE_BOLT_SCREW)
+ * .element(Nd)
+ * .blast(1297)
+ * .buildAndRegister();
+ *
+ * Neon = new MaterialBuilder(BreaLib.id("neon"))
+ * .gas()
+ * .color(0xFAB4B4)
+ * .element(Ne)
+ * .buildAndRegister();
+ *
+ * Neptunium = new MaterialBuilder(BreaLib.id("neptunium"))
+ * .color(0x284D7B).iconSet(DULL)
+ * .element(Np)
+ * // .radioactiveHazard(1)
+ * .buildAndRegister();
+ *
+ * Nickel = new MaterialBuilder(BreaLib.id("nickel"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(1728))
+ * .plasma()
+ * .ore()
+ * .color(0xccdff5).secondaryColor(0x59563a).iconSet(DULL)
+ * .appendFlags(STD_METAL, MORTAR_GRINDABLE)
+ * .element(Ni)
+ * .buildAndRegister();
+ *
+ * Nihonium = new MaterialBuilder(BreaLib.id("nihonium"))
+ * .color(0x323957).secondaryColor(0xbfabff).iconSet(DULL)
+ * .element(Nh)
+ * .buildAndRegister();
+ *
+ * Niobium = new MaterialBuilder(BreaLib.id("niobium"))
+ * .ingot().fluid()
+ * .color(0xb494b4).secondaryColor(0x4b3f4d).iconSet(DULL)
+ * .element(Nb)
+ * .blast(b -> b.temp(2750))
+ * .buildAndRegister();
+ *
+ * Nitrogen = new MaterialBuilder(BreaLib.id("nitrogen"))
+ * .gas().plasma()
+ * .color(0x00BFC1)
+ * .element(N)
+ * .buildAndRegister();
+ *
+ * Nobelium = new MaterialBuilder(BreaLib.id("nobelium"))
+ * .color(0x3e4758).secondaryColor(0x43deff)
+ * .iconSet(DULL)
+ * .element(No)
+ * .buildAndRegister();
+ *
+ * Oganesson = new MaterialBuilder(BreaLib.id("oganesson"))
+ * .color(0x443936).secondaryColor(0xff1dbd).iconSet(DULL)
+ * .element(Og)
+ * .buildAndRegister();
+ *
+ * Osmium = new MaterialBuilder(BreaLib.id("osmium"))
+ * .ingot(4)
+ * .liquid(new FluidRegisterBuilder().temperature(3306))
+ * .color(0x54afff).secondaryColor(0x6e6eff).iconSet(DULL)
+ * .appendFlags(EXT2_METAL, GENERATE_FOIL)
+ * .element(Os)
+ * .blast(b -> b.temp(4500))
+ * .buildAndRegister();
+ *
+ * Oxygen = new MaterialBuilder(BreaLib.id("oxygen"))
+ * .gas()
+ * .liquid(new FluidRegisterBuilder()
+ * .temperature(85)
+ * .color(0x6688DD)
+ * .name("liquid_oxygen")
+ * .translation("gtceu.fluid.liquid_generic"))
+ * .plasma()
+ * .color(0x4CC3FF)
+ * .element(O)
+ * .buildAndRegister();
+ * Oxygen.getProperty(PropertyKey.FLUID).setPrimaryKey(FluidStorageKeys.GAS);
+ *
+ * Palladium = new MaterialBuilder(BreaLib.id("palladium"))
+ * .ingot().fluid().ore()
+ * .color(0xbd92b5).secondaryColor(0x535b14).iconSet(DULL)
+ * .appendFlags(EXT_METAL, GENERATE_FOIL, GENERATE_FINE_WIRE)
+ * .element(Pd)
+ * .blast(b -> b.temp(1828))
+ * .buildAndRegister();
+ *
+ * Phosphorus = new MaterialBuilder(BreaLib.id("phosphorus"))
+ * .dust()
+ * .color(0x77332c).secondaryColor(0x220202)
+ * .element(P)
+ * .buildAndRegister();
+ *
+ * Polonium = new MaterialBuilder(BreaLib.id("polonium"))
+ * .color(0x163b27).secondaryColor(0x00ff78)
+ * .iconSet(DULL)
+ * .element(Po)
+ * // .radioactiveHazard(1)
+ * .buildAndRegister();
+ *
+ * Platinum = new MaterialBuilder(BreaLib.id("platinum"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(2041))
+ * .ore()
+ * .color(0xfff4ba).secondaryColor(0x8d8d71).iconSet(DULL)
+ * .appendFlags(EXT2_METAL, GENERATE_FOIL, GENERATE_FINE_WIRE, GENERATE_RING, GENERATE_SPRING_SMALL,
+ * GENERATE_SPRING)
+ * .element(Pt)
+ * .buildAndRegister();
+ *
+ * Plutonium239 = new MaterialBuilder(BreaLib.id("plutonium_239"))
+ * .ingot(3)
+ * .liquid(new FluidRegisterBuilder().temperature(913))
+ * .ore(true)
+ * .color(0xba2727).secondaryColor(0x222730).iconSet(DULL)
+ * .element(Pu239)
+ * .buildAndRegister();
+ *
+ * Plutonium241 = new MaterialBuilder(BreaLib.id("plutonium_241"))
+ * .ingot(3)
+ * .liquid(new FluidRegisterBuilder().temperature(913))
+ * .color(0xff4c4c).secondaryColor(0x222730).iconSet(DULL)
+ * .appendFlags(EXT_METAL)
+ * .element(Pu241)
+ * .buildAndRegister();
+ *
+ * Potassium = new MaterialBuilder(BreaLib.id("potassium"))
+ * .dust(1)
+ * .liquid(new FluidRegisterBuilder().temperature(337))
+ * .color(0xd2e1f2).secondaryColor(0x6189b8).iconSet(DULL)
+ * .element(K)
+ * .buildAndRegister();
+ *
+ * Praseodymium = new MaterialBuilder(BreaLib.id("praseodymium"))
+ * .color(0x718060).secondaryColor(0x3f3447).iconSet(DULL)
+ * .element(Pr)
+ * .buildAndRegister();
+ *
+ * Promethium = new MaterialBuilder(BreaLib.id("promethium"))
+ * .color(0x814947).secondaryColor(0xd0ff71)
+ * .iconSet(DULL)
+ * .element(Pm)
+ * // .radioactiveHazard(1)
+ * .buildAndRegister();
+ *
+ * Protactinium = new MaterialBuilder(BreaLib.id("protactinium"))
+ * .color(0xA78B6D).iconSet(DULL)
+ * .element(Pa)
+ * // .radioactiveHazard(1)
+ * .buildAndRegister();
+ *
+ * Radon = new MaterialBuilder(BreaLib.id("radon"))
+ * .gas()
+ * .color(0xFF39FF)
+ * .element(Rn)
+ * .buildAndRegister();
+ *
+ * Radium = new MaterialBuilder(BreaLib.id("radium"))
+ * .color(0x838361).secondaryColor(0x89ff21).iconSet(DULL)
+ * .element(Ra)
+ * // .radioactiveHazard(1)
+ * .buildAndRegister();
+ *
+ * Rhenium = new MaterialBuilder(BreaLib.id("rhenium"))
+ * .color(0xcbcfd7).secondaryColor(0x37393d).iconSet(DULL)
+ * .element(Re)
+ * .buildAndRegister();
+ *
+ * Rhodium = new MaterialBuilder(BreaLib.id("rhodium"))
+ * .ingot().fluid()
+ * .color(0xfd46b1).secondaryColor(0xDC0C58).iconSet(DULL)
+ * .appendFlags(EXT2_METAL, GENERATE_GEAR, GENERATE_FINE_WIRE)
+ * .element(Rh)
+ * .blast(b -> b.temp(2237))
+ * .buildAndRegister();
+ *
+ * Roentgenium = new MaterialBuilder(BreaLib.id("roentgenium"))
+ * .color(0x388c48).secondaryColor(0x198a92).iconSet(DULL)
+ * .element(Rg)
+ * .buildAndRegister();
+ *
+ * Rubidium = new MaterialBuilder(BreaLib.id("rubidium"))
+ * .color(0xde0f0f).secondaryColor(0x3a1f1f).iconSet(DULL)
+ * .element(Rb)
+ * .buildAndRegister();
+ *
+ * Ruthenium = new MaterialBuilder(BreaLib.id("ruthenium"))
+ * .ingot().fluid()
+ * .color(0xa2cde0).secondaryColor(0x3c7285).iconSet(DULL)
+ * .flags(GENERATE_FOIL, GENERATE_GEAR)
+ * .element(Ru)
+ * .blast(b -> b.temp(2607))
+ * .buildAndRegister();
+ *
+ * Rutherfordium = new MaterialBuilder(BreaLib.id("rutherfordium"))
+ * .color(0x6b6157).secondaryColor(0xFFF6A1).iconSet(DULL)
+ * .element(Rf)
+ * .buildAndRegister();
+ *
+ * Samarium = new MaterialBuilder(BreaLib.id("samarium"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(1345))
+ * .color(0xc2c289).secondaryColor(0x235254).iconSet(DULL)
+ * .flags(GENERATE_LONG_ROD)
+ * .element(Sm)
+ * .blast(b -> b.temp(5400))
+ * .buildAndRegister();
+ *
+ * Scandium = new MaterialBuilder(BreaLib.id("scandium"))
+ * .color(0xb1b2ac).secondaryColor(0x1c3433)
+ * .iconSet(DULL)
+ * .element(Sc)
+ * .buildAndRegister();
+ *
+ * Seaborgium = new MaterialBuilder(BreaLib.id("seaborgium"))
+ * .color(0x19C5FF).secondaryColor(0xff19b2).iconSet(DULL)
+ * .element(Sg)
+ * .buildAndRegister();
+ *
+ * Selenium = new MaterialBuilder(BreaLib.id("selenium"))
+ * .color(0xffdf77).secondaryColor(0x055d28).iconSet(DULL)
+ * .element(Se)
+ * .buildAndRegister();
+ *
+ * Silicon = new MaterialBuilder(BreaLib.id("silicon"))
+ * .ingot().fluid()
+ * .color(0x707078).secondaryColor(0x10293b).iconSet(DULL)
+ * .flags(GENERATE_FOIL)
+ * .element(Si)
+ * .blast(2273) // no gas tier for silicon
+ * .buildAndRegister();
+ *
+ * Silver = new MaterialBuilder(BreaLib.id("silver"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(1235))
+ * .ore()
+ * .color(0xDCDCFF).secondaryColor(0x5a4705).iconSet(DULL)
+ * .appendFlags(EXT2_METAL, MORTAR_GRINDABLE, GENERATE_FINE_WIRE, GENERATE_RING)
+ * .element(Ag)
+ * .buildAndRegister();
+ *
+ * Sodium = new MaterialBuilder(BreaLib.id("sodium"))
+ * .dust()
+ * .color(0x7c80ff).secondaryColor(0x2b30a3).iconSet(DULL)
+ * .element(Na)
+ * .buildAndRegister();
+ *
+ * Strontium = new MaterialBuilder(BreaLib.id("strontium"))
+ * .color(0x7a7953).secondaryColor(0x4c0b06).iconSet(DULL)
+ * .element(Sr)
+ * .buildAndRegister();
+ *
+ * Sulfur = new MaterialBuilder(BreaLib.id("sulfur"))
+ * .dust().ore()
+ * .color(0xfdff31).secondaryColor(0xffb400)
+ * .flags(FLAMMABLE)
+ * .element(S)
+ * .buildAndRegister();
+ *
+ * Tantalum = new MaterialBuilder(BreaLib.id("tantalum"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(3290))
+ * .color(0xa8a7c6).secondaryColor(0x1f2b20).iconSet(DULL)
+ * .appendFlags(STD_METAL, GENERATE_FOIL, GENERATE_FINE_WIRE)
+ * .element(Ta)
+ * .buildAndRegister();
+ *
+ * Technetium = new MaterialBuilder(BreaLib.id("technetium"))
+ * .color(0x7430e1).secondaryColor(0x7430e1).iconSet(DULL)
+ * .element(Tc)
+ * // .radioactiveHazard(1)
+ * .buildAndRegister();
+ *
+ * Tellurium = new MaterialBuilder(BreaLib.id("tellurium"))
+ * .color(0x8fea66).secondaryColor(0x00bfff)
+ * .iconSet(DULL)
+ * .element(Te)
+ * .buildAndRegister();
+ *
+ * Tennessine = new MaterialBuilder(BreaLib.id("tennessine"))
+ * .color(0x785cc4).secondaryColor(0x7959d4).iconSet(DULL)
+ * .element(Ts)
+ * .buildAndRegister();
+ *
+ * Terbium = new MaterialBuilder(BreaLib.id("terbium"))
+ * .color(0xcedab4).secondaryColor(0x263640)
+ * .iconSet(DULL)
+ * .element(Tb)
+ * .buildAndRegister();
+ *
+ * Thorium = new MaterialBuilder(BreaLib.id("thorium"))
+ * .ingot()
+ * .liquid(new FluidRegisterBuilder().temperature(2023))
+ * .ore()
+ * .color(0x25411b).secondaryColor(0x051E05).iconSet(DULL)
+ * .appendFlags(STD_METAL, GENERATE_ROD)
+ * .element(Th)
+ * .buildAndRegister();
+ *
+ * Thallium = new MaterialBuilder(BreaLib.id("thallium"))
+ * .color(0x5d6b8e).secondaryColor(0x815b63).iconSet(DULL)
+ * .element(Tl)
+ * // .poison(PoisonProperty.PoisonType.CONTACT)
+ * .buildAndRegister();
+ *
+ * Thulium = new MaterialBuilder(BreaLib.id("thulium"))
+ * .color(0x467681).secondaryColor(0x682c2c)
+ * .iconSet(DULL)
+ * .element(Tm)
+ * .buildAndRegister();
+ *
+ * Tin = new MaterialBuilder(BreaLib.id("tin"))
+ * .ingot(1)
+ * .liquid(new FluidRegisterBuilder().temperature(505))
+ * .plasma()
+ * .ore()
+ * .color(0xfafeff).secondaryColor(0x4e676c)
+ * .appendFlags(EXT2_METAL, MORTAR_GRINDABLE, GENERATE_ROTOR, GENERATE_SPRING, GENERATE_SPRING_SMALL,
+ * GENERATE_FINE_WIRE)
+ * .element(Sn)
+ * .buildAndRegister();
+ *
+ * Titanium = new MaterialBuilder(BreaLib.id("titanium")) // todo Ore? Look at EBF recipe here if we do Ti
+ * // ores
+ * .ingot(3).fluid()
+ * .color(0xed8eea).secondaryColor(0xff64bc).iconSet(DULL)
+ * .appendFlags(EXT2_METAL, GENERATE_ROTOR, GENERATE_SMALL_GEAR, GENERATE_GEAR, GENERATE_FRAME)
+ * .element(Ti)
+ * .blast(b -> b.temp(1941))
+ * .buildAndRegister();
+ *
+ * Tritium = new MaterialBuilder(BreaLib.id("tritium"))
+ * .gas(new FluidRegisterBuilder().state(FluidState.GAS).customStill())
+ * .color(0xff316b).secondaryColor(0xd00000)
+ * .iconSet(DULL)
+ * .element(T)
+ * .buildAndRegister();
+ *
+ * Tungsten = new MaterialBuilder(BreaLib.id("tungsten"))
+ * .ingot(3)
+ * .liquid(new FluidRegisterBuilder().temperature(3695))
+ * .color(0x3b3a32).secondaryColor(0x2a2800).iconSet(DULL)
+ * .appendFlags(EXT2_METAL, GENERATE_SPRING, GENERATE_SPRING_SMALL, GENERATE_FOIL, GENERATE_GEAR,
+ * GENERATE_FRAME)
+ * .element(W)
+ * .blast(b -> b.temp(3600))
+ * .buildAndRegister();
+ *
+ * Uranium238 = new MaterialBuilder(BreaLib.id("uranium_238"))
+ * .ingot(3)
+ * .liquid(new FluidRegisterBuilder().temperature(1405))
+ * .color(0x1d891d).secondaryColor(0x33342c).iconSet(DULL)
+ * .appendFlags(EXT_METAL)
+ * .element(U238)
+ * .buildAndRegister();
+ *
+ * Uranium235 = new MaterialBuilder(BreaLib.id("uranium_235"))
+ * .ingot(3)
+ * .liquid(new FluidRegisterBuilder().temperature(1405))
+ * .color(0x46FA46).secondaryColor(0x33342c).iconSet(DULL)
+ * .appendFlags(EXT_METAL)
+ * .element(U235)
+ * .buildAndRegister();
+ *
+ * Vanadium = new MaterialBuilder(BreaLib.id("vanadium"))
+ * .ingot().fluid()
+ * .color(0x696d76).secondaryColor(0x240808).iconSet(DULL)
+ * .element(V)
+ * .blast(2183)
+ * .buildAndRegister();
+ *
+ * Xenon = new MaterialBuilder(BreaLib.id("xenon"))
+ * .gas()
+ * .color(0x00FFFF)
+ * .element(Xe)
+ * .buildAndRegister();
+ *
+ * Ytterbium = new MaterialBuilder(BreaLib.id("ytterbium"))
+ * .color(0xA7A7A7).iconSet(DULL)
+ * .element(Yb)
+ * .buildAndRegister();
+ *
+ * Yttrium = new MaterialBuilder(BreaLib.id("yttrium"))
+ * .ingot().fluid()
+ * .color(0x7d8072).secondaryColor(0x15161a).iconSet(DULL)
+ * .element(Y)
+ * .blast(1799)
+ * .buildAndRegister();
+ *
+ * Zinc = new MaterialBuilder(BreaLib.id("zinc"))
+ * .ingot(1)
+ * .liquid(new FluidRegisterBuilder().temperature(693))
+ * .color(0xEBEBFA).secondaryColor(0x232c30).iconSet(DULL)
+ * .appendFlags(STD_METAL, MORTAR_GRINDABLE, GENERATE_FOIL, GENERATE_RING, GENERATE_FINE_WIRE)
+ * .element(Zn)
+ * .buildAndRegister();
+ *
+ * Zirconium = new MaterialBuilder(BreaLib.id("zirconium"))
+ * .color(0xb99b7e).secondaryColor(0x271813).iconSet(DULL)
+ * .element(Zr)
+ * .buildAndRegister();
+ */
}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/materials/material/FirstDegreeMaterials.java b/src/main/java/net/phasetranscrystal/breacore/data/materials/material/FirstDegreeMaterials.java
index e6fb4c5..43101cc 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/materials/material/FirstDegreeMaterials.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/materials/material/FirstDegreeMaterials.java
@@ -1,113 +1,106 @@
package net.phasetranscrystal.breacore.data.materials.material;
-import net.phasetranscrystal.brealib.BreaLib;
-
-import net.phasetranscrystal.breacore.api.fluid.FluidRegisterBuilder;
-import net.phasetranscrystal.breacore.api.material.registry.MaterialBuilder;
-
-import static net.phasetranscrystal.breacore.api.material.info.MaterialFlags.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaMaterialIconSet.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaMaterials.*;
-
public class FirstDegreeMaterials {
public static void register() {
- Bone = new MaterialBuilder(BreaLib.id("bone"))
- .dust(1)
- .color(0xfcfbed).secondaryColor(0xa0a38b)
- .flags(MORTAR_GRINDABLE, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES, DISABLE_DECOMPOSITION)
- .components(Calcium, 3)
- .buildAndRegister();
-
- Calcite = new MaterialBuilder(BreaLib.id("calcite"))
- .dust(1).ore()
- .color(0xfffef8).secondaryColor(0xbbaf62)
- .components(Calcium, 1, Carbon, 1, Oxygen, 3)
- .buildAndRegister();
-
- Charcoal = new MaterialBuilder(BreaLib.id("charcoal"))
- .gem(1, 1600) // default charcoal burn time in vanilla
- .color(0x7d6f58).secondaryColor(0x13110d).iconSet(DULL)
- .flags(FLAMMABLE, NO_SMELTING, NO_SMASHING, MORTAR_GRINDABLE)
- .components(Carbon, 1)
- .buildAndRegister();
-
- Water = new MaterialBuilder(BreaLib.id("water"))
- .liquid(new FluidRegisterBuilder().temperature(300))
- .color(0x0000FF)
- .flags(DISABLE_DECOMPOSITION)
- .components(Hydrogen, 2, Oxygen, 1)
- .buildAndRegister();
-
- Coal = new MaterialBuilder(BreaLib.id("coal"))
- .gem(1, 1600).ore(2, 1) // default coal burn time in vanilla
- .color(0x393e41).secondaryColor(0x101015).iconSet(DULL)
- .flags(FLAMMABLE, NO_SMELTING, NO_SMASHING, MORTAR_GRINDABLE, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES,
- DISABLE_DECOMPOSITION)
- .components(Carbon, 1)
- .buildAndRegister();
-
- Diamond = new MaterialBuilder(BreaLib.id("diamond"))
- .gem(3).ore()
- .color(0xC8FFFF).iconSet(DULL)
- .flags(GENERATE_BOLT_SCREW, GENERATE_LENS, GENERATE_GEAR, NO_SMASHING, NO_SMELTING,
- HIGH_SIFTER_OUTPUT, DISABLE_DECOMPOSITION, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES,
- GENERATE_LONG_ROD)
- .components(Carbon, 1)
- .buildAndRegister();
-
- Emerald = new MaterialBuilder(BreaLib.id("emerald"))
- .gem().ore(2, 1)
- .color(0x17ff6c).secondaryColor(0x003f00).iconSet(DULL)
- .appendFlags(EXT_METAL, NO_SMASHING, NO_SMELTING, HIGH_SIFTER_OUTPUT,
- EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES, GENERATE_LENS)
- .components(Beryllium, 3, Aluminium, 2, Silicon, 6, Oxygen, 18)
- .buildAndRegister();
-
- Ice = new MaterialBuilder(BreaLib.id("ice"))
- .dust(0)
- .liquid(new FluidRegisterBuilder()
- .temperature(273)
- .customStill())
- .color(0xeef6ff, false).secondaryColor(0x6389c9).iconSet(DULL)
- .flags(NO_SMASHING, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES, DISABLE_DECOMPOSITION)
- .components(Hydrogen, 2, Oxygen, 1)
- .buildAndRegister();
-
- Obsidian = new MaterialBuilder(BreaLib.id("obsidian"))
- .dust(3)
- .color(0x3b2754).secondaryColor(0x000001).iconSet(DULL)
- .flags(NO_SMASHING, EXCLUDE_BLOCK_CRAFTING_RECIPES, GENERATE_PLATE, GENERATE_DENSE)
- .components(Magnesium, 1, Iron, 1, Silicon, 2, Oxygen, 4)
- .buildAndRegister();
-
- NetherQuartz = new MaterialBuilder(BreaLib.id("nether_quartz"))
- .gem(1).ore(2, 1)
- .color(0xf8efe3).secondaryColor(0xe6c1bb).iconSet(DULL)
- .flags(GENERATE_PLATE, NO_SMELTING, CRYSTALLIZABLE, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES,
- DISABLE_DECOMPOSITION)
- .components(Silicon, 1, Oxygen, 2)
- .buildAndRegister();
-
- CertusQuartz = new MaterialBuilder(BreaLib.id("certus_quartz"))
- .gem(1).ore(2, 1)
- .color(0xc2d6ff).secondaryColor(0x86bacf).iconSet(DULL)
- .flags(GENERATE_PLATE, NO_SMELTING, CRYSTALLIZABLE, DISABLE_DECOMPOSITION)
- .components(Silicon, 1, Oxygen, 2)
- .buildAndRegister();
-
- SiliconDioxide = new MaterialBuilder(BreaLib.id("silicon_dioxide"))
- .dust(1)
- .color(0xf2f2f2).secondaryColor(0xb2c4c7).iconSet(DULL)
- .flags(NO_SMASHING, NO_SMELTING)
- .components(Silicon, 1, Oxygen, 2)
- .buildAndRegister();
-
- EnderPearl = new MaterialBuilder(BreaLib.id("ender_pearl"))
- .gem(1)
- .color(0x8cf4e2).secondaryColor(0x032620).iconSet(DULL)
- .flags(NO_SMASHING, NO_SMELTING, GENERATE_PLATE)
- .components(Beryllium, 1, Potassium, 4, Nitrogen, 5)
- .buildAndRegister();
+ /*
+ * Bone = new MaterialBuilder(BreaLib.id("bone"))
+ * .dust(1)
+ * .color(0xfcfbed).secondaryColor(0xa0a38b)
+ * .flags(MORTAR_GRINDABLE, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES, DISABLE_DECOMPOSITION)
+ * .components(Calcium, 3)
+ * .buildAndRegister();
+ *
+ * Calcite = new MaterialBuilder(BreaLib.id("calcite"))
+ * .dust(1).ore()
+ * .color(0xfffef8).secondaryColor(0xbbaf62)
+ * .components(Calcium, 1, Carbon, 1, Oxygen, 3)
+ * .buildAndRegister();
+ *
+ * Charcoal = new MaterialBuilder(BreaLib.id("charcoal"))
+ * .gem(1, 1600) // default charcoal burn time in vanilla
+ * .color(0x7d6f58).secondaryColor(0x13110d).iconSet(DULL)
+ * .flags(FLAMMABLE, NO_SMELTING, NO_SMASHING, MORTAR_GRINDABLE)
+ * .components(Carbon, 1)
+ * .buildAndRegister();
+ *
+ * Water = new MaterialBuilder(BreaLib.id("water"))
+ * .liquid(new FluidRegisterBuilder().temperature(300))
+ * .color(0x0000FF)
+ * .flags(DISABLE_DECOMPOSITION)
+ * .components(Hydrogen, 2, Oxygen, 1)
+ * .buildAndRegister();
+ *
+ * Coal = new MaterialBuilder(BreaLib.id("coal"))
+ * .gem(1, 1600).ore(2, 1) // default coal burn time in vanilla
+ * .color(0x393e41).secondaryColor(0x101015).iconSet(DULL)
+ * .flags(FLAMMABLE, NO_SMELTING, NO_SMASHING, MORTAR_GRINDABLE, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES,
+ * DISABLE_DECOMPOSITION)
+ * .components(Carbon, 1)
+ * .buildAndRegister();
+ *
+ * Diamond = new MaterialBuilder(BreaLib.id("diamond"))
+ * .gem(3).ore()
+ * .color(0xC8FFFF).iconSet(DULL)
+ * .flags(GENERATE_BOLT_SCREW, GENERATE_LENS, GENERATE_GEAR, NO_SMASHING, NO_SMELTING,
+ * HIGH_SIFTER_OUTPUT, DISABLE_DECOMPOSITION, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES,
+ * GENERATE_LONG_ROD)
+ * .components(Carbon, 1)
+ * .buildAndRegister();
+ *
+ * Emerald = new MaterialBuilder(BreaLib.id("emerald"))
+ * .gem().ore(2, 1)
+ * .color(0x17ff6c).secondaryColor(0x003f00).iconSet(DULL)
+ * .appendFlags(EXT_METAL, NO_SMASHING, NO_SMELTING, HIGH_SIFTER_OUTPUT,
+ * EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES, GENERATE_LENS)
+ * .components(Beryllium, 3, Aluminium, 2, Silicon, 6, Oxygen, 18)
+ * .buildAndRegister();
+ *
+ * Ice = new MaterialBuilder(BreaLib.id("ice"))
+ * .dust(0)
+ * .liquid(new FluidRegisterBuilder()
+ * .temperature(273)
+ * .customStill())
+ * .color(0xeef6ff, false).secondaryColor(0x6389c9).iconSet(DULL)
+ * .flags(NO_SMASHING, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES, DISABLE_DECOMPOSITION)
+ * .components(Hydrogen, 2, Oxygen, 1)
+ * .buildAndRegister();
+ *
+ * Obsidian = new MaterialBuilder(BreaLib.id("obsidian"))
+ * .dust(3)
+ * .color(0x3b2754).secondaryColor(0x000001).iconSet(DULL)
+ * .flags(NO_SMASHING, EXCLUDE_BLOCK_CRAFTING_RECIPES, GENERATE_PLATE, GENERATE_DENSE)
+ * .components(Magnesium, 1, Iron, 1, Silicon, 2, Oxygen, 4)
+ * .buildAndRegister();
+ *
+ * NetherQuartz = new MaterialBuilder(BreaLib.id("nether_quartz"))
+ * .gem(1).ore(2, 1)
+ * .color(0xf8efe3).secondaryColor(0xe6c1bb).iconSet(DULL)
+ * .flags(GENERATE_PLATE, NO_SMELTING, CRYSTALLIZABLE, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES,
+ * DISABLE_DECOMPOSITION)
+ * .components(Silicon, 1, Oxygen, 2)
+ * .buildAndRegister();
+ *
+ * CertusQuartz = new MaterialBuilder(BreaLib.id("certus_quartz"))
+ * .gem(1).ore(2, 1)
+ * .color(0xc2d6ff).secondaryColor(0x86bacf).iconSet(DULL)
+ * .flags(GENERATE_PLATE, NO_SMELTING, CRYSTALLIZABLE, DISABLE_DECOMPOSITION)
+ * .components(Silicon, 1, Oxygen, 2)
+ * .buildAndRegister();
+ *
+ * SiliconDioxide = new MaterialBuilder(BreaLib.id("silicon_dioxide"))
+ * .dust(1)
+ * .color(0xf2f2f2).secondaryColor(0xb2c4c7).iconSet(DULL)
+ * .flags(NO_SMASHING, NO_SMELTING)
+ * .components(Silicon, 1, Oxygen, 2)
+ * .buildAndRegister();
+ *
+ * EnderPearl = new MaterialBuilder(BreaLib.id("ender_pearl"))
+ * .gem(1)
+ * .color(0x8cf4e2).secondaryColor(0x032620).iconSet(DULL)
+ * .flags(NO_SMASHING, NO_SMELTING, GENERATE_PLATE)
+ * .components(Beryllium, 1, Potassium, 4, Nitrogen, 5)
+ * .buildAndRegister();
+ */
}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/materials/material/HigherDegreeMaterials.java b/src/main/java/net/phasetranscrystal/breacore/data/materials/material/HigherDegreeMaterials.java
index 4e7e46b..e544c9c 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/materials/material/HigherDegreeMaterials.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/materials/material/HigherDegreeMaterials.java
@@ -1,53 +1,47 @@
package net.phasetranscrystal.breacore.data.materials.material;
-import net.phasetranscrystal.brealib.BreaLib;
-
-import net.phasetranscrystal.breacore.api.material.registry.MaterialBuilder;
-
-import static net.phasetranscrystal.breacore.api.material.info.MaterialFlags.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaMaterialIconSet.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaMaterials.*;
-
public class HigherDegreeMaterials {
public static void register() {
- EnderEye = new MaterialBuilder(BreaLib.id("ender_eye"))
- .gem(1)
- .color(0xb5e45a).secondaryColor(0x001430).iconSet(DULL)
- .flags(GENERATE_PLATE, NO_SMASHING, NO_SMELTING, DECOMPOSITION_BY_CENTRIFUGING)
- .components(EnderPearl, 1, Blaze, 1)
- .buildAndRegister();
-
- Basalt = new MaterialBuilder(BreaLib.id("basalt"))
- .dust(1)
- .color(0x5c5c5c).secondaryColor(0x1b2632).iconSet(DULL)
- .flags(NO_SMASHING, DECOMPOSITION_BY_CENTRIFUGING)
- .buildAndRegister();
-
- Granite = new MaterialBuilder(BreaLib.id("granite"))
- .dust()
- .color(0xd69077).secondaryColor(0x71352c).iconSet(DULL)
- .flags(DECOMPOSITION_BY_CENTRIFUGING)
- .buildAndRegister();
-
- Brick = new MaterialBuilder(BreaLib.id("brick"))
- .dust()
- .color(0xc76245).secondaryColor(0x2d1610).iconSet(DULL)
- .flags(EXCLUDE_BLOCK_CRAFTING_RECIPES, NO_SMELTING, DECOMPOSITION_BY_CENTRIFUGING)
- .components(Clay, 1)
- .buildAndRegister();
-
- Diorite = new MaterialBuilder(BreaLib.id("diorite"))
- .dust()
- .color(0xe9e9e9).secondaryColor(0x7b7b7b)
- .iconSet(DULL)
- .flags(DECOMPOSITION_BY_CENTRIFUGING)
- .buildAndRegister();
-
- Blackstone = new MaterialBuilder(BreaLib.id("blackstone"))
- .dust()
- .color(0x090a0a).iconSet(DULL)
- .flags(NO_SMASHING)
- .buildAndRegister();
+ /*
+ * EnderEye = new MaterialBuilder(BreaLib.id("ender_eye"))
+ * .gem(1)
+ * .color(0xb5e45a).secondaryColor(0x001430).iconSet(DULL)
+ * .flags(GENERATE_PLATE, NO_SMASHING, NO_SMELTING, DECOMPOSITION_BY_CENTRIFUGING)
+ * .components(EnderPearl, 1, Blaze, 1)
+ * .buildAndRegister();
+ *
+ * Basalt = new MaterialBuilder(BreaLib.id("basalt"))
+ * .dust(1)
+ * .color(0x5c5c5c).secondaryColor(0x1b2632).iconSet(DULL)
+ * .flags(NO_SMASHING, DECOMPOSITION_BY_CENTRIFUGING)
+ * .buildAndRegister();
+ *
+ * Granite = new MaterialBuilder(BreaLib.id("granite"))
+ * .dust()
+ * .color(0xd69077).secondaryColor(0x71352c).iconSet(DULL)
+ * .flags(DECOMPOSITION_BY_CENTRIFUGING)
+ * .buildAndRegister();
+ *
+ * Brick = new MaterialBuilder(BreaLib.id("brick"))
+ * .dust()
+ * .color(0xc76245).secondaryColor(0x2d1610).iconSet(DULL)
+ * .flags(EXCLUDE_BLOCK_CRAFTING_RECIPES, NO_SMELTING, DECOMPOSITION_BY_CENTRIFUGING)
+ * .components(Clay, 1)
+ * .buildAndRegister();
+ *
+ * Diorite = new MaterialBuilder(BreaLib.id("diorite"))
+ * .dust()
+ * .color(0xe9e9e9).secondaryColor(0x7b7b7b)
+ * .iconSet(DULL)
+ * .flags(DECOMPOSITION_BY_CENTRIFUGING)
+ * .buildAndRegister();
+ *
+ * Blackstone = new MaterialBuilder(BreaLib.id("blackstone"))
+ * .dust()
+ * .color(0x090a0a).iconSet(DULL)
+ * .flags(NO_SMASHING)
+ * .buildAndRegister();
+ */
}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/api/material/MarkerMaterials.java b/src/main/java/net/phasetranscrystal/breacore/data/materials/material/MarkerMaterials.java
similarity index 96%
rename from src/main/java/net/phasetranscrystal/breacore/api/material/MarkerMaterials.java
rename to src/main/java/net/phasetranscrystal/breacore/data/materials/material/MarkerMaterials.java
index 9d08ff9..6096319 100644
--- a/src/main/java/net/phasetranscrystal/breacore/api/material/MarkerMaterials.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/materials/material/MarkerMaterials.java
@@ -1,7 +1,9 @@
-package net.phasetranscrystal.breacore.api.material;
+package net.phasetranscrystal.breacore.data.materials.material;
import net.phasetranscrystal.brealib.BreaLib;
+import net.phasetranscrystal.breacore.api.material.MarkerMaterial;
+
import net.minecraft.world.item.DyeColor;
import com.google.common.collect.HashBiMap;
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/materials/material/OrganicChemistryMaterials.java b/src/main/java/net/phasetranscrystal/breacore/data/materials/material/OrganicChemistryMaterials.java
index 2ea1372..1c61653 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/materials/material/OrganicChemistryMaterials.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/materials/material/OrganicChemistryMaterials.java
@@ -1,21 +1,15 @@
package net.phasetranscrystal.breacore.data.materials.material;
-import net.phasetranscrystal.brealib.BreaLib;
-
-import net.phasetranscrystal.breacore.api.material.registry.MaterialBuilder;
-
-import static net.phasetranscrystal.breacore.api.material.info.MaterialFlags.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaMaterialIconSet.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaMaterials.*;
-
public class OrganicChemistryMaterials {
public static void register() {
- Sugar = new MaterialBuilder(BreaLib.id("sugar"))
- .gem(1)
- .color(0xFFFFFF).secondaryColor(0x545468).iconSet(DULL)
- .flags(DISABLE_DECOMPOSITION)
- .components(Carbon, 6, Hydrogen, 12, Oxygen, 6)
- .buildAndRegister();
+ /*
+ * Sugar = new MaterialBuilder(BreaLib.id("sugar"))
+ * .gem(1)
+ * .color(0xFFFFFF).secondaryColor(0x545468).iconSet(DULL)
+ * .flags(DISABLE_DECOMPOSITION)
+ * .components(Carbon, 6, Hydrogen, 12, Oxygen, 6)
+ * .buildAndRegister();
+ */
}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/materials/material/SecondDegreeMaterials.java b/src/main/java/net/phasetranscrystal/breacore/data/materials/material/SecondDegreeMaterials.java
index 6f5babd..fdce1c4 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/materials/material/SecondDegreeMaterials.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/materials/material/SecondDegreeMaterials.java
@@ -1,136 +1,129 @@
package net.phasetranscrystal.breacore.data.materials.material;
-import net.phasetranscrystal.brealib.BreaLib;
-
-import net.phasetranscrystal.breacore.api.fluid.FluidRegisterBuilder;
-import net.phasetranscrystal.breacore.api.material.registry.MaterialBuilder;
-
-import static net.phasetranscrystal.breacore.api.material.info.MaterialFlags.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaMaterialIconSet.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaMaterials.*;
-
public class SecondDegreeMaterials {
public static void register() {
- Glass = new MaterialBuilder(BreaLib.id("glass"))
- .gem(0)
- .liquid(new FluidRegisterBuilder()
- .temperature(1200)
- .customStill())
- .color(0xffffff).iconSet(DULL)
- .flags(GENERATE_LENS, NO_SMASHING, EXCLUDE_BLOCK_CRAFTING_RECIPES, DECOMPOSITION_BY_CENTRIFUGING)
- .components(SiliconDioxide, 1)
- .buildAndRegister();
-
- Amethyst = new MaterialBuilder(BreaLib.id("amethyst"))
- .gem(3).ore()
- .color(0xcfa0f3).secondaryColor(0x734fbc).iconSet(DULL)
- .appendFlags(EXT_METAL, NO_SMASHING, NO_SMELTING, HIGH_SIFTER_OUTPUT, GENERATE_LENS)
- .components(SiliconDioxide, 4, Iron, 1)
- .buildAndRegister();
-
- EchoShard = new MaterialBuilder(BreaLib.id("echo_shard"))
- .gem(3)
- .color(0x002b2d).iconSet(DULL)
- .appendFlags(EXT_METAL, NO_SMASHING, NO_SMELTING, GENERATE_ROD)
- .components(SiliconDioxide, 3, Sculk, 2)
- .buildAndRegister();
-
- Lapis = new MaterialBuilder(BreaLib.id("lapis"))
- .gem(1).ore(6, 4)
- .color(0x85a9ff).secondaryColor(0x2a7fff).iconSet(DULL)
- .flags(NO_SMASHING, NO_SMELTING, CRYSTALLIZABLE, NO_WORKING, DECOMPOSITION_BY_ELECTROLYZING,
- EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES,
- GENERATE_PLATE, GENERATE_ROD)
- .buildAndRegister();
-
- Blaze = new MaterialBuilder(BreaLib.id("blaze"))
- .dust(1)
- .liquid(new FluidRegisterBuilder()
- .temperature(4000)
- .customStill())
- .color(0xfff94d, false).secondaryColor(0xff330c)
- .iconSet(DULL)
- .flags(NO_SMELTING, MORTAR_GRINDABLE, DECOMPOSITION_BY_CENTRIFUGING) // todo burning flag
- .buildAndRegister();
-
- Deepslate = new MaterialBuilder(BreaLib.id("deepslate"))
- .dust()
- .color(0x797979).secondaryColor(0x2f2f37).iconSet(DULL)
- .flags(NO_SMASHING, DECOMPOSITION_BY_CENTRIFUGING)
- .buildAndRegister();
-
- Concrete = new MaterialBuilder(BreaLib.id("concrete"))
- .dust()
- .liquid(new FluidRegisterBuilder().temperature(286))
- .color(0xfaf3e8).secondaryColor(0xbbbaba).iconSet(DULL)
- .flags(NO_SMASHING, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES)
- .components(Stone, 1)
- .buildAndRegister();
-
- Andesite = new MaterialBuilder(BreaLib.id("andesite"))
- .dust()
- .color(0xa8aa9a).iconSet(DULL)
- .flags(DECOMPOSITION_BY_CENTRIFUGING)
- .buildAndRegister();
-
- Flint = new MaterialBuilder(BreaLib.id("flint"))
- .gem(1)
- .color(0xc7c7c7).secondaryColor(0x212121).iconSet(DULL)
- .flags(NO_SMASHING, MORTAR_GRINDABLE, DECOMPOSITION_BY_CENTRIFUGING)
- .components(SiliconDioxide, 1)
- .buildAndRegister();
-
- Air = new MaterialBuilder(BreaLib.id("air"))
- .gas(new FluidRegisterBuilder().customStill())
- .color(0xA9D0F5)
- .flags(DISABLE_DECOMPOSITION)
- .components(Nitrogen, 78, Oxygen, 21, Argon, 9)
- .buildAndRegister();
-
- LiquidAir = new MaterialBuilder(BreaLib.id("liquid_air"))
- .liquid(new FluidRegisterBuilder().temperature(97))
- .color(0xA9D0F5)
- .flags(DISABLE_DECOMPOSITION)
- .buildAndRegister();
-
- NetherAir = new MaterialBuilder(BreaLib.id("nether_air"))
- .gas()
- .color(0x4C3434)
- .flags(DISABLE_DECOMPOSITION)
- .buildAndRegister();
-
- LiquidNetherAir = new MaterialBuilder(BreaLib.id("liquid_nether_air"))
- .liquid(new FluidRegisterBuilder().temperature(58))
- .color(0x4C3434)
- .flags(DISABLE_DECOMPOSITION)
- .buildAndRegister();
-
- EnderAir = new MaterialBuilder(BreaLib.id("ender_air"))
- .gas()
- .color(0x283454)
- .flags(DISABLE_DECOMPOSITION)
- .buildAndRegister();
-
- LiquidEnderAir = new MaterialBuilder(BreaLib.id("liquid_ender_air"))
- .liquid(new FluidRegisterBuilder().temperature(36))
- .color(0x283454)
- .flags(DISABLE_DECOMPOSITION)
- .buildAndRegister();
-
- Clay = new MaterialBuilder(BreaLib.id("clay"))
- .dust(1)
- .color(0xbec9e8).secondaryColor(0x373944).iconSet(DULL)
- .flags(MORTAR_GRINDABLE, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES)
- .components(Sodium, 2, Lithium, 1, Aluminium, 2, Silicon, 2, Water, 6)
- .buildAndRegister();
-
- Redstone = new MaterialBuilder(BreaLib.id("redstone"))
- .dust().ore(5, 1, true)
- .liquid(new FluidRegisterBuilder().temperature(500))
- .color(0xff0000).secondaryColor(0x340605).iconSet(DULL)
- .flags(GENERATE_PLATE, NO_SMASHING, NO_SMELTING, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES,
- EXCLUDE_PLATE_COMPRESSOR_RECIPE, DECOMPOSITION_BY_CENTRIFUGING)
- .buildAndRegister();
+ /*
+ * Glass = new MaterialBuilder(BreaLib.id("glass"))
+ * .gem(0)
+ * .liquid(new FluidRegisterBuilder()
+ * .temperature(1200)
+ * .customStill())
+ * .color(0xffffff).iconSet(DULL)
+ * .flags(GENERATE_LENS, NO_SMASHING, EXCLUDE_BLOCK_CRAFTING_RECIPES, DECOMPOSITION_BY_CENTRIFUGING)
+ * .components(SiliconDioxide, 1)
+ * .buildAndRegister();
+ *
+ * Amethyst = new MaterialBuilder(BreaLib.id("amethyst"))
+ * .gem(3).ore()
+ * .color(0xcfa0f3).secondaryColor(0x734fbc).iconSet(DULL)
+ * .appendFlags(EXT_METAL, NO_SMASHING, NO_SMELTING, HIGH_SIFTER_OUTPUT, GENERATE_LENS)
+ * .components(SiliconDioxide, 4, Iron, 1)
+ * .buildAndRegister();
+ *
+ * EchoShard = new MaterialBuilder(BreaLib.id("echo_shard"))
+ * .gem(3)
+ * .color(0x002b2d).iconSet(DULL)
+ * .appendFlags(EXT_METAL, NO_SMASHING, NO_SMELTING, GENERATE_ROD)
+ * .components(SiliconDioxide, 3, Sculk, 2)
+ * .buildAndRegister();
+ *
+ * Lapis = new MaterialBuilder(BreaLib.id("lapis"))
+ * .gem(1).ore(6, 4)
+ * .color(0x85a9ff).secondaryColor(0x2a7fff).iconSet(DULL)
+ * .flags(NO_SMASHING, NO_SMELTING, CRYSTALLIZABLE, NO_WORKING, DECOMPOSITION_BY_ELECTROLYZING,
+ * EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES,
+ * GENERATE_PLATE, GENERATE_ROD)
+ * .buildAndRegister();
+ *
+ * Blaze = new MaterialBuilder(BreaLib.id("blaze"))
+ * .dust(1)
+ * .liquid(new FluidRegisterBuilder()
+ * .temperature(4000)
+ * .customStill())
+ * .color(0xfff94d, false).secondaryColor(0xff330c)
+ * .iconSet(DULL)
+ * .flags(NO_SMELTING, MORTAR_GRINDABLE, DECOMPOSITION_BY_CENTRIFUGING) // todo burning flag
+ * .buildAndRegister();
+ *
+ * Deepslate = new MaterialBuilder(BreaLib.id("deepslate"))
+ * .dust()
+ * .color(0x797979).secondaryColor(0x2f2f37).iconSet(DULL)
+ * .flags(NO_SMASHING, DECOMPOSITION_BY_CENTRIFUGING)
+ * .buildAndRegister();
+ *
+ * Concrete = new MaterialBuilder(BreaLib.id("concrete"))
+ * .dust()
+ * .liquid(new FluidRegisterBuilder().temperature(286))
+ * .color(0xfaf3e8).secondaryColor(0xbbbaba).iconSet(DULL)
+ * .flags(NO_SMASHING, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES)
+ * .components(Stone, 1)
+ * .buildAndRegister();
+ *
+ * Andesite = new MaterialBuilder(BreaLib.id("andesite"))
+ * .dust()
+ * .color(0xa8aa9a).iconSet(DULL)
+ * .flags(DECOMPOSITION_BY_CENTRIFUGING)
+ * .buildAndRegister();
+ *
+ * Flint = new MaterialBuilder(BreaLib.id("flint"))
+ * .gem(1)
+ * .color(0xc7c7c7).secondaryColor(0x212121).iconSet(DULL)
+ * .flags(NO_SMASHING, MORTAR_GRINDABLE, DECOMPOSITION_BY_CENTRIFUGING)
+ * .components(SiliconDioxide, 1)
+ * .buildAndRegister();
+ *
+ * Air = new MaterialBuilder(BreaLib.id("air"))
+ * .gas(new FluidRegisterBuilder().customStill())
+ * .color(0xA9D0F5)
+ * .flags(DISABLE_DECOMPOSITION)
+ * .components(Nitrogen, 78, Oxygen, 21, Argon, 9)
+ * .buildAndRegister();
+ *
+ * LiquidAir = new MaterialBuilder(BreaLib.id("liquid_air"))
+ * .liquid(new FluidRegisterBuilder().temperature(97))
+ * .color(0xA9D0F5)
+ * .flags(DISABLE_DECOMPOSITION)
+ * .buildAndRegister();
+ *
+ * NetherAir = new MaterialBuilder(BreaLib.id("nether_air"))
+ * .gas()
+ * .color(0x4C3434)
+ * .flags(DISABLE_DECOMPOSITION)
+ * .buildAndRegister();
+ *
+ * LiquidNetherAir = new MaterialBuilder(BreaLib.id("liquid_nether_air"))
+ * .liquid(new FluidRegisterBuilder().temperature(58))
+ * .color(0x4C3434)
+ * .flags(DISABLE_DECOMPOSITION)
+ * .buildAndRegister();
+ *
+ * EnderAir = new MaterialBuilder(BreaLib.id("ender_air"))
+ * .gas()
+ * .color(0x283454)
+ * .flags(DISABLE_DECOMPOSITION)
+ * .buildAndRegister();
+ *
+ * LiquidEnderAir = new MaterialBuilder(BreaLib.id("liquid_ender_air"))
+ * .liquid(new FluidRegisterBuilder().temperature(36))
+ * .color(0x283454)
+ * .flags(DISABLE_DECOMPOSITION)
+ * .buildAndRegister();
+ *
+ * Clay = new MaterialBuilder(BreaLib.id("clay"))
+ * .dust(1)
+ * .color(0xbec9e8).secondaryColor(0x373944).iconSet(DULL)
+ * .flags(MORTAR_GRINDABLE, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES)
+ * .components(Sodium, 2, Lithium, 1, Aluminium, 2, Silicon, 2, Water, 6)
+ * .buildAndRegister();
+ *
+ * Redstone = new MaterialBuilder(BreaLib.id("redstone"))
+ * .dust().ore(5, 1, true)
+ * .liquid(new FluidRegisterBuilder().temperature(500))
+ * .color(0xff0000).secondaryColor(0x340605).iconSet(DULL)
+ * .flags(GENERATE_PLATE, NO_SMASHING, NO_SMELTING, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES,
+ * EXCLUDE_PLATE_COMPRESSOR_RECIPE, DECOMPOSITION_BY_CENTRIFUGING)
+ * .buildAndRegister();
+ */
}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/materials/material/UnknownCompositionMaterials.java b/src/main/java/net/phasetranscrystal/breacore/data/materials/material/UnknownCompositionMaterials.java
index b8abc66..4a140dd 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/materials/material/UnknownCompositionMaterials.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/materials/material/UnknownCompositionMaterials.java
@@ -1,148 +1,141 @@
package net.phasetranscrystal.breacore.data.materials.material;
-import net.phasetranscrystal.brealib.BreaLib;
-
-import net.phasetranscrystal.breacore.api.fluid.FluidRegisterBuilder;
-import net.phasetranscrystal.breacore.api.material.registry.MaterialBuilder;
-
-import static net.phasetranscrystal.breacore.api.material.info.MaterialFlags.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaMaterialIconSet.*;
-import static net.phasetranscrystal.breacore.data.materials.BreaMaterials.*;
-
public class UnknownCompositionMaterials {
public static void register() {
- Gunpowder = new MaterialBuilder(BreaLib.id("gunpowder"))
- .dust(0)
- .color(0xa4a4a4).secondaryColor(0x767676).iconSet(DULL)
- .flags(FLAMMABLE, EXPLOSIVE, NO_SMELTING, NO_SMASHING)
- .buildAndRegister();
-
- Stone = new MaterialBuilder(BreaLib.id("stone"))
- .dust(2)
- .color(0x8f8f8f).secondaryColor(0x898989).iconSet(DULL)
- .flags(MORTAR_GRINDABLE, GENERATE_GEAR, NO_SMASHING, NO_SMELTING)
- .buildAndRegister();
-
- Lava = new MaterialBuilder(BreaLib.id("lava"))
- .fluid().color(0xFF4000).buildAndRegister();
-
- Netherite = new MaterialBuilder(BreaLib.id("netherite"))
- .ingot().color(0x4b4042).secondaryColor(0x474447)
- .buildAndRegister();
-
- Glowstone = new MaterialBuilder(BreaLib.id("glowstone"))
- .dust(1)
- .liquid(new FluidRegisterBuilder().temperature(500))
- .color(0xfcb34c).secondaryColor(0xce7533).iconSet(DULL)
- .flags(NO_SMASHING, GENERATE_PLATE, EXCLUDE_PLATE_COMPRESSOR_RECIPE,
- EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES)
- .buildAndRegister();
-
- NetherStar = new MaterialBuilder(BreaLib.id("nether_star"))
- .gem(4)
- .color(0xfeffc6).secondaryColor(0x7fd7e2)
- .iconSet(DULL)
- .flags(NO_SMASHING, NO_SMELTING, GENERATE_LENS)
- .buildAndRegister();
-
- Endstone = new MaterialBuilder(BreaLib.id("endstone"))
- .dust(1)
- .color(0xf6fabd).secondaryColor(0xc5be8b).iconSet(DULL)
- .flags(NO_SMASHING)
- .buildAndRegister();
-
- Netherrack = new MaterialBuilder(BreaLib.id("netherrack"))
- .dust(1)
- .color(0x7c4249).secondaryColor(0x400b0b).iconSet(DULL)
- .flags(NO_SMASHING, FLAMMABLE)
- .buildAndRegister();
-
- Milk = new MaterialBuilder(BreaLib.id("milk"))
- .liquid(new FluidRegisterBuilder()
- .temperature(295)
- .customStill())
- .color(0xfffbf0).secondaryColor(0xf6eac8).iconSet(DULL)
- .buildAndRegister();
-
- Wood = new MaterialBuilder(BreaLib.id("wood"))
- .wood()
- .color(0xc29f6d).secondaryColor(0x643200).iconSet(DULL)
- .flags(GENERATE_PLATE, GENERATE_ROD, GENERATE_BOLT_SCREW, GENERATE_LONG_ROD, FLAMMABLE, GENERATE_GEAR,
- GENERATE_FRAME)
- .buildAndRegister();
-
- Paper = new MaterialBuilder(BreaLib.id("paper"))
- .dust(0)
- .color(0xFAFAFA).secondaryColor(0x878787).iconSet(DULL)
- .flags(GENERATE_PLATE, FLAMMABLE, NO_SMELTING, NO_SMASHING,
- MORTAR_GRINDABLE, EXCLUDE_PLATE_COMPRESSOR_RECIPE)
- .buildAndRegister();
-
- // These colors are much nicer looking than those in MC's EnumDyeColor
- DyeBlack = new MaterialBuilder(BreaLib.id("black_dye"))
- .fluid().color(0x202020).buildAndRegister();
-
- DyeRed = new MaterialBuilder(BreaLib.id("red_dye"))
- .fluid().color(0xFF0000).buildAndRegister();
-
- DyeGreen = new MaterialBuilder(BreaLib.id("green_dye"))
- .fluid().color(0x00FF00).buildAndRegister();
-
- DyeBrown = new MaterialBuilder(BreaLib.id("brown_dye"))
- .fluid().color(0x604000).buildAndRegister();
-
- DyeBlue = new MaterialBuilder(BreaLib.id("blue_dye"))
- .fluid().color(0x0020FF).buildAndRegister();
-
- DyePurple = new MaterialBuilder(BreaLib.id("purple_dye"))
- .fluid().color(0x800080).buildAndRegister();
-
- DyeCyan = new MaterialBuilder(BreaLib.id("cyan_dye"))
- .fluid().color(0x00FFFF).buildAndRegister();
-
- DyeLightGray = new MaterialBuilder(BreaLib.id("light_gray_dye"))
- .fluid().color(0xC0C0C0).buildAndRegister();
-
- DyeGray = new MaterialBuilder(BreaLib.id("gray_dye"))
- .fluid().color(0x808080).buildAndRegister();
-
- DyePink = new MaterialBuilder(BreaLib.id("pink_dye"))
- .fluid().color(0xFFC0C0).buildAndRegister();
-
- DyeLime = new MaterialBuilder(BreaLib.id("lime_dye"))
- .fluid().color(0x80FF80).buildAndRegister();
-
- DyeYellow = new MaterialBuilder(BreaLib.id("yellow_dye"))
- .fluid().color(0xFFFF00).buildAndRegister();
-
- DyeLightBlue = new MaterialBuilder(BreaLib.id("light_blue_dye"))
- .fluid().color(0x6080FF).buildAndRegister();
-
- DyeMagenta = new MaterialBuilder(BreaLib.id("magenta_dye"))
- .fluid().color(0xFF00FF).buildAndRegister();
-
- DyeOrange = new MaterialBuilder(BreaLib.id("orange_dye"))
- .fluid().color(0xFF8000).buildAndRegister();
-
- DyeWhite = new MaterialBuilder(BreaLib.id("white_dye"))
- .fluid().color(0xFFFFFF).buildAndRegister();
-
- TreatedWood = new MaterialBuilder(BreaLib.id("treated_wood"))
- .wood()
- .color(0x644218).secondaryColor(0x4e0b00).iconSet(DULL)
- .flags(GENERATE_PLATE, FLAMMABLE, GENERATE_ROD, GENERATE_FRAME)
- .buildAndRegister();
-
- Sculk = new MaterialBuilder(BreaLib.id("sculk"))
- .dust(1)
- .color(0x015a5c).secondaryColor(0x001616).iconSet(DULL)
- .buildAndRegister();
-
- Wax = new MaterialBuilder(BreaLib.id("wax"))
- .ingot().fluid()
- .color(0xfabf29)
- .flags(NO_SMELTING)
- .buildAndRegister();
+ /*
+ * Gunpowder = new MaterialBuilder(BreaLib.id("gunpowder"))
+ * .dust(0)
+ * .color(0xa4a4a4).secondaryColor(0x767676).iconSet(DULL)
+ * .flags(FLAMMABLE, EXPLOSIVE, NO_SMELTING, NO_SMASHING)
+ * .buildAndRegister();
+ *
+ * Stone = new MaterialBuilder(BreaLib.id("stone"))
+ * .dust(2)
+ * .color(0x8f8f8f).secondaryColor(0x898989).iconSet(DULL)
+ * .flags(MORTAR_GRINDABLE, GENERATE_GEAR, NO_SMASHING, NO_SMELTING)
+ * .buildAndRegister();
+ *
+ * Lava = new MaterialBuilder(BreaLib.id("lava"))
+ * .fluid().color(0xFF4000).buildAndRegister();
+ *
+ * Netherite = new MaterialBuilder(BreaLib.id("netherite"))
+ * .ingot().color(0x4b4042).secondaryColor(0x474447)
+ * .buildAndRegister();
+ *
+ * Glowstone = new MaterialBuilder(BreaLib.id("glowstone"))
+ * .dust(1)
+ * .liquid(new FluidRegisterBuilder().temperature(500))
+ * .color(0xfcb34c).secondaryColor(0xce7533).iconSet(DULL)
+ * .flags(NO_SMASHING, GENERATE_PLATE, EXCLUDE_PLATE_COMPRESSOR_RECIPE,
+ * EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES)
+ * .buildAndRegister();
+ *
+ * NetherStar = new MaterialBuilder(BreaLib.id("nether_star"))
+ * .gem(4)
+ * .color(0xfeffc6).secondaryColor(0x7fd7e2)
+ * .iconSet(DULL)
+ * .flags(NO_SMASHING, NO_SMELTING, GENERATE_LENS)
+ * .buildAndRegister();
+ *
+ * Endstone = new MaterialBuilder(BreaLib.id("endstone"))
+ * .dust(1)
+ * .color(0xf6fabd).secondaryColor(0xc5be8b).iconSet(DULL)
+ * .flags(NO_SMASHING)
+ * .buildAndRegister();
+ *
+ * Netherrack = new MaterialBuilder(BreaLib.id("netherrack"))
+ * .dust(1)
+ * .color(0x7c4249).secondaryColor(0x400b0b).iconSet(DULL)
+ * .flags(NO_SMASHING, FLAMMABLE)
+ * .buildAndRegister();
+ *
+ * Milk = new MaterialBuilder(BreaLib.id("milk"))
+ * .liquid(new FluidRegisterBuilder()
+ * .temperature(295)
+ * .customStill())
+ * .color(0xfffbf0).secondaryColor(0xf6eac8).iconSet(DULL)
+ * .buildAndRegister();
+ *
+ * Wood = new MaterialBuilder(BreaLib.id("wood"))
+ * .wood()
+ * .color(0xc29f6d).secondaryColor(0x643200).iconSet(DULL)
+ * .flags(GENERATE_PLATE, GENERATE_ROD, GENERATE_BOLT_SCREW, GENERATE_LONG_ROD, FLAMMABLE, GENERATE_GEAR,
+ * GENERATE_FRAME)
+ * .buildAndRegister();
+ *
+ * Paper = new MaterialBuilder(BreaLib.id("paper"))
+ * .dust(0)
+ * .color(0xFAFAFA).secondaryColor(0x878787).iconSet(DULL)
+ * .flags(GENERATE_PLATE, FLAMMABLE, NO_SMELTING, NO_SMASHING,
+ * MORTAR_GRINDABLE, EXCLUDE_PLATE_COMPRESSOR_RECIPE)
+ * .buildAndRegister();
+ *
+ * // These colors are much nicer looking than those in MC's EnumDyeColor
+ * DyeBlack = new MaterialBuilder(BreaLib.id("black_dye"))
+ * .fluid().color(0x202020).buildAndRegister();
+ *
+ * DyeRed = new MaterialBuilder(BreaLib.id("red_dye"))
+ * .fluid().color(0xFF0000).buildAndRegister();
+ *
+ * DyeGreen = new MaterialBuilder(BreaLib.id("green_dye"))
+ * .fluid().color(0x00FF00).buildAndRegister();
+ *
+ * DyeBrown = new MaterialBuilder(BreaLib.id("brown_dye"))
+ * .fluid().color(0x604000).buildAndRegister();
+ *
+ * DyeBlue = new MaterialBuilder(BreaLib.id("blue_dye"))
+ * .fluid().color(0x0020FF).buildAndRegister();
+ *
+ * DyePurple = new MaterialBuilder(BreaLib.id("purple_dye"))
+ * .fluid().color(0x800080).buildAndRegister();
+ *
+ * DyeCyan = new MaterialBuilder(BreaLib.id("cyan_dye"))
+ * .fluid().color(0x00FFFF).buildAndRegister();
+ *
+ * DyeLightGray = new MaterialBuilder(BreaLib.id("light_gray_dye"))
+ * .fluid().color(0xC0C0C0).buildAndRegister();
+ *
+ * DyeGray = new MaterialBuilder(BreaLib.id("gray_dye"))
+ * .fluid().color(0x808080).buildAndRegister();
+ *
+ * DyePink = new MaterialBuilder(BreaLib.id("pink_dye"))
+ * .fluid().color(0xFFC0C0).buildAndRegister();
+ *
+ * DyeLime = new MaterialBuilder(BreaLib.id("lime_dye"))
+ * .fluid().color(0x80FF80).buildAndRegister();
+ *
+ * DyeYellow = new MaterialBuilder(BreaLib.id("yellow_dye"))
+ * .fluid().color(0xFFFF00).buildAndRegister();
+ *
+ * DyeLightBlue = new MaterialBuilder(BreaLib.id("light_blue_dye"))
+ * .fluid().color(0x6080FF).buildAndRegister();
+ *
+ * DyeMagenta = new MaterialBuilder(BreaLib.id("magenta_dye"))
+ * .fluid().color(0xFF00FF).buildAndRegister();
+ *
+ * DyeOrange = new MaterialBuilder(BreaLib.id("orange_dye"))
+ * .fluid().color(0xFF8000).buildAndRegister();
+ *
+ * DyeWhite = new MaterialBuilder(BreaLib.id("white_dye"))
+ * .fluid().color(0xFFFFFF).buildAndRegister();
+ *
+ * TreatedWood = new MaterialBuilder(BreaLib.id("treated_wood"))
+ * .wood()
+ * .color(0x644218).secondaryColor(0x4e0b00).iconSet(DULL)
+ * .flags(GENERATE_PLATE, FLAMMABLE, GENERATE_ROD, GENERATE_FRAME)
+ * .buildAndRegister();
+ *
+ * Sculk = new MaterialBuilder(BreaLib.id("sculk"))
+ * .dust(1)
+ * .color(0x015a5c).secondaryColor(0x001616).iconSet(DULL)
+ * .buildAndRegister();
+ *
+ * Wax = new MaterialBuilder(BreaLib.id("wax"))
+ * .ingot().fluid()
+ * .color(0xfabf29)
+ * .flags(NO_SMELTING)
+ * .buildAndRegister();
+ */
}
}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/tagprefix/BreaTagPrefixes.java b/src/main/java/net/phasetranscrystal/breacore/data/tagprefix/BreaTagPrefixes.java
deleted file mode 100644
index 0bb1fd6..0000000
--- a/src/main/java/net/phasetranscrystal/breacore/data/tagprefix/BreaTagPrefixes.java
+++ /dev/null
@@ -1,276 +0,0 @@
-package net.phasetranscrystal.breacore.data.tagprefix;
-
-import net.phasetranscrystal.breacore.api.BreaApi;
-import net.phasetranscrystal.breacore.api.addon.AddonFinder;
-import net.phasetranscrystal.breacore.api.addon.IBreaAddon;
-import net.phasetranscrystal.breacore.api.material.info.MaterialFlags;
-import net.phasetranscrystal.breacore.api.material.property.PropertyKey;
-import net.phasetranscrystal.breacore.api.tag.TagPrefix;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterialIconTypes;
-import net.phasetranscrystal.breacore.data.materials.BreaMaterials;
-
-import net.minecraft.resources.Identifier;
-import net.minecraft.tags.BlockTags;
-import net.minecraft.world.level.block.Blocks;
-import net.minecraft.world.level.block.SoundType;
-import net.minecraft.world.level.block.state.BlockBehaviour;
-import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
-import net.minecraft.world.level.material.MapColor;
-
-import static net.phasetranscrystal.breacore.api.tag.TagPrefix.*;
-import static net.phasetranscrystal.breacore.api.tag.TagPrefix.Conditions.*;
-
-public class BreaTagPrefixes {
-
- public static final TagPrefix NULL_PREFIX = TagPrefix.NULL_PREFIX;
- /// 非变种矿石
- public static final TagPrefix ore = oreTagPrefix("stone", BlockTags.MINEABLE_WITH_PICKAXE)
- .langValue("%s Ore")
- .registerOre(
- Blocks.STONE::defaultBlockState, () -> BreaMaterials.Stone, BlockBehaviour.Properties.of()
- .mapColor(MapColor.STONE).requiresCorrectToolForDrops().strength(3.0F, 3.0F),
- Identifier.withDefaultNamespace("block/stone"), false, false, true);
- /// 花岗岩矿石
- public static final TagPrefix oreGranite = oreTagPrefix("granite", BlockTags.MINEABLE_WITH_PICKAXE)
- .langValue("Granite %s Ore")
- .registerOre(
- Blocks.GRANITE::defaultBlockState, () -> BreaMaterials.Granite, BlockBehaviour.Properties.of()
- .mapColor(MapColor.DIRT).requiresCorrectToolForDrops().strength(3.0F, 3.0F),
- Identifier.withDefaultNamespace("block/granite"));
- /// 闪长岩矿石
- public static final TagPrefix oreDiorite = oreTagPrefix("diorite", BlockTags.MINEABLE_WITH_PICKAXE)
- .langValue("Diorite %s Ore")
- .registerOre(
- Blocks.DIORITE::defaultBlockState, () -> BreaMaterials.Diorite, BlockBehaviour.Properties.of()
- .mapColor(MapColor.QUARTZ).requiresCorrectToolForDrops().strength(3.0F, 3.0F),
- Identifier.withDefaultNamespace("block/diorite"));
- /// 安山岩矿石
- public static final TagPrefix oreAndesite = oreTagPrefix("andesite", BlockTags.MINEABLE_WITH_PICKAXE)
- .langValue("Andesite %s Ore")
- .registerOre(
- Blocks.ANDESITE::defaultBlockState, () -> BreaMaterials.Andesite, BlockBehaviour.Properties.of()
- .mapColor(MapColor.DIRT).requiresCorrectToolForDrops().strength(3.0F, 3.0F),
- Identifier.withDefaultNamespace("block/andesite"));
- /// 深板岩矿石
- public static final TagPrefix oreDeepslate = oreTagPrefix("deepslate", BlockTags.MINEABLE_WITH_PICKAXE)
- .langValue("Deepslate %s Ore")
- .registerOre(
- Blocks.DEEPSLATE::defaultBlockState, () -> BreaMaterials.Deepslate, BlockBehaviour.Properties.of()
- .mapColor(MapColor.DEEPSLATE).requiresCorrectToolForDrops().strength(4.5F, 3.0F)
- .sound(SoundType.DEEPSLATE),
- Identifier.withDefaultNamespace("block/deepslate"), false, false, true);
- /// 凝灰岩矿石
- public static final TagPrefix oreTuff = oreTagPrefix("tuff", BlockTags.MINEABLE_WITH_PICKAXE)
- .langValue("Tuff %s Ore")
- .registerOre(
- Blocks.TUFF::defaultBlockState, () -> BreaMaterials.Tuff, BlockBehaviour.Properties.of()
- .mapColor(MapColor.TERRACOTTA_GRAY).requiresCorrectToolForDrops().strength(3.0F, 3.0F)
- .sound(SoundType.TUFF),
- Identifier.withDefaultNamespace("block/tuff"));
- /// 沙子矿石
- public static final TagPrefix oreSand = oreTagPrefix("sand", BlockTags.MINEABLE_WITH_SHOVEL)
- .langValue("Sand %s Ore")
- .registerOre(Blocks.SAND::defaultBlockState, () -> BreaMaterials.SiliconDioxide,
- BlockBehaviour.Properties.of().mapColor(MapColor.SAND).instrument(NoteBlockInstrument.SNARE)
- .strength(0.5F).sound(SoundType.SAND),
- Identifier.withDefaultNamespace("block/sand"), false, true, false);
- /// 红沙矿石
- public static final TagPrefix oreRedSand = oreTagPrefix("redSand", BlockTags.MINEABLE_WITH_SHOVEL)
- .langValue("Red Sand %s Ore")
- .registerOre(Blocks.RED_SAND::defaultBlockState, () -> BreaMaterials.SiliconDioxide,
- BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_ORANGE).instrument(NoteBlockInstrument.SNARE)
- .strength(0.5F).sound(SoundType.SAND),
- Identifier.withDefaultNamespace("block/red_sand"), false, true, false);
- /// 沙砾矿石
- public static final TagPrefix oreGravel = oreTagPrefix("gravel", BlockTags.MINEABLE_WITH_SHOVEL)
- .langValue("Gravel %s Ore")
- .registerOre(Blocks.GRAVEL::defaultBlockState, () -> BreaMaterials.Flint,
- BlockBehaviour.Properties.of().mapColor(MapColor.STONE).instrument(NoteBlockInstrument.SNARE)
- .strength(0.6F).sound(SoundType.GRAVEL),
- Identifier.withDefaultNamespace("block/gravel"), false, true, false);
- /// 玄武岩矿石
- public static final TagPrefix oreBasalt = oreTagPrefix("basalt", BlockTags.MINEABLE_WITH_PICKAXE)
- .langValue("Basalt %s Ore")
- .registerOre(Blocks.BASALT::defaultBlockState, () -> BreaMaterials.Basalt,
- BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BLACK)
- .instrument(NoteBlockInstrument.BASEDRUM).requiresCorrectToolForDrops().strength(2.5F, 4.2F)
- .sound(SoundType.BASALT),
- Identifier.withDefaultNamespace("block/basalt"), true);
- /// 下界岩矿石
- public static final TagPrefix oreNetherrack = oreTagPrefix("netherrack", BlockTags.MINEABLE_WITH_PICKAXE)
- .langValue("Nether %s Ore")
- .registerOre(Blocks.NETHERRACK::defaultBlockState, () -> BreaMaterials.Netherrack,
- BlockBehaviour.Properties.of().mapColor(MapColor.NETHER).instrument(NoteBlockInstrument.BASEDRUM)
- .requiresCorrectToolForDrops().strength(3.0F, 3.0F).sound(SoundType.NETHER_ORE),
- Identifier.withDefaultNamespace("block/netherrack"), true, false, true);
- /// 黑石矿石
- public static final TagPrefix oreBlackstone = oreTagPrefix("blackstone", BlockTags.MINEABLE_WITH_PICKAXE)
- .langValue("Blackstone %s Ore")
- .registerOre(Blocks.BLACKSTONE::defaultBlockState, () -> BreaMaterials.Blackstone,
- BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BLACK)
- .instrument(NoteBlockInstrument.BASEDRUM).requiresCorrectToolForDrops()
- .strength(3.0F, 3.0F),
- Identifier.withDefaultNamespace("block/blackstone"), true, false, false);
- /// 末地石矿石
- public static final TagPrefix oreEndstone = oreTagPrefix("endstone", BlockTags.MINEABLE_WITH_PICKAXE)
- .langValue("End %s Ore")
- .registerOre(Blocks.END_STONE::defaultBlockState, () -> BreaMaterials.Endstone,
- BlockBehaviour.Properties.of().mapColor(MapColor.SAND).instrument(NoteBlockInstrument.BASEDRUM)
- .requiresCorrectToolForDrops().strength(4.5F, 9.0F),
- Identifier.withDefaultNamespace("block/end_stone"), true, false, true);
- /// 粗矿
- public static final TagPrefix rawOre = new TagPrefix("raw")
- .idPattern("raw_%s")
- .defaultTagPath("raw_materials/%s")
- .unformattedTagPath("raw_materials")
- .langValue("Raw %s")
- .materialIconType(BreaMaterialIconTypes.rawOre)
- .unificationEnabled(true)
- .generateItem(true)
- .generationCondition(hasOreProperty);
- /// 粗矿块
- public static final TagPrefix rawOreBlock = new TagPrefix("rawOreBlock")
- .idPattern("raw_%s_block")
- .defaultTagPath("storage_blocks/raw_%s")
- .unformattedTagPath("storage_blocks")
- .langValue("Block of Raw %s")
- .materialIconType(BreaMaterialIconTypes.rawOreBlock)
- .miningToolTag(BlockTags.MINEABLE_WITH_PICKAXE)
- .unificationEnabled(true)
- .generateBlock(true)
- .generationCondition(hasOreProperty);
- /// 锭
- public static final TagPrefix ingot = new TagPrefix("ingot")
- .defaultTagPath("ingots/%s")
- .unformattedTagPath("ingots")
- .materialAmount(BreaApi.M)
- .materialIconType(BreaMaterialIconTypes.ingot)
- .unificationEnabled(true)
- .enableRecycling()
- .generateItem(true)
- .generationCondition(hasIngotProperty);
- /// 宝石
- public static final TagPrefix gem = new TagPrefix("gem")
- .defaultTagPath("gems/%s")
- .unformattedTagPath("gems")
- .langValue("%s")
- .materialAmount(BreaApi.M)
- .materialIconType(BreaMaterialIconTypes.gem)
- .unificationEnabled(true)
- .enableRecycling()
- .generateItem(true)
- .generationCondition(hasGemProperty);
- /// 粉末
- public static final TagPrefix dust = new TagPrefix("dust")
- .defaultTagPath("dusts/%s")
- .unformattedTagPath("dusts")
- .materialAmount(BreaApi.M)
- .materialIconType(BreaMaterialIconTypes.dust)
- .unificationEnabled(true)
- .enableRecycling()
- .generateItem(true)
- .generationCondition(hasDustProperty);
- /// 粒
- public static final TagPrefix nugget = new TagPrefix("nugget")
- .defaultTagPath("nuggets/%s")
- .unformattedTagPath("nuggets")
- .materialAmount(BreaApi.M / 9)
- .materialIconType(BreaMaterialIconTypes.nugget)
- .unificationEnabled(true)
- .enableRecycling()
- .generateItem(true)
- .generationCondition(hasIngotProperty);
- /// 板
- public static final TagPrefix plate = new TagPrefix("plate")
- .defaultTagPath("plates/%s")
- .unformattedTagPath("plates")
- .materialAmount(BreaApi.M)
- .materialIconType(BreaMaterialIconTypes.plate)
- .unificationEnabled(true)
- .enableRecycling()
- .generateItem(true)
- .generationCondition(mat -> mat.hasFlag(MaterialFlags.GENERATE_PLATE));
- public static final TagPrefix lens = new TagPrefix("lens")
- .defaultTagPath("lenses/%s")
- .unformattedTagPath("lenses")
- .materialAmount((BreaApi.M * 3) / 4)
- .materialIconType(BreaMaterialIconTypes.lens)
- .unificationEnabled(true)
- .enableRecycling()
- .generateItem(true)
- .generationCondition(mat -> mat.hasFlag(MaterialFlags.GENERATE_LENS));
- /// 长杆
- public static final TagPrefix rodLong = new TagPrefix("longRod")
- .idPattern("long_%s_rod")
- .defaultTagPath("rods/long/%s")
- .unformattedTagPath("rods/long")
- .langValue("Long %s Rod")
- .materialAmount(BreaApi.M)
- .materialIconType(BreaMaterialIconTypes.rodLong)
- .unificationEnabled(true)
- .enableRecycling()
- .generateItem(true)
- .generationCondition(mat -> mat.hasFlag(MaterialFlags.GENERATE_LONG_ROD));
- /// 杆
- public static final TagPrefix rod = new TagPrefix("rod")
- .defaultTagPath("rods/%s")
- .unformattedTagPath("rods")
- .langValue("%s Rod")
- .materialAmount(BreaApi.M / 2)
- .materialIconType(BreaMaterialIconTypes.rod)
- .unificationEnabled(true)
- .enableRecycling()
- .generateItem(true)
- .generationCondition(mat -> mat.hasFlag(MaterialFlags.GENERATE_ROD));
- /// 颜料
- public static final TagPrefix dye = new TagPrefix("dye")
- .defaultTagPath("dyes/%s")
- .unformattedTagPath("dyes")
- .materialAmount(-1);
- /// 块
- public static final TagPrefix block = new TagPrefix("block")
- .defaultTagPath("storage_blocks/%s")
- .unformattedTagPath("storage_blocks")
- .langValue("Block of %s")
- .materialAmount(BreaApi.M * 9)
- .materialIconType(BreaMaterialIconTypes.block)
- .miningToolTag(BlockTags.MINEABLE_WITH_PICKAXE)
- .generateBlock(true)
- .generationCondition(material -> material.hasProperty(PropertyKey.INGOT) ||
- material.hasProperty(PropertyKey.GEM) || material.hasFlag(MaterialFlags.FORCE_GENERATE_BLOCK))
- .unificationEnabled(true)
- .enableRecycling();
- /// 原木
- public static final TagPrefix log = new TagPrefix("log")
- .unformattedTagPath("logs", true);
- /// 木板
- public static final TagPrefix planks = new TagPrefix("planks")
- .unformattedTagPath("planks", true);
- /// 半砖
- public static final TagPrefix slab = new TagPrefix("slab")
- .unformattedTagPath("slabs", true);
- /// 楼梯
- public static final TagPrefix stairs = new TagPrefix("stairs")
- .unformattedTagPath("stairs", true);
- /// 栅栏
- public static final TagPrefix fence = new TagPrefix("fence")
- .unformattedTagPath("fences");
- /// 栅栏门
- public static final TagPrefix fenceGate = new TagPrefix("fenceGate")
- .unformattedTagPath("fence_gates");
- /// 门
- public static final TagPrefix door = new TagPrefix("door")
- .unformattedTagPath("doors", true);
- /// 岩石
- public static final TagPrefix rock = new TagPrefix("rock")
- .defaultTagPath("%s")
- .langValue("%s")
- .miningToolTag(BlockTags.MINEABLE_WITH_PICKAXE)
- .unificationEnabled(false)
- .generateBlock(true) // generate a block but not really, for TagPrefix#setIgnoredBlock
- .generationCondition((material) -> false);
-
- public static void init() {
- AddonFinder.getAddonList().forEach(IBreaAddon::registerTagPrefixes);
- }
-}
diff --git a/src/main/java/net/phasetranscrystal/breacore/data/tags/CustomTags.java b/src/main/java/net/phasetranscrystal/breacore/data/tags/CustomTags.java
index 02b2c3d..3be0d32 100644
--- a/src/main/java/net/phasetranscrystal/breacore/data/tags/CustomTags.java
+++ b/src/main/java/net/phasetranscrystal/breacore/data/tags/CustomTags.java
@@ -1,163 +1,3 @@
package net.phasetranscrystal.breacore.data.tags;
-import net.phasetranscrystal.breacore.api.tag.TagUtil;
-
-import net.minecraft.core.registries.Registries;
-import net.minecraft.tags.BlockTags;
-import net.minecraft.tags.TagKey;
-import net.minecraft.world.entity.EntityType;
-import net.minecraft.world.item.Item;
-import net.minecraft.world.level.biome.Biome;
-import net.minecraft.world.level.block.Block;
-import net.minecraft.world.level.material.Fluid;
-import net.neoforged.neoforge.common.Tags;
-
-public class CustomTags {
-
- // Added Vanilla tags
- public static final TagKey- PISTONS = TagUtil.createItemTag("pistons");
- public static final TagKey
- DOUGHS = TagUtil.createItemTag("doughs");
-
- // Added Gregtech tags
- public static final TagKey
- TRANSISTORS = TagUtil.createModItemTag("transistors");
- public static final TagKey