Skip to content

Commit

Permalink
Update to MC 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jun 22, 2022
1 parent 625a62c commit 6cf9589
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 38 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ContainerPartInterfaceCrafting> CONTAINER_INTERFACE_CRAFTING = null;
@ObjectHolder("integratedcrafting:part_interface_crafting_settings")
@ObjectHolder(registryName = "menu", value = "integratedcrafting:part_interface_crafting_settings")
public static final MenuType<ContainerPartInterfaceCraftingSettings> CONTAINER_INTERFACE_CRAFTING_SETTINGS = null;

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -95,7 +94,7 @@ public void init() {

ingredientComponentSideSelector = new WidgetArrowedListField<IngredientComponent<?, ?>>(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) {
Expand All @@ -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);
Expand All @@ -116,15 +115,15 @@ 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);
numberFieldChannelInterfaceCrafting.setTextColor(16777215);
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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -47,7 +46,7 @@ public Optional<MenuProvider> getContainerProvider(PartPos pos) {

@Override
public Component getDisplayName() {
return new TranslatableComponent(getTranslationKey());
return Component.translatable(getTranslationKey());
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -109,7 +109,7 @@ public Optional<MenuProvider> getContainerProvider(PartPos pos) {

@Override
public MutableComponent getDisplayName() {
return new TranslatableComponent(getTranslationKey());
return Component.translatable(getTranslationKey());
}

@Override
Expand Down Expand Up @@ -138,7 +138,7 @@ public Optional<MenuProvider> getContainerProviderSettings(PartPos pos) {

@Override
public MutableComponent getDisplayName() {
return new TranslatableComponent(getTranslationKey());
return Component.translatable(getTranslationKey());
}

@Override
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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]]
Expand All @@ -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"

0 comments on commit 6cf9589

Please sign in to comment.