diff options
author | Juuz <6596629+Juuxel@users.noreply.github.com> | 2022-05-19 20:40:47 +0300 |
---|---|---|
committer | Juuz <6596629+Juuxel@users.noreply.github.com> | 2022-05-19 20:40:47 +0300 |
commit | c4d292e7e5000ba8fb226d6f62c3ac5f18c11fa8 (patch) | |
tree | b2dbd371dee2dba647e57664d96c27d7a06fb640 | |
parent | b869afcefbc4598e1f9d72409bbc08d76ef4477e (diff) | |
download | LibGui-c4d292e7e5000ba8fb226d6f62c3ac5f18c11fa8.tar.gz LibGui-c4d292e7e5000ba8fb226d6f62c3ac5f18c11fa8.tar.bz2 LibGui-c4d292e7e5000ba8fb226d6f62c3ac5f18c11fa8.zip |
Update to 1.19-pre1
- API change: WItem now uses TagKey instead of Tag.
4 files changed, 18 insertions, 16 deletions
diff --git a/gradle.properties b/gradle.properties index 30c5df4..4c7bd65 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,17 +3,17 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=22w16b - yarn_mappings=22w16b+build.7 - loader_version=0.14.2 + minecraft_version=1.19-pre1 + yarn_mappings=1.19-pre1+build.1 + loader_version=0.14.5 # Mod Properties - mod_version = 6.0.0-beta.2 + mod_version = 6.0.0-beta.3 maven_group = io.github.cottonmc archives_base_name = LibGui # Dependencies - fabric_version=0.51.2+1.19 - jankson_version=4.1.0+j1.2.1 + fabric_version=0.52.4+1.19 + jankson_version=4.1.1+j1.2.1 modmenu_version=3.1.1 libninepatch_version=1.1.0 diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java b/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java index f436819..4fcb3f2 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java @@ -146,8 +146,7 @@ public class ScreenDrawing { buffer.vertex(model, x + width, y + height, 0).texture(u2, v2).next(); buffer.vertex(model, x + width, y, 0).texture(u2, v1).next(); buffer.vertex(model, x, y, 0).texture(u1, v1).next(); - buffer.end(); - BufferRenderer.method_43433(buffer); + BufferRenderer.drawWithShader(buffer.end()); RenderSystem.disableBlend(); } diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java index 21abe8b..178f6c5 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java @@ -9,7 +9,9 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.Item; import net.minecraft.item.ItemConvertible; import net.minecraft.item.ItemStack; -import net.minecraft.tag.Tag; +import net.minecraft.tag.TagKey; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.registry.RegistryEntry; import com.google.common.collect.ImmutableList; @@ -32,7 +34,7 @@ public class WItem extends WWidget { setItems(items); } - public WItem(Tag<? extends ItemConvertible> tag) { + public WItem(TagKey<? extends ItemConvertible> tag) { this(getRenderStacks(tag)); } @@ -104,13 +106,15 @@ public class WItem extends WWidget { } /** - * Gets the render stacks ({@link Item#getStackForRender()}) of each item in a tag. + * Gets the default stacks ({@link Item#getDefaultStack()} ()}) of each item in a tag. */ - private static List<ItemStack> getRenderStacks(Tag<? extends ItemConvertible> tag) { + @SuppressWarnings("unchecked") + private static List<ItemStack> getRenderStacks(TagKey<? extends ItemConvertible> tag) { + Registry<ItemConvertible> registry = (Registry<ItemConvertible>) Registry.REGISTRIES.get(tag.registry().getValue()); ImmutableList.Builder<ItemStack> builder = ImmutableList.builder(); - for (ItemConvertible item : tag.values()) { - builder.add(new ItemStack(item)); + for (RegistryEntry<ItemConvertible> item : registry.getOrCreateEntryList((TagKey<ItemConvertible>) tag)) { + builder.add(item.value().asItem().getDefaultStack()); } return builder.build(); diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java index f92107e..69c8755 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java @@ -261,8 +261,7 @@ public class WTextField extends WWidget { buffer.vertex(model, x + width, y + height, 0).next(); buffer.vertex(model, x + width, y, 0).next(); buffer.vertex(model, x, y, 0).next(); - buffer.end(); - BufferRenderer.method_43433(buffer); + BufferRenderer.drawWithShader(buffer.end()); RenderSystem.disableColorLogicOp(); RenderSystem.enableTexture(); } |