Skip to content

Commit

Permalink
Update to patch f
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Mar 9, 2024
1 parent d55f761 commit ebb598b
Show file tree
Hide file tree
Showing 25 changed files with 68 additions and 80 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions changelog/1.2.15.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Create: Enchantment Industry 1.2.15

### Update
- Update to Create Fabric 0.5.1-F
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<DisenchanterBlock> DISENCHANTER = REGISTRATE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<EnchantingGuideItem> ENCHANTING_GUIDE = REGISTRATE.item("enchanting_guide", EnchantingGuideItem::new)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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<AllCreativeModeTabs.TabInfo> tabFilter;

@SuppressWarnings("unchecked")
private static void addOrdering(List orderings, String name, Item item, Item anchor) {
Expand All @@ -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<List<?>> cir)
{
List orderings = cir.getReturnValue();
List<?> orderings = cir.getReturnValue();

Map<Item, Item> afterOrderings = Map.of(
CeiBlocks.DISENCHANTER.asItem(), AllBlocks.ITEM_DRAIN.asItem(),
Expand All @@ -99,38 +88,30 @@ private static void injectMakeOrderingsReturn(CallbackInfoReturnable<List<?>> ci
cir.setReturnValue(orderings);
}

@Inject(method = "collectBlocks", at = @At(value = "TAIL"), cancellable = true)
private void injectCollectBlocks(ResourceKey<CreativeModeTab> tab, Predicate<Item> exclusionPredicate, CallbackInfoReturnable<List<Item>> cir) {
@Inject(method = "collectBlocks", at = @At(value = "TAIL"), cancellable = true, remap = false)
private void injectCollectBlocks(Predicate<Item> exclusionPredicate, CallbackInfoReturnable<List<Item>> cir) {
List<Item> items = cir.getReturnValue();
for (RegistryEntry<Block> 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)
continue;
if (!exclusionPredicate.test(item))
items.add(item);
}
// Seems like a bug? upstream that the normal fluid buckets are unavailable
for (RegistryEntry<Fluid> 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<CreativeModeTab> tab, Predicate<Item> is3d, boolean special, Predicate<Item> exclusionPredicate, CallbackInfoReturnable<List<Item>> cir) {
@Inject(method = "collectItems", at = @At(value = "TAIL"), cancellable = true, remap = false)
private void injectCollectItems(Predicate<Item> exclusionPredicate, CallbackInfoReturnable<List<Item>> cir) {
List<Item> items = cir.getReturnValue();
for (RegistryEntry<Item> 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/create_enchantment_industry.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"mixins": [
"AbstractFurnaceBlockEntityMixin",
"BasinBlockEntityMixin",
"RegistrateDisplayItemsGeneratorMixin",
"fabric.RegistrateDisplayItemsGeneratorMixin",
"CrushingWheelControllerBlockEntityMixin",
"DeployerFakePlayerMixin",
"FillingBySpoutMixin",
Expand Down

0 comments on commit ebb598b

Please sign in to comment.