Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 1.20.4 #105

Open
wants to merge 1 commit into
base: 1.20
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions HEADER
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Copyright © ${YEAR} LambdAurora <[email protected]>
Copyright © ${CREATION_YEAR} LambdAurora <[email protected]>

This file is part of LambdaBetterGrass.

Licensed under the MIT license. For more information,
see the LICENSE file.

;;year_selection: file
;;year_display: creation_only
#year_selection file
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'org.quiltmc.loom' version '1.2.+'
id 'org.quiltmc.gradle.licenser' version '2.0.+'
id 'dev.yumi.gradle.licenser' version '1.1.+'
id 'java-library'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.1.2'
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
org.gradle.jvmargs=-Xmx1G

# Quilt Properties
minecraft_version=1.20.1
quilt_mappings=23
loader_version=0.20.0-beta.11
qsl_version=6.1.1
fabric_api_version=7.1.1+0.86.1
minecraft_version=1.20.4
quilt_mappings=3
loader_version=0.26.0-beta.1
qsl_version=8.0.0-alpha.13
fabric_api_version=9.0.0-alpha.8+0.97.0

# Mod Properties
mod_version=1.5.2
Expand All @@ -16,5 +16,5 @@ modrinth_id=2Uev7LdA
curseforge_id=400322

# Dependencies
spruceui_version=5.0.0+1.20
modmenu_version=7.0.1
spruceui_version=5.0.3+1.20.4
modmenu_version=9.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import org.jetbrains.annotations.NotNull;
import org.quiltmc.loader.api.ModContainer;
import org.quiltmc.qsl.base.api.entrypoint.client.ClientModInitializer;
import org.quiltmc.qsl.resource.loader.api.PackActivationType;
import org.quiltmc.qsl.resource.loader.api.ResourceLoader;
import org.quiltmc.qsl.resource.loader.api.ResourcePackActivationType;
import org.quiltmc.qsl.resource.loader.api.client.ClientResourceLoaderEvents;
import org.slf4j.Logger;

