Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/content/Modpacks/Changes/v8.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,5 @@ A large number of machine feature interfaces have been removed, and have had the
- `BlastingRecipeBuilder`, `CampfireRecipeBuilder`, `SmeltingRecipeBuilder` and `SmokingRecipeBuilder` have been merged into `SimpleCookingRecipeBuilder`
- Example usage: `SimpleCookingRecipeBuilder.campfireCooking("cooking_chicken").input(new ItemStack(Items.CHICKEN)).output(new ItemStacks(Items.COOKED_CHICKEN)).cookingTime(100).experience(100).save(provider);`
- `GTFluidImpl` has been merged into `GTFluid`, use `GTFluid.Flowing` and `GTFluid.Source` instead of `GTFluidImpl.Flowing` and `GTFluidImpl.Source`.
- Item behaviors have been moved to `common/item/behavior`, and some items have been moved from `api/item` to `common/item`.
- Item behaviors have been moved to `common/item/behavior`, and some items have been moved from `api/item` to `common/item`.
- All materials are now stored in a single registry, instead of a registry per addon. Replace references to `GTCEuAPI.materialManager` with `GTRegistries.MATERIALS`.
3 changes: 0 additions & 3 deletions src/main/java/com/gregtechceu/gtceu/api/GTCEuAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.gregtechceu.gtceu.api.addon.IGTAddon;
import com.gregtechceu.gtceu.api.block.ICoilType;
import com.gregtechceu.gtceu.api.block.IFilterType;
import com.gregtechceu.gtceu.api.data.chemical.material.IMaterialRegistryManager;
import com.gregtechceu.gtceu.api.machine.multiblock.IBatteryData;
import com.gregtechceu.gtceu.api.registry.GTRegistry;
import com.gregtechceu.gtceu.common.block.BatteryBlock;
Expand All @@ -28,8 +27,6 @@ public class GTCEuAPI {

/** Will always be available */
public static GTCEu instance;
/** Will be available at the Construction stage */
public static IMaterialRegistryManager materialManager;
Comment thread
gustovafing marked this conversation as resolved.

/** Will be available at the Pre-Initialization stage */
@Getter
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/com/gregtechceu/gtceu/api/addon/IGTAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ default void registerTagPrefixes() {}
*/
default void registerElements() {}

/**
* Call init on your custom Material class(es) here
*
* @deprecated use {@link com.gregtechceu.gtceu.api.data.chemical.material.event.MaterialRegistryEvent} and
* {@link com.gregtechceu.gtceu.api.data.chemical.material.event.MaterialEvent} instead.
*/
@Deprecated(forRemoval = true, since = "1.0.21")
default void registerMaterials() {}
Comment thread
gustovafing marked this conversation as resolved.

/**
* Call init on your custom Sound class(es) here
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.gregtechceu.gtceu.api.data.chemical;

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.GTCEuAPI;
import com.gregtechceu.gtceu.api.data.chemical.material.ItemMaterialData;
import com.gregtechceu.gtceu.api.data.chemical.material.Material;
import com.gregtechceu.gtceu.api.data.chemical.material.properties.FluidProperty;
Expand All @@ -12,6 +11,7 @@
import com.gregtechceu.gtceu.api.data.tag.TagPrefix;
import com.gregtechceu.gtceu.api.data.tag.TagUtil;
import com.gregtechceu.gtceu.api.fluids.store.FluidStorageKey;
import com.gregtechceu.gtceu.api.registry.GTRegistries;
import com.gregtechceu.gtceu.common.data.GTMaterials;

import net.minecraft.MethodsReturnNonnullByDefault;
Expand Down Expand Up @@ -97,7 +97,7 @@ public static MaterialStack getMaterialStack(ItemLike itemLike) {
public static Material getMaterial(Fluid fluid) {
if (FLUID_MATERIAL.isEmpty()) {
Set<TagKey<Fluid>> allFluidTags = BuiltInRegistries.FLUID.getTagNames().collect(Collectors.toSet());
for (final Material material : GTCEuAPI.materialManager.getRegisteredMaterials()) {
for (final Material material : GTRegistries.MATERIALS.values()) {
if (material.hasProperty(PropertyKey.FLUID)) {
FluidProperty property = material.getProperty(PropertyKey.FLUID);
FluidStorageKey.allKeys().stream()
Expand Down Expand Up @@ -209,7 +209,7 @@ public static MaterialEntry getMaterialEntry(TagKey<Item> tag) {
// lookups.
Set<TagKey<Item>> allItemTags = BuiltInRegistries.ITEM.getTagNames().collect(Collectors.toSet());
for (TagPrefix prefix : TagPrefix.values()) {
for (Material material : GTCEuAPI.materialManager.getRegisteredMaterials()) {
for (Material material : GTRegistries.MATERIALS.values()) {
prefix.getItemTags(material).stream()
.filter(allItemTags::contains)
.forEach(tagKey -> {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.gregtechceu.gtceu.api.data.chemical.material;

import com.gregtechceu.gtceu.api.GTCEuAPI;
import com.gregtechceu.gtceu.api.data.chemical.ChemicalHelper;
import com.gregtechceu.gtceu.api.data.chemical.Element;
import com.gregtechceu.gtceu.api.data.chemical.material.info.MaterialFlag;
Expand All @@ -16,6 +15,7 @@
import com.gregtechceu.gtceu.api.fluids.store.FluidStorageKey;
import com.gregtechceu.gtceu.api.fluids.store.FluidStorageKeys;
import com.gregtechceu.gtceu.api.item.tool.MaterialToolTier;
import com.gregtechceu.gtceu.api.registry.GTRegistries;
import com.gregtechceu.gtceu.api.registry.registrate.BuilderBase;
import com.gregtechceu.gtceu.common.data.GTMaterials;
import com.gregtechceu.gtceu.common.data.GTMedicalConditions;
Expand Down Expand Up @@ -150,7 +150,7 @@ protected Material(ResourceLocation resourceLocation) {
}

protected void registerMaterial() {
GTCEuAPI.materialManager.getRegistry(getModid()).register(this);
GTRegistries.MATERIALS.register(getResourceLocation(), this);
}

public String getName() {
Expand All @@ -176,7 +176,7 @@ public boolean shouldGenerateRecipesFor(@NotNull TagPrefix prefix) {
}

public void addFlags(MaterialFlag... flags) {
if (!GTCEuAPI.materialManager.canModifyMaterials())
if (!GTRegistries.MATERIALS.canModifyMaterials())
throw new IllegalStateException("Cannot add flag to material when registry is frozen!");
this.flags.addFlags(flags).verify(this);
}
Expand Down Expand Up @@ -533,7 +533,7 @@ public <T extends IMaterialProperty> void removeProperty(PropertyKey<T> key) {
}

public <T extends IMaterialProperty> void setProperty(PropertyKey<T> key, IMaterialProperty property) {
if (!GTCEuAPI.materialManager.canModifyMaterials()) {
if (!GTRegistries.MATERIALS.canModifyMaterials()) {
throw new IllegalStateException("Cannot add properties to a Material when registry is frozen!");
}
properties.setProperty(key, property);
Expand Down Expand Up @@ -1875,7 +1875,7 @@ public Material buildAndRegister() {

@Override
@HideFromJS
public Material register() {
public @NotNull Material register() {
return value = buildAndRegister();
}
}
Expand Down

This file was deleted.

Loading
Loading