From 74dc71246030e61de30eb87cd1dfb126203b1fc6 Mon Sep 17 00:00:00 2001 From: Guillaume Mercier <10gui-gui10@live.ca> Date: Fri, 30 Jan 2026 20:07:39 -0500 Subject: [PATCH] remove deprecated endpoints will publish a pre-tag and create integration PRs shortly --- .../postea/api/BlockReplacementManager.java | 36 ------------------- .../api/ItemStackReplacementManager.java | 35 ------------------ .../api/TileEntityReplacementManager.java | 11 ------ 3 files changed, 82 deletions(-) diff --git a/src/main/java/com/gtnewhorizons/postea/api/BlockReplacementManager.java b/src/main/java/com/gtnewhorizons/postea/api/BlockReplacementManager.java index 570026b..027008a 100644 --- a/src/main/java/com/gtnewhorizons/postea/api/BlockReplacementManager.java +++ b/src/main/java/com/gtnewhorizons/postea/api/BlockReplacementManager.java @@ -1,13 +1,11 @@ package com.gtnewhorizons.postea.api; -import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Function; import javax.annotation.Nonnull; import net.minecraft.block.Block; -import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; import com.gtnewhorizons.postea.utility.BlockConversionInfo; @@ -25,40 +23,6 @@ public abstract class BlockReplacementManager { // region custom transformer registration - /** - * Adds a custom transformer for a given id. - * - * @deprecated Use {@link #addTransformationHandler(String, Function)} - * - * @apiNote When the transformer function passed to this function returns a null, value Postea will assume that - * the transformer has failed to identify and run the handler on any other handler function registered - * to the given ID. - *
- * If you need to perform a simple transformations consider using the following methods instead: - * - * - * @implNote For performance reasons, Postea assumes that the BlockConversionInfo that was passed to the handler - * hasn't been modified if you return a null value. This isn't enforced though since returning a null - * value after doing some modifications has a couple niche uses. eg: having separate handlers for - * different migrations of a single thing that can be sunset at different times down the line. - * - * @param originalId The id of the block to transform. - * @param transformer The transformer to apply. - */ - @Deprecated - @SuppressWarnings("unused") - public static void addBlockReplacement(String originalId, - BiFunction transformer) { - if (transformer == null) throw new IllegalArgumentException("transformer is null"); - addTransformationHandler(originalId, info -> transformer.apply(info, info.world) != null); - } - /** * Adds a custom transformer for a given id. * diff --git a/src/main/java/com/gtnewhorizons/postea/api/ItemStackReplacementManager.java b/src/main/java/com/gtnewhorizons/postea/api/ItemStackReplacementManager.java index 250473c..51a0063 100644 --- a/src/main/java/com/gtnewhorizons/postea/api/ItemStackReplacementManager.java +++ b/src/main/java/com/gtnewhorizons/postea/api/ItemStackReplacementManager.java @@ -2,7 +2,6 @@ package com.gtnewhorizons.postea.api; import java.util.function.BiFunction; import java.util.function.Consumer; -import java.util.function.Function; import javax.annotation.Nonnull; @@ -28,40 +27,6 @@ public abstract class ItemStackReplacementManager { // region custom transformer registration - /** - * Adds a custom transformer for a given id. - * - * @deprecated Use {@link #addTransformationHandler(String, BiFunction)} instead. - * - * @apiNote When the transformer function passed to this function returns a null, value Postea will assume that - * the transformer has failed to identify and run the handler on any other handler function registered - * to the given ID. - *

- * If you need to perform a simple transformations consider using the following methods instead: - *

- * - * @implNote For performance reasons, Postea assumes that the tag that was passed to the handler hasn't been - * modified - * if you return a null value. This isn't enforced though since returning a null value after doing some - * modifications has a couple niche uses. eg: having separate handlers for different migrations of a - * single thing that can be sunset at different times down the line. - * - * @param originalId The id of the item to transform. - * @param transformer The transformer to apply. - */ - @Deprecated - @SuppressWarnings("unused") - public static void addItemReplacement(String originalId, Function transformer) { - if (transformer == null) throw new IllegalArgumentException("transformer is null"); - addTransformationHandler(originalId, (_originalId, tag) -> transformer.apply(tag) != null); - } - /** * Adds a custom transformer for a given id. * diff --git a/src/main/java/com/gtnewhorizons/postea/api/TileEntityReplacementManager.java b/src/main/java/com/gtnewhorizons/postea/api/TileEntityReplacementManager.java index bcad3ec..4169700 100644 --- a/src/main/java/com/gtnewhorizons/postea/api/TileEntityReplacementManager.java +++ b/src/main/java/com/gtnewhorizons/postea/api/TileEntityReplacementManager.java @@ -1,6 +1,5 @@ package com.gtnewhorizons.postea.api; -import java.util.function.BiFunction; import java.util.function.Consumer; import net.minecraft.nbt.NBTTagCompound; @@ -19,16 +18,6 @@ import com.gtnewhorizons.postea.utility.TransformerRegistry; @SuppressWarnings("unused") public abstract class TileEntityReplacementManager { - /** - * @deprecated Superseded by {@link #tileEntityTransformer(String, TriFunction)}. - */ - @Deprecated - public static void tileEntityTransformer(String tileEntityId, - BiFunction transformerFunction) { - if (transformerFunction == null) throw new NullPointerException("transformer is null"); - tileEntityTransformer(tileEntityId, (tag, world, chunk) -> transformerFunction.apply(tag, world)); - } - /** * Register a callback function to transform a tile entity before it's loaded. * Callback returns a {@link BlockInfo} which the tile entity will be transformed into.