Skip to content

Commit

Permalink
port to 1.20.3-1.21.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tildejustin committed Nov 20, 2024
1 parent 585c6ea commit af297fa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ org.gradle.jvmargs=-Xmx1G

# More versions available at: https://grayray75.github.io/LegacyFabric-Versions/
# Fabric Properties
minecraft_version = 1.19.4
minecraft_version_range = 1.19.x-1.20.x
yarn_mappings=1.19.4+build.2
loader_version=0.14.21
minecraft_version = 1.20.4
minecraft_version_range = 1.20.3-1.21.1
yarn_mappings=1.20.4+build.3
loader_version=0.14.24

# Mod Properties
mod_version = 1.4.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static void tryLoadNewWorld() {
e.printStackTrace();
}
resetTracker.addWorld(newSave);
MinecraftClient.getInstance().createIntegratedServerLoader().start(MinecraftClient.getInstance().currentScreen, newSave.getName());
MinecraftClient.getInstance().createIntegratedServerLoader().start(newSave.getName(), () -> {});
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void init() {
((SelectWorldScreenAccessor) this).setRecreateButton(new ButtonWidget(0, 0, 0, 0, Text.of(""), (buttonWidget) -> {
}, ButtonWidget.DEFAULT_NARRATION_SUPPLIER));
((SelectWorldScreenAccessor) this).setSearchBox(new TextFieldWidget(this.textRenderer, this.width / 2 - 100, 22, 200, 20, this.searchBox, Text.translatable("selectWorld.search")));
((SelectWorldScreenAccessor) this).setLevelList(new WorldListWidget(this, this.client, this.width, this.height, 48, this.height - 64, 36, ((SelectWorldScreenAccessor) this).getSearchBox().getText(), ((SelectWorldScreenAccessor) this).getLevelList()));
((SelectWorldScreenAccessor) this).setLevelList(new WorldListWidget(this, this.client, this.width, this.height - 112, 48, 36, ((SelectWorldScreenAccessor) this).getSearchBox().getText(), ((SelectWorldScreenAccessor) this).getLevelList()));
this.addDrawableChild(((SelectWorldScreenAccessor) this).getSearchBox());
this.addDrawableChild(((SelectWorldScreenAccessor) this).getLevelList());

Expand All @@ -49,7 +49,7 @@ public void init() {
((SelectWorldScreenAccessor) this).getLevelList().load();
}, ButtonWidget.DEFAULT_NARRATION_SUPPLIER));
this.addDrawableChild(new ButtonWidget(this.width / 4 * 3 + 3, this.height - 28, this.width / 4 - 6, 20, Text.translatable("gui.cancel"), (buttonWidget) -> this.client.setScreen(this.parent), ButtonWidget.DEFAULT_NARRATION_SUPPLIER));
this.worldSelected(false, false);
this.worldSelected(null);
this.setInitialFocus(((SelectWorldScreenAccessor) this).getSearchBox());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@Mixin(MinecraftClient.class)
public abstract class MinecraftClientMixin {
@Inject(method = {"reloadResources(Z)Ljava/util/concurrent/CompletableFuture;", "reloadResourcesConcurrently"}, at = @At(value = "HEAD"), cancellable = true)
@Inject(method = {"reloadResources(ZLnet/minecraft/client/MinecraftClient$LoadingContext;)Ljava/util/concurrent/CompletableFuture;", "reloadResourcesConcurrently"}, at = @At(value = "HEAD"), cancellable = true)
private void custommapresetter$stopResourceReload(CallbackInfoReturnable<CompletableFuture<Void>> cir) {
if (CustomMapResetter.running) {
if (CustomMapResetter.loadedTextures) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package xyz.tildejustin.custommapresetter.mixin;

import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.text.Text;
Expand Down Expand Up @@ -41,9 +41,9 @@ protected TitleScreenMixin(Text title) {
}

@Inject(method = "render", at = @At("TAIL"))
private void custommapresetter$goldBootsOverlay(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
private void custommapresetter$goldBootsOverlay(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
// this.minecraft.getTextureManager().bindTexture(BUTTON_IMAGE);
// (this.width / 2 - 124 + 2, this.height / 4 + 48 + 2, 0.0F, 0.0F, 16, 16, 16, 16);
MinecraftClient.getInstance().getItemRenderer().renderGuiItemIcon(matrices, new ItemStack(Items.DIAMOND_BOOTS), this.width / 2 - 124 + 2, this.height / 4 + 48 + 2);
// (this.width / 2 - 124 + 2, this.height / 4 + 48 + 2, 0.0F, 0.xt0F, 16, 16, 16, 16);
context.drawItem(new ItemStack(Items.DIAMOND_BOOTS), this.width / 2 - 124 + 2, this.height / 4 + 48 + 2);
}
}

0 comments on commit af297fa

Please sign in to comment.