From 6cf9589674d24532afc9aec78a12866107f2571c Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Wed, 22 Jun 2022 17:58:14 +0200 Subject: [PATCH] Update to MC 1.19 --- gradle.properties | 10 +++++----- .../integratedcrafting/RegistryEntries.java | 8 ++++---- .../ContainerScreenPartInterfaceCrafting.java | 3 +-- ...ainerScreenPartInterfaceCraftingSettings.java | 9 ++++----- .../core/CraftingJobHandler.java | 2 +- .../crafting/processoverride/CraftingGrid.java | 7 ++++++- .../core/part/PartTypeCraftingBase.java | 13 ++++++------- .../part/PartTypeInterfaceCrafting.java | 16 ++++++++-------- src/main/resources/META-INF/mods.toml | 10 +++++----- 9 files changed, 40 insertions(+), 38 deletions(-) diff --git a/gradle.properties b/gradle.properties index 139da2e5..1ebf4808 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,12 @@ mod_version=1.0.23 -minecraft_version=1.18.2 -forge_version=40.0.54 -cyclopscore_version=1.13.4-158 -integrateddynamics_version=1.18.2-1.10.13-249 +minecraft_version=1.19 +forge_version=41.0.35 +cyclopscore_version=1.15.0-208 +integrateddynamics_version=1.19-1.11.3-312 release_type=release fingerprint=bd0353b3e8a2810d60dd584e256e364bc3bedd44 -commoncapabilities_version=1.18.2-2.8.2-54 +commoncapabilities_version=1.19-2.8.2-63 # Workaround for Spotless bug # https://github.com/diffplug/spotless/issues/834 diff --git a/src/main/java/org/cyclops/integratedcrafting/RegistryEntries.java b/src/main/java/org/cyclops/integratedcrafting/RegistryEntries.java index 1d469902..2b544481 100644 --- a/src/main/java/org/cyclops/integratedcrafting/RegistryEntries.java +++ b/src/main/java/org/cyclops/integratedcrafting/RegistryEntries.java @@ -13,14 +13,14 @@ */ public class RegistryEntries { - @ObjectHolder("integratedcrafting:part_interface_crafting") + @ObjectHolder(registryName = "item", value = "integratedcrafting:part_interface_crafting") public static final Item ITEM_PART_INTERFACE_CRAFTING = null; - @ObjectHolder("integrateddynamics:variable") + @ObjectHolder(registryName = "item", value = "integrateddynamics:variable") public static final ItemVariable ITEM_VARIABLE = null; - @ObjectHolder("integratedcrafting:part_interface_crafting") + @ObjectHolder(registryName = "menu", value = "integratedcrafting:part_interface_crafting") public static final MenuType CONTAINER_INTERFACE_CRAFTING = null; - @ObjectHolder("integratedcrafting:part_interface_crafting_settings") + @ObjectHolder(registryName = "menu", value = "integratedcrafting:part_interface_crafting_settings") public static final MenuType CONTAINER_INTERFACE_CRAFTING_SETTINGS = null; } diff --git a/src/main/java/org/cyclops/integratedcrafting/client/gui/ContainerScreenPartInterfaceCrafting.java b/src/main/java/org/cyclops/integratedcrafting/client/gui/ContainerScreenPartInterfaceCrafting.java index f8a4ecf3..25e9fb36 100644 --- a/src/main/java/org/cyclops/integratedcrafting/client/gui/ContainerScreenPartInterfaceCrafting.java +++ b/src/main/java/org/cyclops/integratedcrafting/client/gui/ContainerScreenPartInterfaceCrafting.java @@ -3,7 +3,6 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; import org.cyclops.cyclopscore.client.gui.component.button.ButtonImage; @@ -32,7 +31,7 @@ public ContainerScreenPartInterfaceCrafting(ContainerPartInterfaceCrafting conta public void init() { super.init(); addRenderableWidget(new ButtonImage(this.leftPos + 155, this.topPos + 4, 15, 15, - new TranslatableComponent("gui.integrateddynamics.part_settings"), + Component.translatable("gui.integrateddynamics.part_settings"), createServerPressable(ContainerMultipartAspects.BUTTON_SETTINGS, b -> {}), true, Images.CONFIG_BOARD, -2, -3)); } diff --git a/src/main/java/org/cyclops/integratedcrafting/client/gui/ContainerScreenPartInterfaceCraftingSettings.java b/src/main/java/org/cyclops/integratedcrafting/client/gui/ContainerScreenPartInterfaceCraftingSettings.java index d7be0539..9f798c2a 100644 --- a/src/main/java/org/cyclops/integratedcrafting/client/gui/ContainerScreenPartInterfaceCraftingSettings.java +++ b/src/main/java/org/cyclops/integratedcrafting/client/gui/ContainerScreenPartInterfaceCraftingSettings.java @@ -7,7 +7,6 @@ import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; import org.cyclops.commoncapabilities.api.ingredient.IngredientComponent; @@ -95,7 +94,7 @@ public void init() { ingredientComponentSideSelector = new WidgetArrowedListField>(font, leftPos + 106, topPos + 9, 68, 15, true, - new TranslatableComponent("gui.integratedcrafting.partsettings.ingredient"), + Component.translatable("gui.integratedcrafting.partsettings.ingredient"), true, Lists.newArrayList(IngredientComponent.REGISTRY.getValues())) { @Override protected String activeElementToString(IngredientComponent element) { @@ -107,7 +106,7 @@ protected String activeElementToString(IngredientComponent element) { dropdownEntries = Arrays.stream(Direction.values()).map(SideDropdownEntry::new).collect(Collectors.toList()); dropdownFieldSide = new WidgetTextFieldDropdown(font, leftPos + 106, topPos + 34, - 68, 14, new TranslatableComponent("gui.integrateddynamics.partsettings.side"), + 68, 14, Component.translatable("gui.integrateddynamics.partsettings.side"), true, Sets.newHashSet(dropdownEntries)); setSideInDropdownField(selectedIngredientComponent, ((ContainerPartInterfaceCraftingSettings) container).getTargetSideOverrideValue(selectedIngredientComponent)); dropdownFieldSide.setMaxLength(15); @@ -116,7 +115,7 @@ protected String activeElementToString(IngredientComponent element) { dropdownFieldSide.setCanLoseFocus(true); numberFieldChannelInterfaceCrafting = new WidgetNumberField(font, leftPos + 106, topPos + 134, 70, 14, - true, new TranslatableComponent("gui.integratedcrafting.partsettings.channel.interface"), true); + true, Component.translatable("gui.integratedcrafting.partsettings.channel.interface"), true); numberFieldChannelInterfaceCrafting.setPositiveOnly(false); numberFieldChannelInterfaceCrafting.setMaxLength(15); numberFieldChannelInterfaceCrafting.setVisible(true); @@ -124,7 +123,7 @@ protected String activeElementToString(IngredientComponent element) { numberFieldChannelInterfaceCrafting.setCanLoseFocus(true); checkboxFieldDisabledCraftingCheck = new ButtonCheckbox(leftPos + 110, topPos + 159, 110, 10, - new TranslatableComponent("gui.integratedcrafting.partsettings.craftingcheckdisabled"), (entry) -> {}); + Component.translatable("gui.integratedcrafting.partsettings.craftingcheckdisabled"), (entry) -> {}); this.refreshValues(); } diff --git a/src/main/java/org/cyclops/integratedcrafting/core/CraftingJobHandler.java b/src/main/java/org/cyclops/integratedcrafting/core/CraftingJobHandler.java index 70905315..caaac817 100644 --- a/src/main/java/org/cyclops/integratedcrafting/core/CraftingJobHandler.java +++ b/src/main/java/org/cyclops/integratedcrafting/core/CraftingJobHandler.java @@ -94,7 +94,7 @@ public void writeToNBT(CompoundTag tag) { CompoundTag ingredientInstance = new CompoundTag(); IngredientComponent ingredientComponent = ingredientComponentListEntry.getKey(); - ingredientInstance.putString("ingredientComponent", ingredientComponent.getRegistryName().toString()); + ingredientInstance.putString("ingredientComponent", IngredientComponent.REGISTRY.getKey(ingredientComponent).toString()); ListTag instances = new ListTag(); IIngredientSerializer serializer = ingredientComponent.getSerializer(); diff --git a/src/main/java/org/cyclops/integratedcrafting/core/crafting/processoverride/CraftingGrid.java b/src/main/java/org/cyclops/integratedcrafting/core/crafting/processoverride/CraftingGrid.java index a758ba7b..19ea8326 100644 --- a/src/main/java/org/cyclops/integratedcrafting/core/crafting/processoverride/CraftingGrid.java +++ b/src/main/java/org/cyclops/integratedcrafting/core/crafting/processoverride/CraftingGrid.java @@ -2,8 +2,8 @@ import com.google.common.collect.Sets; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.item.ItemStack; import org.cyclops.commoncapabilities.api.ingredient.IMixedIngredients; import org.cyclops.commoncapabilities.api.ingredient.IngredientComponent; @@ -19,6 +19,11 @@ public class CraftingGrid extends CraftingContainer { public CraftingGrid(IMixedIngredients ingredients, int rows, int columns) { super(new AbstractContainerMenu(null, 0) { + @Override + public ItemStack quickMoveStack(Player p_38941_, int p_38942_) { + return ItemStack.EMPTY; + } + @Override public boolean stillValid(Player playerIn) { return false; diff --git a/src/main/java/org/cyclops/integratedcrafting/core/part/PartTypeCraftingBase.java b/src/main/java/org/cyclops/integratedcrafting/core/part/PartTypeCraftingBase.java index 5d58971b..09e0766b 100644 --- a/src/main/java/org/cyclops/integratedcrafting/core/part/PartTypeCraftingBase.java +++ b/src/main/java/org/cyclops/integratedcrafting/core/part/PartTypeCraftingBase.java @@ -1,14 +1,13 @@ package org.cyclops.integratedcrafting.core.part; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.entity.player.Inventory; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.chat.Component; import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.MenuProvider; import net.minecraft.world.SimpleContainer; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.MenuProvider; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.TranslatableComponent; import org.apache.commons.lang3.tuple.Triple; import org.cyclops.cyclopscore.init.ModBase; import org.cyclops.cyclopscore.network.PacketCodec; @@ -47,7 +46,7 @@ public Optional getContainerProvider(PartPos pos) { @Override public Component getDisplayName() { - return new TranslatableComponent(getTranslationKey()); + return Component.translatable(getTranslationKey()); } @Nullable diff --git a/src/main/java/org/cyclops/integratedcrafting/part/PartTypeInterfaceCrafting.java b/src/main/java/org/cyclops/integratedcrafting/part/PartTypeInterfaceCrafting.java index e0059716..9f69691d 100644 --- a/src/main/java/org/cyclops/integratedcrafting/part/PartTypeInterfaceCrafting.java +++ b/src/main/java/org/cyclops/integratedcrafting/part/PartTypeInterfaceCrafting.java @@ -14,8 +14,8 @@ import net.minecraft.nbt.ListTag; import net.minecraft.nbt.Tag; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.MenuProvider; @@ -109,7 +109,7 @@ public Optional getContainerProvider(PartPos pos) { @Override public MutableComponent getDisplayName() { - return new TranslatableComponent(getTranslationKey()); + return Component.translatable(getTranslationKey()); } @Override @@ -138,7 +138,7 @@ public Optional getContainerProviderSettings(PartPos pos) { @Override public MutableComponent getDisplayName() { - return new TranslatableComponent(getTranslationKey()); + return Component.translatable(getTranslationKey()); } @Override @@ -370,7 +370,7 @@ public void writeToNBT(CompoundTag tag) { ListTag instanceTags = new ListTag(); for (IngredientInstanceWrapper instanceWrapper : inventoryOutputBuffer) { CompoundTag instanceTag = new CompoundTag(); - instanceTag.putString("component", instanceWrapper.getComponent().getRegistryName().toString()); + instanceTag.putString("component", IngredientComponent.REGISTRY.getKey(instanceWrapper.getComponent()).toString()); instanceTag.put("instance", instanceWrapper.getComponent().getSerializer().serializeInstance(instanceWrapper.getInstance())); instanceTags.add(instanceTag); } @@ -515,19 +515,19 @@ protected void reloadRecipe(int slot) { if (!GeneralConfig.validateRecipesCraftingInterface || this.disableCraftingCheck || isValid(recipe)) { this.currentRecipes.put(slot, recipe); this.recipeSlotValidated.put(slot, true); - this.recipeSlotMessages.put(slot, new TranslatableComponent("gui.integratedcrafting.partinterface.slot.message.valid")); + this.recipeSlotMessages.put(slot, Component.translatable("gui.integratedcrafting.partinterface.slot.message.valid")); } else { - this.recipeSlotMessages.put(slot, new TranslatableComponent("gui.integratedcrafting.partinterface.slot.message.invalid")); + this.recipeSlotMessages.put(slot, Component.translatable("gui.integratedcrafting.partinterface.slot.message.invalid")); } } } else { - this.recipeSlotMessages.put(slot, new TranslatableComponent("gui.integratedcrafting.partinterface.slot.message.norecipe")); + this.recipeSlotMessages.put(slot, Component.translatable("gui.integratedcrafting.partinterface.slot.message.norecipe")); } } catch (EvaluationException e) { this.recipeSlotMessages.put(slot, e.getErrorMessage()); } } else { - this.recipeSlotMessages.put(slot, new TranslatableComponent("gui.integratedcrafting.partinterface.slot.message.norecipe")); + this.recipeSlotMessages.put(slot, Component.translatable("gui.integratedcrafting.partinterface.slot.message.norecipe")); } try { diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 357c06ea..299d46a1 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="[40,)" +loaderVersion="[41,)" issueTrackerURL="https://github.com/CyclopsMC/IntegratedCrafting/issues" displayURL="https://www.curseforge.com/minecraft/mc-mods/integrated-crafting" license="MIT" @@ -16,13 +16,13 @@ Craft stuff in Integrated Dynamics networks. [[dependencies.integratedcrafting]] modId="cyclopscore" mandatory=true - versionRange="[1.13.4,)" + versionRange="[1.15.0,)" ordering="NONE" side="BOTH" [[dependencies.integratedcrafting]] modId="integrateddynamics" mandatory=true - versionRange="[1.10.13,)" + versionRange="[1.11.3,)" ordering="NONE" side="BOTH" [[dependencies.integratedcrafting]] @@ -34,12 +34,12 @@ Craft stuff in Integrated Dynamics networks. [[dependencies.integratedcrafting]] modId="forge" mandatory=true - versionRange="[40,)" + versionRange="[41,)" ordering="NONE" side="BOTH" [[dependencies.integratedcrafting]] modId="minecraft" mandatory=true - versionRange="[1.18.2,]" + versionRange="[1.19,]" ordering="NONE" side="BOTH"