From 32a4b0006a53976059f5dbf97f5e659f0705fde5 Mon Sep 17 00:00:00 2001 From: Oth3r Date: Wed, 27 Nov 2024 10:42:50 -0600 Subject: [PATCH] 1.20.6 port --- src/main/java/one/oth3r/sit/file/CustomBlock.java | 2 +- src/main/java/one/oth3r/sit/file/CustomItem.java | 4 ++-- src/main/java/one/oth3r/sit/screen/ConfigScreen.java | 8 +++----- .../one/oth3r/sit/screen/UnderConstructionScreen.java | 4 ++-- src/main/java/one/oth3r/sit/utl/Utl.java | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/java/one/oth3r/sit/file/CustomBlock.java b/src/main/java/one/oth3r/sit/file/CustomBlock.java index 0c4f5e7..2bd4c04 100644 --- a/src/main/java/one/oth3r/sit/file/CustomBlock.java +++ b/src/main/java/one/oth3r/sit/file/CustomBlock.java @@ -89,7 +89,7 @@ public class CustomBlock { for (String tag : blockTags) { // substring to remove # and if needed, ! // if there is a math for the NOT(!) tag, return false - if (tag.startsWith("!") && blockState.isIn(TagKey.of(Registries.BLOCK.getKey(), Identifier.of(tag.substring(2))))) return false; + if (tag.startsWith("!") && blockState.isIn(TagKey.of(Registries.BLOCK.getKey(), new Identifier(tag.substring(2))))) return false; // if there is a match, return true if (blockState.isIn(TagKey.of(Registries.BLOCK.getKey(), Identifier.tryParse(tag.substring(1))))) tagCheck = true; } diff --git a/src/main/java/one/oth3r/sit/file/CustomItem.java b/src/main/java/one/oth3r/sit/file/CustomItem.java index ec1ef5f..05515f6 100644 --- a/src/main/java/one/oth3r/sit/file/CustomItem.java +++ b/src/main/java/one/oth3r/sit/file/CustomItem.java @@ -53,10 +53,10 @@ public class CustomItem { // if a NOT tag if (tag.startsWith("!")) { // if there is a math for the NOT(!) tag, return false - if (itemStack.isIn(TagKey.of(Registries.ITEM.getKey(), Identifier.of(tag.substring(2))))) return false; + if (itemStack.isIn(TagKey.of(Registries.ITEM.getKey(), new Identifier(tag.substring(2))))) return false; } // else (normal tag), if there is a match, set tagCheck to true - else if (itemStack.isIn(TagKey.of(Registries.ITEM.getKey(), Identifier.of(tag.substring(1))))) tagCheck = true; + else if (itemStack.isIn(TagKey.of(Registries.ITEM.getKey(), new Identifier(tag.substring(1))))) tagCheck = true; } // not returning true in the loop because there might be a (!) not tag that the item might fall into, after the item was already in another tag diff --git a/src/main/java/one/oth3r/sit/screen/ConfigScreen.java b/src/main/java/one/oth3r/sit/screen/ConfigScreen.java index 4f058d1..637bd6a 100644 --- a/src/main/java/one/oth3r/sit/screen/ConfigScreen.java +++ b/src/main/java/one/oth3r/sit/screen/ConfigScreen.java @@ -10,8 +10,6 @@ import net.minecraft.util.Identifier; import one.oth3r.sit.file.FileData; import one.oth3r.sit.utl.Data; -import java.net.URI; - public class ConfigScreen extends Screen { protected final Screen parent; @@ -36,13 +34,13 @@ public class ConfigScreen extends Screen { TextureButtonWidget issuesButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.issues"), - ConfirmLinkScreen.opening(this, URI.create("https://github.com/Oth3r/Sit/issues")), true) + ConfirmLinkScreen.opening(this, "https://github.com/Oth3r/Sit/issues"), true) .dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "issues"), 15, 15).build()); issuesButton.setPosition(this.width / 2 - 125, startY + 72 + 12); this.addDrawableChild(ButtonWidget.builder(Text.translatable("sit!.gui.button.website"), - ConfirmLinkScreen.opening(this, URI.create("https://modrinth.com/mod/sit!")) + ConfirmLinkScreen.opening(this, "https://modrinth.com/mod/sit!") ).dimensions(this.width / 2 - 100, startY + 72 + 12, 98, 20).build()); this.addDrawableChild(ButtonWidget.builder(Text.translatable("gui.done"), (button) -> { @@ -50,7 +48,7 @@ public class ConfigScreen extends Screen { }).dimensions(this.width / 2 + 2, startY + 72 + 12, 98, 20).build()); TextureButtonWidget donateButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.donate"), - ConfirmLinkScreen.opening(this, URI.create("https://Ko-fi.com/oth3r")), true) + ConfirmLinkScreen.opening(this, "https://Ko-fi.com/oth3r"), true) .dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "donate"), 15, 15).build()); donateButton.setPosition(this.width / 2 + 105, startY + 72 + 12); } diff --git a/src/main/java/one/oth3r/sit/screen/UnderConstructionScreen.java b/src/main/java/one/oth3r/sit/screen/UnderConstructionScreen.java index 8395f35..ba418fc 100644 --- a/src/main/java/one/oth3r/sit/screen/UnderConstructionScreen.java +++ b/src/main/java/one/oth3r/sit/screen/UnderConstructionScreen.java @@ -29,7 +29,7 @@ public class UnderConstructionScreen> extends Screen { protected void init() { int startY = this.height / 5-4; ButtonWidget foxPNG = this.addDrawableChild(new ClickableImageWidget(70,70,140,140, Tooltip.of(Text.of("Art by @bunnestbun")), - Identifier.of(Data.MOD_ID, "textures/gui/fox.png"), ConfirmLinkScreen.opening(this, URI.create("https://www.instagram.com/bunnestbun/")))); + Identifier.of(Data.MOD_ID, "textures/gui/fox.png"), ConfirmLinkScreen.opening(this, "https://www.instagram.com/bunnestbun/"))); foxPNG.setPosition(this.width / 2 - (foxPNG.getWidth()/2), startY-35); ButtonWidget openFileButton = this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("sit!.gui.button.file"), @@ -38,7 +38,7 @@ public class UnderConstructionScreen> extends Screen { openFileButton.setPosition(this.width / 2 - 70, startY+110); TextureButtonWidget folderButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.folder"), - (button) -> Util.getOperatingSystem().open(Paths.get(this.file.getFile().getParent())), true) + (button) -> Util.getOperatingSystem().open(this.file.getFile().getParent()), true) .dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "folder"), 15, 15).build()); folderButton.setPosition(this.width / 2 + 50, startY + 110); diff --git a/src/main/java/one/oth3r/sit/utl/Utl.java b/src/main/java/one/oth3r/sit/utl/Utl.java index 561b5f4..03e6cd1 100644 --- a/src/main/java/one/oth3r/sit/utl/Utl.java +++ b/src/main/java/one/oth3r/sit/utl/Utl.java @@ -366,7 +366,7 @@ public class Utl { player.sendMessage(messageTag().append(Utl.lang("sit!.chat.purged",Utl.lang("sit!.chat.purged.total",count).styled( style -> style.withColor(Colors.LIGHT_GRAY).withItalic(true) )).styled( - style -> style.withColor(Colors.GREEN) + style -> style.withColor(Formatting.GREEN) ))); } }