diff --git a/build.gradle b/build.gradle index cef7fc7b..9455f6fe 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,8 @@ repositories { maven { url = "https://api.modrinth.com/maven" } // LazyDFU maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu maven { url = "https://mvn.devos.one/snapshots/" } // Create, Porting Lib, Forge Tags, Milk Lib, Registrate - maven { url = "https://cursemaven.com" } // Forge Config API Port + maven { url = "https://mvn.devos.one/releases/" } // Porting Lib Releases + maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API Port maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM maven { url = "https://maven.tterrag.com/" } // Flywheel diff --git a/changelog/1.2.15.md b/changelog/1.2.15.md new file mode 100644 index 00000000..d17f586f --- /dev/null +++ b/changelog/1.2.15.md @@ -0,0 +1,4 @@ +## Create: Enchantment Industry 1.2.15 + +### Update +- Update to Create Fabric 0.5.1-F diff --git a/gradle.properties b/gradle.properties index caed17ca..c7aa8f14 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx2G # Mod Info maven_group = plus.dragons.createenchantmentindustry archives_base_name = create_enchantment_industry -mod_version = 1.2.14 +mod_version = 1.2.15 minecraft_version = 1.20.1 @@ -20,7 +20,7 @@ parchment_version = 2023.09.03 # Create # https://modrinth.com/mod/create-fabric/versions -create_version = 0.5.1-d-build.1161+mc1.20.1 +create_version = 0.5.1-f-build.1335+mc1.20.1 # Development QOL # Create supports all 3 recipe viewers: JEI, REI, and EMI. This decides which is enabled at runtime. @@ -38,4 +38,4 @@ modmenu_version = 7.2.2 # LazyDFU - https://modrinth.com/mod/lazydfu/versions lazydfu_version = 0.1.3 # DragonLib - https://github.com/DragonsPlusMinecraft/CreateDragonLib-Fabric -dragonlib_version = 1.4.1 +dragonlib_version = 1.4.2 diff --git a/src/main/java/plus/dragons/createenchantmentindustry/compat/jei/category/DisenchanterDrawable.java b/src/main/java/plus/dragons/createenchantmentindustry/compat/jei/category/DisenchanterDrawable.java index e2264ef3..3f756ba2 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/compat/jei/category/DisenchanterDrawable.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/compat/jei/category/DisenchanterDrawable.java @@ -10,7 +10,7 @@ import com.simibubi.create.foundation.gui.UIRenderHelper; import com.simibubi.create.foundation.gui.element.GuiGameElement; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; import mezz.jei.api.gui.drawable.IDrawable; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.renderer.LightTexture; diff --git a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/DisenchantRecipe.java b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/DisenchantRecipe.java index 6e6cf1d8..ad841720 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/DisenchantRecipe.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/DisenchantRecipe.java @@ -4,7 +4,7 @@ import com.simibubi.create.content.processing.recipe.ProcessingRecipeBuilder; import io.github.fabricators_of_create.porting_lib.transfer.item.ItemStackHandlerContainer; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; import net.minecraft.world.level.Level; import plus.dragons.createenchantmentindustry.entry.CeiFluids; import plus.dragons.createenchantmentindustry.entry.CeiRecipeTypes; diff --git a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/DisenchanterBlockEntity.java b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/DisenchanterBlockEntity.java index 19db934e..2a438775 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/DisenchanterBlockEntity.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/DisenchanterBlockEntity.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; + import org.jetbrains.annotations.Nullable; import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation; @@ -23,7 +25,6 @@ import io.github.fabricators_of_create.porting_lib.transfer.TransferUtil; import io.github.fabricators_of_create.porting_lib.transfer.item.ItemHandlerHelper; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; import net.fabricmc.fabric.api.transfer.v1.storage.Storage; diff --git a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/DisenchanterRenderer.java b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/DisenchanterRenderer.java index e6c45461..6a78c329 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/DisenchanterRenderer.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/DisenchanterRenderer.java @@ -10,7 +10,7 @@ import com.simibubi.create.foundation.fluid.FluidRenderer; import com.simibubi.create.foundation.render.ShadowRenderHelper; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.block.model.ItemTransforms; diff --git a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/Disenchanting.java b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/Disenchanting.java index 9246fa2c..46bc7495 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/Disenchanting.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/disenchanter/Disenchanting.java @@ -11,7 +11,7 @@ import io.github.fabricators_of_create.porting_lib.transfer.TransferUtil; import io.github.fabricators_of_create.porting_lib.transfer.item.ItemStackHandlerContainer; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; import net.minecraft.util.Mth; import net.minecraft.world.inventory.AnvilMenu; diff --git a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/enchanter/BlazeEnchanterBlockEntity.java b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/enchanter/BlazeEnchanterBlockEntity.java index fa2ac384..dde9209b 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/enchanter/BlazeEnchanterBlockEntity.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/enchanter/BlazeEnchanterBlockEntity.java @@ -26,7 +26,7 @@ import io.github.fabricators_of_create.porting_lib.transfer.TransferUtil; import io.github.fabricators_of_create.porting_lib.transfer.item.ItemHandlerHelper; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; import io.github.fabricators_of_create.porting_lib.util.LazyOptional; import io.github.fabricators_of_create.porting_lib.util.NBTSerializer; import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; diff --git a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/PrinterBlockEntity.java b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/PrinterBlockEntity.java index 94630cd3..b5397e9a 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/PrinterBlockEntity.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/PrinterBlockEntity.java @@ -21,7 +21,7 @@ import com.simibubi.create.foundation.blockEntity.behaviour.fluid.SmartFluidTankBehaviour; import com.simibubi.create.foundation.utility.VecHelper; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; import io.github.fabricators_of_create.porting_lib.util.LazyOptional; import io.github.fabricators_of_create.porting_lib.util.NBTSerializer; import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; diff --git a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/PrinterRenderer.java b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/PrinterRenderer.java index dc72cf9e..34455cda 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/PrinterRenderer.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/PrinterRenderer.java @@ -7,7 +7,7 @@ import com.simibubi.create.foundation.fluid.FluidRenderer; import com.simibubi.create.foundation.render.CachedBufferer; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; diff --git a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/Printing.java b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/Printing.java index e7e032f7..ca8541fc 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/Printing.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/enchanting/printer/Printing.java @@ -2,7 +2,7 @@ import org.jetbrains.annotations.Nullable; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; import net.minecraft.world.item.ItemStack; diff --git a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/fluids/experience/ExperienceEffectHandler.java b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/fluids/experience/ExperienceEffectHandler.java index ad01e747..9ad1aeb8 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/fluids/experience/ExperienceEffectHandler.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/fluids/experience/ExperienceEffectHandler.java @@ -4,7 +4,7 @@ import com.simibubi.create.foundation.ponder.PonderWorld; import com.simibubi.create.foundation.utility.VecHelper; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.ExperienceOrb; diff --git a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/fluids/experience/HyperExperienceOrb.java b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/fluids/experience/HyperExperienceOrb.java index 9ad20abd..3c3d8e76 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/fluids/experience/HyperExperienceOrb.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/fluids/experience/HyperExperienceOrb.java @@ -1,6 +1,6 @@ package plus.dragons.createenchantmentindustry.content.contraptions.fluids.experience; -import io.github.fabricators_of_create.porting_lib.entity.ExtraSpawnDataEntity; +import io.github.fabricators_of_create.porting_lib.entity.IEntityAdditionalSpawnData; import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.protocol.Packet; @@ -14,7 +14,7 @@ import plus.dragons.createenchantmentindustry.entry.CeiEntityTypes; import plus.dragons.createenchantmentindustry.entry.CeiFluids; -public class HyperExperienceOrb extends ExperienceOrb implements ExtraSpawnDataEntity { +public class HyperExperienceOrb extends ExperienceOrb implements IEntityAdditionalSpawnData { public HyperExperienceOrb(Level level, double x, double y, double z, int value) { this(CeiEntityTypes.HYPER_EXPERIENCE_ORB.get(), level); diff --git a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/fluids/experience/MendingBySpout.java b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/fluids/experience/MendingBySpout.java index 074bc89c..9efba548 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/fluids/experience/MendingBySpout.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/content/contraptions/fluids/experience/MendingBySpout.java @@ -4,7 +4,7 @@ import org.jetbrains.annotations.Nullable; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; import net.minecraft.util.Mth; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.EnchantmentHelper; diff --git a/src/main/java/plus/dragons/createenchantmentindustry/entry/CeiBlocks.java b/src/main/java/plus/dragons/createenchantmentindustry/entry/CeiBlocks.java index 86e71a20..e9f2c9fd 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/entry/CeiBlocks.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/entry/CeiBlocks.java @@ -20,7 +20,7 @@ public class CeiBlocks { static { - REGISTRATE.useCreativeTab(AllCreativeModeTabs.MAIN_TAB.key()); + REGISTRATE.setCreativeTab(AllCreativeModeTabs.BASE_CREATIVE_TAB.key()); } public static final BlockEntry DISENCHANTER = REGISTRATE diff --git a/src/main/java/plus/dragons/createenchantmentindustry/entry/CeiFluids.java b/src/main/java/plus/dragons/createenchantmentindustry/entry/CeiFluids.java index 25066036..82925d29 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/entry/CeiFluids.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/entry/CeiFluids.java @@ -38,7 +38,7 @@ public class CeiFluids { static { - REGISTRATE.useCreativeTab(AllCreativeModeTabs.MAIN_TAB.key()); + REGISTRATE.setCreativeTab(AllCreativeModeTabs.BASE_CREATIVE_TAB.key()); } public static final ResourceLocation EXPERIENCE_STILL_RL = EnchantmentIndustry.genRL("fluid/experience_still"); diff --git a/src/main/java/plus/dragons/createenchantmentindustry/entry/CeiItems.java b/src/main/java/plus/dragons/createenchantmentindustry/entry/CeiItems.java index 76383392..e90807e5 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/entry/CeiItems.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/entry/CeiItems.java @@ -18,7 +18,7 @@ public class CeiItems { static { - REGISTRATE.useCreativeTab(AllCreativeModeTabs.MAIN_TAB.key()); + REGISTRATE.setCreativeTab(AllCreativeModeTabs.BASE_CREATIVE_TAB.key()); } public static final ItemEntry ENCHANTING_GUIDE = REGISTRATE.item("enchanting_guide", EnchantingGuideItem::new) diff --git a/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/AbstractFurnaceBlockEntityMixin.java b/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/AbstractFurnaceBlockEntityMixin.java index 6cefc200..4a7d9e9b 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/AbstractFurnaceBlockEntityMixin.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/AbstractFurnaceBlockEntityMixin.java @@ -38,7 +38,7 @@ import plus.dragons.createenchantmentindustry.entry.CeiFluids; import io.github.fabricators_of_create.porting_lib.transfer.TransferUtil; import io.github.fabricators_of_create.porting_lib.transfer.fluid.FluidTank; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; import plus.dragons.createenchantmentindustry.EnchantmentIndustry; diff --git a/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/FillingBySpoutMixin.java b/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/FillingBySpoutMixin.java index de15b697..83d6cebc 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/FillingBySpoutMixin.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/FillingBySpoutMixin.java @@ -7,7 +7,7 @@ import com.simibubi.create.content.fluids.spout.FillingBySpout; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import plus.dragons.createenchantmentindustry.content.contraptions.fluids.experience.MendingBySpout; diff --git a/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/OpenEndedPipeInvoker.java b/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/OpenEndedPipeInvoker.java index 28de57a5..7e39dc81 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/OpenEndedPipeInvoker.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/OpenEndedPipeInvoker.java @@ -5,7 +5,7 @@ import com.simibubi.create.content.fluids.OpenEndedPipe; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; @Mixin(OpenEndedPipe.class) public interface OpenEndedPipeInvoker { diff --git a/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/PlayerMixin.java b/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/PlayerMixin.java index 5bee206e..80c1491f 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/PlayerMixin.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/PlayerMixin.java @@ -1,10 +1,11 @@ package plus.dragons.createenchantmentindustry.foundation.mixin; +import net.fabricmc.fabric.api.entity.FakePlayer; + import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.ModifyVariable; -import io.github.fabricators_of_create.porting_lib.fake_players.FakePlayer; import io.github.fabricators_of_create.porting_lib.tool.ToolActions; import net.minecraft.world.InteractionHand; import net.minecraft.world.entity.player.Player; diff --git a/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/RegistrateDisplayItemsGeneratorMixin.java b/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/fabric/RegistrateDisplayItemsGeneratorMixin.java similarity index 63% rename from src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/RegistrateDisplayItemsGeneratorMixin.java rename to src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/fabric/RegistrateDisplayItemsGeneratorMixin.java index 79649ef2..64747386 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/RegistrateDisplayItemsGeneratorMixin.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/foundation/mixin/fabric/RegistrateDisplayItemsGeneratorMixin.java @@ -1,53 +1,44 @@ -package plus.dragons.createenchantmentindustry.foundation.mixin; +package plus.dragons.createenchantmentindustry.foundation.mixin.fabric; import static plus.dragons.createenchantmentindustry.EnchantmentIndustry.REGISTRATE; -import plus.dragons.createenchantmentindustry.entry.CeiBlocks; -import plus.dragons.createenchantmentindustry.entry.CeiItems; -import plus.dragons.createenchantmentindustry.entry.CeiFluids; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.List; +import java.util.Map; +import java.util.function.Predicate; +import java.util.function.Supplier; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.simibubi.create.AllBlocks; -import com.simibubi.create.AllItems; -import com.simibubi.create.AllFluids; import com.simibubi.create.AllCreativeModeTabs; -import com.simibubi.create.AllCreativeModeTabs.RegistrateDisplayItemsGenerator; +import com.simibubi.create.AllFluids; +import com.simibubi.create.AllItems; +import com.simibubi.create.foundation.data.CreateRegistrate; import com.tterrag.registrate.util.entry.RegistryEntry; -import com.tterrag.registrate.util.entry.ItemProviderEntry; + import it.unimi.dsi.fastutil.objects.ReferenceArrayList; import it.unimi.dsi.fastutil.objects.ReferenceLinkedOpenHashSet; -import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceKey; -import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.BlockItem; -import net.minecraft.world.item.BucketItem; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; -import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.material.Fluid; -import org.spongepowered.asm.mixin.Debug; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.ModifyVariable; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import org.spongepowered.asm.mixin.injection.callback.LocalCapture; +import plus.dragons.createenchantmentindustry.entry.CeiBlocks; +import plus.dragons.createenchantmentindustry.entry.CeiFluids; +import plus.dragons.createenchantmentindustry.entry.CeiItems; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.function.Function; -import java.util.function.Predicate; -import java.lang.reflect.Method; -import java.lang.reflect.InvocationTargetException; +@Deprecated +@Mixin(targets = "com.simibubi.create.AllCreativeModeTabs$RegistrateDisplayItemsGenerator") +public abstract class RegistrateDisplayItemsGeneratorMixin { -@Mixin(RegistrateDisplayItemsGenerator.class) -public abstract class RegistrateDisplayItemsGeneratorMixin implements CreativeModeTab.DisplayItemsGenerator { + @Shadow(remap = false) @Final private Supplier tabFilter; @SuppressWarnings("unchecked") private static void addOrdering(List orderings, String name, Item item, Item anchor) { @@ -69,19 +60,17 @@ private static void addOrdering(List orderings, String name, Item item, Item anc try { ordering = method.invoke(null, item, anchor); - } catch (InvocationTargetException e) { - throw new RuntimeException(e); - } catch (IllegalAccessException e) { + } catch (InvocationTargetException | IllegalAccessException e) { throw new RuntimeException(e); } - orderings.add(ordering); + orderings.add(ordering); } @Inject(method = "makeOrderings", at = @At(value = "TAIL"), cancellable = true, remap = false) private static void injectMakeOrderingsReturn(CallbackInfoReturnable> cir) { - List orderings = cir.getReturnValue(); + List orderings = cir.getReturnValue(); Map afterOrderings = Map.of( CeiBlocks.DISENCHANTER.asItem(), AllBlocks.ITEM_DRAIN.asItem(), @@ -99,11 +88,11 @@ private static void injectMakeOrderingsReturn(CallbackInfoReturnable> ci cir.setReturnValue(orderings); } - @Inject(method = "collectBlocks", at = @At(value = "TAIL"), cancellable = true) - private void injectCollectBlocks(ResourceKey tab, Predicate exclusionPredicate, CallbackInfoReturnable> cir) { + @Inject(method = "collectBlocks", at = @At(value = "TAIL"), cancellable = true, remap = false) + private void injectCollectBlocks(Predicate exclusionPredicate, CallbackInfoReturnable> cir) { List items = cir.getReturnValue(); for (RegistryEntry entry : REGISTRATE.getAll(Registries.BLOCK)) { - if (!REGISTRATE.isInCreativeTab(entry, tab)) + if (!CreateRegistrate.isInCreativeTab(entry, tabFilter.get().key())) continue; Item item = entry.get().asItem(); if (item == Items.AIR) @@ -111,26 +100,18 @@ private void injectCollectBlocks(ResourceKey tab, Predicate entry : com.simibubi.create.Create.REGISTRATE.getAll(Registries.FLUID)) { - var item = entry.get().getBucket().asItem(); - if (item instanceof BucketItem) - items.add(item); - } cir.setReturnValue(new ReferenceArrayList<>(new ReferenceLinkedOpenHashSet<>(items))); } - @Inject(method = "collectItems", at = @At(value = "TAIL"), cancellable = true) - private void injectCollectItems(ResourceKey tab, Predicate is3d, boolean special, Predicate exclusionPredicate, CallbackInfoReturnable> cir) { + @Inject(method = "collectItems", at = @At(value = "TAIL"), cancellable = true, remap = false) + private void injectCollectItems(Predicate exclusionPredicate, CallbackInfoReturnable> cir) { List items = cir.getReturnValue(); for (RegistryEntry entry : REGISTRATE.getAll(Registries.ITEM)) { - if (!REGISTRATE.isInCreativeTab(entry, tab)) + if (!CreateRegistrate.isInCreativeTab(entry, tabFilter.get().key())) continue; Item item = entry.get(); if (item instanceof BlockItem) continue; - if (is3d.test(item) != special) - continue; if (!exclusionPredicate.test(item)) items.add(item); } diff --git a/src/main/java/plus/dragons/createenchantmentindustry/foundation/ponder/content/EnchantmentScenes.java b/src/main/java/plus/dragons/createenchantmentindustry/foundation/ponder/content/EnchantmentScenes.java index 2b444dc6..f70ac074 100644 --- a/src/main/java/plus/dragons/createenchantmentindustry/foundation/ponder/content/EnchantmentScenes.java +++ b/src/main/java/plus/dragons/createenchantmentindustry/foundation/ponder/content/EnchantmentScenes.java @@ -24,7 +24,7 @@ import com.simibubi.create.foundation.utility.Pointing; import io.github.fabricators_of_create.porting_lib.transfer.TransferUtil; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; import io.github.fabricators_of_create.porting_lib.util.NBTSerializer; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/src/main/resources/create_enchantment_industry.mixins.json b/src/main/resources/create_enchantment_industry.mixins.json index d1d8e341..25074253 100644 --- a/src/main/resources/create_enchantment_industry.mixins.json +++ b/src/main/resources/create_enchantment_industry.mixins.json @@ -6,7 +6,7 @@ "mixins": [ "AbstractFurnaceBlockEntityMixin", "BasinBlockEntityMixin", - "RegistrateDisplayItemsGeneratorMixin", + "fabric.RegistrateDisplayItemsGeneratorMixin", "CrushingWheelControllerBlockEntityMixin", "DeployerFakePlayerMixin", "FillingBySpoutMixin",