Expand All @@ -38,7 +38,7 @@
* @version 1.5.2
* @since 1.0.0
*/
public class LambdaBetterGrass implements ClientModInitializer, ClientResourceLoaderEvents.EndResourcePackReload {
public class LambdaBetterGrass implements ClientModInitializer, ClientResourceLoaderEvents.EndPackReload {
public static final String NAMESPACE = "lambdabettergrass";
public static final Logger LOGGER = LogUtils.getLogger();
/* Default masks */
Expand All @@ -58,10 +58,10 @@ public void onInitializeClient(ModContainer mod) {
this.log("Initializing LambdaBetterGrass...");
this.config.load();

ResourceLoader.registerBuiltinResourcePack(id("default"), mod, ResourcePackActivationType.DEFAULT_ENABLED);
ResourceLoader.registerBuiltinResourcePack(id("32x"), mod, ResourcePackActivationType.NORMAL);
ResourceLoader.registerBuiltinPack(id("default"), mod, PackActivationType.DEFAULT_ENABLED);
ResourceLoader.registerBuiltinPack(id("32x"), mod, PackActivationType.NORMAL);

ResourceLoader.get(ResourceType.CLIENT_RESOURCES).getRegisterTopResourcePackEvent()
ResourceLoader.get(ResourceType.CLIENT_RESOURCES).getRegisterTopPackEvent()
.register(id("register_pack"), context -> {
this.log("Rebuilding resources and inject generated resource pack.");
context.addResourcePack(this.resourcePack = new LBGResourcePack(this));
Expand Down Expand Up @@ -97,7 +97,7 @@ public void onInitializeClient(ModContainer mod) {
}

@Override
public void onEndResourcePackReload(ClientResourceLoaderEvents.EndResourcePackReload.Context context) {
public void onEndPackReload(ClientResourceLoaderEvents.EndPackReload.Context context) {
if (this.config.isDebug()) {
this.resourcePack.dumpTo(Path.of("debug/lbg_out"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.ClickableWidget;
import net.minecraft.client.gui.widget.button.ButtonWidget;
import net.minecraft.client.option.GameOptions;
import net.minecraft.client.option.Option;
import net.minecraft.text.Text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ protected void init() {
super.init();
int buttonHeight = 20;

this.addDrawableChild(this.modeOption.createWidget(Position.of(this, this.width / 2 - 205, this.height / 4 - buttonHeight),
this.addSelectableElement(this.modeOption.createWidget(Position.of(this, this.width / 2 - 205, this.height / 4 - buttonHeight),
200));
this.addDrawableChild(this.betterSnowOption.createWidget(Position.of(this.width / 2 + 5, this.height / 4 - buttonHeight), 200));
this.addSelectableElement(this.betterSnowOption.createWidget(Position.of(this.width / 2 + 5, this.height / 4 - buttonHeight), 200));

this.buildLabels();

this.addDrawableChild(this.resetOption.createWidget(Position.of(this, this.width / 2 - 155, this.height - 29), 150));
this.addDrawableChild(new SpruceButtonWidget(Position.of(this, this.width / 2 - 155 + 160, this.height - 29), 150,
this.addSelectableElement(this.resetOption.createWidget(Position.of(this, this.width / 2 - 155, this.height - 29), 150));
this.addSelectableElement(new SpruceButtonWidget(Position.of(this, this.width / 2 - 155 + 160, this.height - 29), 150,
buttonHeight, SpruceTexts.GUI_DONE,
(buttonWidget) -> this.closeScreen()));
}
Expand All @@ -114,14 +114,14 @@ private void buildLabels() {
text.append(Text.translatable("lambdabettergrass.menu.info.1")).append("\n");
text.append(Text.translatable("lambdabettergrass.menu.info.2")).append(" ");
text.append(Text.translatable("lambdabettergrass.menu.info.3")).append("\n");
var widget = this.addDrawableChild(new SpruceLabelWidget(Position.of(this, 0, y),
var widget = this.addSelectableElement(new SpruceLabelWidget(Position.of(this, 0, y),
text, this.width, true));
var readMore = new SpruceLabelWidget(Position.of(this, 0, y + 5 + widget.getHeight()),
Text.translatable("lambdabettergrass.menu.info.read_more", null, "[lambdaurora.dev]").formatted(Formatting.GREEN),
Text.translatable("lambdabettergrass.menu.info.read_more", "[lambdaurora.dev]").formatted(Formatting.GREEN),
this.width,
label -> Util.getOperatingSystem().open(API_URL), true);
readMore.setTooltip(Text.translatable("chat.link.open"));
this.addDrawableChild(readMore);
this.addSelectableElement(readMore);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void onConstruct(Screen parent, GameOptions gameOptions, CallbackInfo ci
method = "init",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/gui/widget/ButtonListWidget;addEntries([Lnet/minecraft/client/option/Option;)V"
target = "Lnet/minecraft/client/gui/widget/list/ButtonListWidget;addEntries([Lnet/minecraft/client/option/Option;)V"
),
index = 0
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
import dev.lambdaurora.lambdabettergrass.LambdaBetterGrass;
import net.minecraft.resource.ResourceType;
import net.minecraft.util.Identifier;
import org.quiltmc.qsl.resource.loader.api.InMemoryResourcePack;
import org.quiltmc.qsl.resource.loader.api.InMemoryPack;

import java.io.IOException;
import java.util.Set;

public class LBGResourcePack extends InMemoryResourcePack {
public class LBGResourcePack extends InMemoryPack {
private static final Set<String> NAMESPACES = Sets.newHashSet(LambdaBetterGrass.NAMESPACE);

private final LambdaBetterGrass mod;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/resourcepacks/32x/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack": {
"pack_format": 9,
"pack_format": 22,
"description": "LambdaBetterGrass - 32x32 extension."
}
}
2 changes: 1 addition & 1 deletion src/main/resources/resourcepacks/default/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack": {
"pack_format": 9,
"pack_format": 22,
"description": "LambdaBetterGrass - Default extension."
}
}