Skip to content

Commit

Permalink
port to 1.19.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tildejustin committed Nov 20, 2024
1 parent 585c6ea commit 94ec4a8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 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.19.2
minecraft_version_range = 1.19.2
yarn_mappings=1.19.2+build.28
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 @@ -23,11 +23,11 @@ public SetWorldScreen(Screen parent) {
public void init() {
assert this.client != null;
((SelectWorldScreenAccessor) this).setDeleteButton(new ButtonWidget(0, 0, 0, 0, Text.of(""), (buttonWidget) -> {
}, ButtonWidget.DEFAULT_NARRATION_SUPPLIER));
}, ButtonWidget.EMPTY));
((SelectWorldScreenAccessor) this).setEditButton(new ButtonWidget(0, 0, 0, 0, Text.of(""), (buttonWidget) -> {
}, ButtonWidget.DEFAULT_NARRATION_SUPPLIER));
}, ButtonWidget.EMPTY));
((SelectWorldScreenAccessor) this).setRecreateButton(new ButtonWidget(0, 0, 0, 0, Text.of(""), (buttonWidget) -> {
}, ButtonWidget.DEFAULT_NARRATION_SUPPLIER));
}, ButtonWidget.EMPTY));
((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()));
this.addDrawableChild(((SelectWorldScreenAccessor) this).getSearchBox());
Expand All @@ -36,20 +36,20 @@ public void init() {
ButtonWidget selectButton = this.addDrawableChild(new ButtonWidget(3, this.height - 28, this.width / 4 - 6, 20, Text.translatable("selectWorld.title"), (buttonWidget) -> {
CustomMapResetter.resetTracker.setCurrentWorld(((WorldListWidget.WorldEntry) Objects.requireNonNull(((SelectWorldScreenAccessor) this).getLevelList().getSelectedOrNull())).level.getName());
this.client.setScreen(parent);
}, ButtonWidget.DEFAULT_NARRATION_SUPPLIER));
}, ButtonWidget.EMPTY));
((SelectWorldScreenAccessor) this).setSelectButton(selectButton);
this.addDrawableChild(new ButtonWidget(this.width / 4 + 3, this.height - 28, this.width / 4 - 6, 20, Text.of("Autoreset: " + CustomMapResetter.autoreset), (button -> {
CustomMapResetter.autoreset = !CustomMapResetter.autoreset;
button.setMessage(Text.of("Autoreset: " + CustomMapResetter.autoreset));
CustomMapResetter.resetTracker.writeResetCountFile(CustomMapResetter.resetTracker.resetCount, CustomMapResetter.resetTracker.resetCountFile);
}), ButtonWidget.DEFAULT_NARRATION_SUPPLIER));
}), ButtonWidget.EMPTY));
this.addDrawableChild(new ButtonWidget(this.width / 2 + 3, this.height - 28, this.width / 4 - 6, 20, Text.of("Delete Session Worlds"), (buttonWidget) -> {
CustomMapResetter.resetTracker.deleteWorlds();
((SelectWorldScreenAccessor) this).getLevelList().setSearch("");
((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);
}, ButtonWidget.EMPTY));
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.EMPTY));
this.worldSelected(false);
this.setInitialFocus(((SelectWorldScreenAccessor) this).getSearchBox());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected SettingsScreenMixin(Text title) {
MinecraftClient.getInstance().world.disconnect();
MinecraftClient.getInstance().disconnect();
MinecraftClient.getInstance().setScreen(new TitleScreen());
}, ButtonWidget.DEFAULT_NARRATION_SUPPLIER));
}, ButtonWidget.EMPTY));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ protected TitleScreenMixin(Text title) {
} else {
CustomMapResetter.tryLoadNewWorld();
}
}, ButtonWidget.DEFAULT_NARRATION_SUPPLIER));
}, ButtonWidget.EMPTY));
}

@Inject(method = "render", at = @At("TAIL"))
private void custommapresetter$goldBootsOverlay(MatrixStack matrices, 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);
MinecraftClient.getInstance().getItemRenderer().renderGuiItemIcon(new ItemStack(Items.DIAMOND_BOOTS), this.width / 2 - 124 + 2, this.height / 4 + 48 + 2);
}
}
2 changes: 0 additions & 2 deletions src/main/resources/custom-map-resetter.accesswidener
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
accessWidener v1 named
accessible method net/minecraft/client/MinecraftClient render (Z)V
accessible field net/minecraft/client/gui/widget/ButtonWidget DEFAULT_NARRATION_SUPPLIER Lnet/minecraft/client/gui/widget/ButtonWidget$NarrationSupplier;
accessible method net/minecraft/client/gui/widget/ButtonWidget <init> (IIIILnet/minecraft/text/Text;Lnet/minecraft/client/gui/widget/ButtonWidget$PressAction;Lnet/minecraft/client/gui/widget/ButtonWidget$NarrationSupplier;)V
accessible method net/minecraft/client/gui/screen/world/WorldListWidget load ()V
accessible field net/minecraft/client/gui/screen/world/WorldListWidget$WorldEntry level Lnet/minecraft/world/level/storage/LevelSummary;

0 comments on commit 94ec4a8

Please sign in to comment.