diff --git a/gradle.properties b/gradle.properties index e02c57e..ecf46d7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,8 +3,8 @@ org.gradle.jvmargs=-Xmx1G # minecraft, mappings and loader dependencies # check these on https://modmuss50.me/fabric.html -minecraft_version=1.21-pre2 -quilt_mappings=3 +minecraft_version=1.21-pre4 +quilt_mappings=1 loader_version=0.15.11 # mod properties @@ -15,4 +15,4 @@ archives_base_name=rainglow # other dependencies java_version=21 mod_menu_version=11.0.0-beta.1 -fabric_api_version=0.99.4+1.21 +fabric_api_version=0.100.0+1.21 diff --git a/src/main/java/io/ix0rai/rainglow/Rainglow.java b/src/main/java/io/ix0rai/rainglow/Rainglow.java index ea0985c..d8474fa 100644 --- a/src/main/java/io/ix0rai/rainglow/Rainglow.java +++ b/src/main/java/io/ix0rai/rainglow/Rainglow.java @@ -54,7 +54,7 @@ public void onInitialize() { } public static Identifier id(String id) { - return Identifier.method_60655(MOD_ID, id); + return Identifier.of(MOD_ID, id); } public static String generateRandomColourId(World world, RandomGenerator random) { diff --git a/src/main/java/io/ix0rai/rainglow/config/CustomModeScreen.java b/src/main/java/io/ix0rai/rainglow/config/CustomModeScreen.java index 0493e58..1e56d4a 100644 --- a/src/main/java/io/ix0rai/rainglow/config/CustomModeScreen.java +++ b/src/main/java/io/ix0rai/rainglow/config/CustomModeScreen.java @@ -30,22 +30,22 @@ public CustomModeScreen(Screen parent) { super(parent, MinecraftClient.getInstance().options, TITLE); this.saveButton = ButtonWidget.builder( - Rainglow.translatableText("config.save"), - button -> { - boolean hasColourSelected = false; - for (DeferredSaveOption option : this.options) { - if (option.deferredValue) { - hasColourSelected = true; - break; + Rainglow.translatableText("config.save"), + button -> { + boolean hasColourSelected = false; + for (DeferredSaveOption option : this.options) { + if (option.deferredValue) { + hasColourSelected = true; + break; + } } - } - - if (!hasColourSelected) { - sendNoColoursToast(); - } else { - this.save(); - } - }).build(); + + if (!hasColourSelected) { + sendNoColoursToast(); + } else { + this.save(); + } + }).build(); this.saveButton.active = false; } @@ -54,15 +54,15 @@ private void createColourToggles() { for (RainglowColour colour : RainglowColour.values()) { this.options.add(DeferredSaveOption.createDeferredBoolean( - "colour." + colour.getId(), - null, - Rainglow.CONFIG.customColours.getRealValue().contains(colour.getId()), - enabled -> { - if (enabled) { - Rainglow.CONFIG.customColours.getRealValue().add(colour.getId()); - } - }, - enabled -> this.saveButton.active = true + "colour." + colour.getId(), + null, + Rainglow.CONFIG.customColours.getRealValue().contains(colour.getId()), + enabled -> { + if (enabled) { + Rainglow.CONFIG.customColours.getRealValue().add(colour.getId()); + } + }, + enabled -> this.saveButton.active = true )); } } diff --git a/src/main/java/io/ix0rai/rainglow/config/RainglowConfigScreen.java b/src/main/java/io/ix0rai/rainglow/config/RainglowConfigScreen.java index 819f40d..ca600bf 100644 --- a/src/main/java/io/ix0rai/rainglow/config/RainglowConfigScreen.java +++ b/src/main/java/io/ix0rai/rainglow/config/RainglowConfigScreen.java @@ -101,10 +101,10 @@ public void init() { contentLayout.add(gridWidget); contentLayout.add(ButtonWidget.builder( - Rainglow.translatableText("config.custom"), - button -> MinecraftClient.getInstance().setScreen(new CustomModeScreen(this)) - ).width(308).position(4, 0).build(), - LayoutSettings.create().setPadding(4, 0)); + Rainglow.translatableText("config.custom"), + button -> MinecraftClient.getInstance().setScreen(new CustomModeScreen(this)) + ).width(308).position(4, 0).build(), + LayoutSettings.create().setPadding(4, 0)); headerFooterWidget.addToContents(contentLayout); @@ -132,14 +132,14 @@ private DeferredSaveOption createEntityToggle(RainglowEntity entity) { private DeferredSaveOption createColourRaritySlider(RainglowEntity entity) { return sliders.computeIfAbsent(entity, e -> DeferredSaveOption.createDeferredRangedInt( - "config." + e.getId() + "_rarity", - "tooltip.rarity", - Rainglow.CONFIG.rarities.getRealValue().get(e.getId()), - 0, - 100, - rarity -> Rainglow.CONFIG.rarities.getRealValue().put(e.getId(), rarity), + "config." + e.getId() + "_rarity", + "tooltip.rarity", + Rainglow.CONFIG.rarities.getRealValue().get(e.getId()), + 0, + 100, + rarity -> Rainglow.CONFIG.rarities.getRealValue().put(e.getId(), rarity), rarity -> this.saveButton.active = true - )); + )); } public CyclingButtonWidget createModeButton() { diff --git a/src/main/java/io/ix0rai/rainglow/data/RainglowColour.java b/src/main/java/io/ix0rai/rainglow/data/RainglowColour.java index 20f057a..0b29c6b 100644 --- a/src/main/java/io/ix0rai/rainglow/data/RainglowColour.java +++ b/src/main/java/io/ix0rai/rainglow/data/RainglowColour.java @@ -58,15 +58,15 @@ public Identifier getTexture(RainglowEntity entityType) { switch (entity) { case GLOW_SQUID -> { String textureName = RainglowEntity.GLOW_SQUID.getDefaultColour() == this ? "glow_squid" : this.getId(); - this.textures.put(entity, Identifier.method_60656("textures/entity/squid/" + textureName + ".png")); + this.textures.put(entity, Identifier.ofDefault("textures/entity/squid/" + textureName + ".png")); } case ALLAY -> { String textureName = RainglowEntity.ALLAY.getDefaultColour() == this ? "allay" : this.getId(); - this.textures.put(entity, Identifier.method_60656("textures/entity/allay/" + textureName + ".png")); + this.textures.put(entity, Identifier.ofDefault("textures/entity/allay/" + textureName + ".png")); } case SLIME -> { String textureName = RainglowEntity.SLIME.getDefaultColour() == this ? "slime" : this.getId(); - this.textures.put(entity, Identifier.method_60656("textures/entity/slime/" + textureName + ".png")); + this.textures.put(entity, Identifier.ofDefault("textures/entity/slime/" + textureName + ".png")); } } }