From 229e8af7987b3214909791e1ded0924448dbf43f Mon Sep 17 00:00:00 2001 From: trinsdar <30245301+Trinsdar@users.noreply.github.com> Date: Sat, 28 Oct 2023 00:02:25 -0400 Subject: [PATCH] updated to 1.19 --- build.gradle | 2 +- gradle.properties | 8 ++++---- .../api/bracket/FabricBracketValidators.java | 3 ++- .../blamejared/crafttweaker/api/fluid/IFluidStack.java | 6 ++++-- .../crafttweaker/api/fluid/MCFluidStack.java | 9 +++++---- .../crafttweaker/api/fluid/MCFluidStackMutable.java | 10 +++++----- 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index b08bb75..cd8047b 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ dependencies { // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - modImplementation("com.blamejared.crafttweaker:CraftTweaker-fabric-1.18.2:${project.crafttweaker_version}") + modImplementation("com.blamejared.crafttweaker:CraftTweaker-fabric-1.19.2:${project.crafttweaker_version}") } processResources { diff --git a/gradle.properties b/gradle.properties index a9638f3..baba0be 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,8 +3,8 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.18.2 -yarn_mappings=1.18.2+build.3 +minecraft_version=1.19.2 +yarn_mappings=1.19.2+build.3 loader_version=0.14.6 # Mod Properties @@ -13,5 +13,5 @@ maven_group = trinsdar archives_base_name = ct-fabric-fluid-support # Dependencies -fabric_version=0.53.0+1.18.2 -crafttweaker_version=9.1.162 +fabric_version=0.76.0+1.19.2 +crafttweaker_version=10.1.50 diff --git a/src/main/java/com/blamejared/crafttweaker/api/bracket/FabricBracketValidators.java b/src/main/java/com/blamejared/crafttweaker/api/bracket/FabricBracketValidators.java index 691f27e..7ec0ec1 100644 --- a/src/main/java/com/blamejared/crafttweaker/api/bracket/FabricBracketValidators.java +++ b/src/main/java/com/blamejared/crafttweaker/api/bracket/FabricBracketValidators.java @@ -5,6 +5,7 @@ import com.blamejared.crafttweaker.api.annotation.ZenRegister; import com.blamejared.crafttweaker.platform.Services; import com.blamejared.crafttweaker_annotations.annotations.Document; +import net.minecraft.core.Registry; import net.minecraft.resources.ResourceLocation; import org.openzen.zencode.java.ZenCodeType; @@ -22,7 +23,7 @@ public static boolean validateFluidStack(String tokens) { return false; } - if(Services.REGISTRY.fluids().containsKey(resourceLocation)) { + if(Registry.FLUID.containsKey(resourceLocation)) { return true; } diff --git a/src/main/java/com/blamejared/crafttweaker/api/fluid/IFluidStack.java b/src/main/java/com/blamejared/crafttweaker/api/fluid/IFluidStack.java index 26faf0f..dfef19d 100644 --- a/src/main/java/com/blamejared/crafttweaker/api/fluid/IFluidStack.java +++ b/src/main/java/com/blamejared/crafttweaker/api/fluid/IFluidStack.java @@ -2,9 +2,11 @@ import com.blamejared.crafttweaker.api.annotation.ZenRegister; import com.blamejared.crafttweaker.api.bracket.CommandStringDisplayable; +import com.blamejared.crafttweaker.api.data.IData; import com.blamejared.crafttweaker.api.data.MapData; import com.blamejared.crafttweaker.platform.Services; import com.blamejared.crafttweaker_annotations.annotations.Document; +import net.minecraft.core.Registry; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.material.Fluid; import org.openzen.zencode.java.ZenCodeType; @@ -25,7 +27,7 @@ public interface IFluidStack extends CommandStringDisplayable { @ZenCodeType.Getter("registryName") default ResourceLocation getRegistryName() { - return Services.REGISTRY.getRegistryKey(getFluid()); + return Registry.FLUID.getKey(getFluid()); } /** @@ -128,7 +130,7 @@ default long getAmount() { */ @ZenCodeType.Getter("tag") @ZenCodeType.Method - MapData getTag(); + IData getTag(); /** * Sets the tag for the FluidStack. diff --git a/src/main/java/com/blamejared/crafttweaker/api/fluid/MCFluidStack.java b/src/main/java/com/blamejared/crafttweaker/api/fluid/MCFluidStack.java index 7ae2cca..9e399b9 100644 --- a/src/main/java/com/blamejared/crafttweaker/api/fluid/MCFluidStack.java +++ b/src/main/java/com/blamejared/crafttweaker/api/fluid/MCFluidStack.java @@ -1,7 +1,8 @@ package com.blamejared.crafttweaker.api.fluid; +import com.blamejared.crafttweaker.api.data.IData; import com.blamejared.crafttweaker.api.data.MapData; -import com.blamejared.crafttweaker.api.data.base.converter.tag.TagToDataConverter; +import com.blamejared.crafttweaker.api.data.converter.tag.TagToDataConverter; import net.minecraft.core.Registry; import net.minecraft.world.level.material.Fluid; import org.openzen.zencode.java.ZenCodeType; @@ -28,7 +29,7 @@ public String getCommandString() { .append(">"); if(getInternal().hasTag()) { - MapData data = TagToDataConverter.convertCompound(getInternal().tag()).copyInternal(); + IData data = TagToDataConverter.convert(getInternal().tag()).copyInternal(); if(!data.isEmpty()) { builder.append(".withTag("); builder.append(data.asString()); @@ -109,9 +110,9 @@ public IFluidStack withTag(@ZenCodeType.Nullable MapData tag) { } @Override - public MapData getTag() { + public IData getTag() { - return TagToDataConverter.convertCompound(getInternal().tag()); + return TagToDataConverter.convert(getInternal().tag()); } @Override diff --git a/src/main/java/com/blamejared/crafttweaker/api/fluid/MCFluidStackMutable.java b/src/main/java/com/blamejared/crafttweaker/api/fluid/MCFluidStackMutable.java index 8f00914..dd1ab34 100644 --- a/src/main/java/com/blamejared/crafttweaker/api/fluid/MCFluidStackMutable.java +++ b/src/main/java/com/blamejared/crafttweaker/api/fluid/MCFluidStackMutable.java @@ -1,7 +1,8 @@ package com.blamejared.crafttweaker.api.fluid; +import com.blamejared.crafttweaker.api.data.IData; import com.blamejared.crafttweaker.api.data.MapData; -import com.blamejared.crafttweaker.api.data.base.converter.tag.TagToDataConverter; +import com.blamejared.crafttweaker.api.data.converter.tag.TagToDataConverter; import net.minecraft.core.Registry; import net.minecraft.world.level.material.Fluid; import org.openzen.zencode.java.ZenCodeType; @@ -69,9 +70,8 @@ public IFluidStack withTag(MapData tag) { } @Override - public MapData getTag() { - - return TagToDataConverter.convertCompound(getInternal().tag()); + public IData getTag() { + return TagToDataConverter.convert(getInternal().tag()); } @Override @@ -102,7 +102,7 @@ public String getCommandString() { stringBuilder.append(">"); if(getInternal().hasTag()) { - MapData data = TagToDataConverter.convertCompound(getInternal().tag()).copyInternal(); + IData data = TagToDataConverter.convert(getInternal().tag()).copyInternal(); if(!data.isEmpty()) { stringBuilder.append(".withTag("); stringBuilder.append(data.asString());