Skip to content

Commit 8286f5c

Browse files
committed
1.20
1 parent a43d1ae commit 8286f5c

File tree

7 files changed

+32
-31
lines changed

7 files changed

+32
-31
lines changed

gradle.properties

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,25 @@
22
org.gradle.jvmargs=-Xmx1G
33
# Fabric Properties
44
# check these on https://fabricmc.net/develop
5-
minecraft_base_version=1.19.4
6-
minecraft_version=1.19.4
7-
yarn_mappings=1.19.4+build.1
8-
loader_version=0.14.18
5+
minecraft_base_version=1.20
6+
minecraft_version=1.20
7+
yarn_mappings=1.20+build.1
8+
loader_version=0.14.21
99
# Mod Properties
1010
mod_version=0.3.2
1111
maven_group=com.glisco
1212
archives_base_name=deathlog
1313
# Dependencies
14-
fabric_version=0.76.0+1.19.4
14+
fabric_version=0.83.0+1.20
1515

1616
# https://github.com/emilyploszaj/trinkets/releases
17-
trinkets_version=3.6.0
17+
# while we wait for an official release
18+
# https://maven.wispforest.io/dev/emi/trinkets/
19+
trinkets_version=3.7.0-pre.3
1820

1921
# https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu
20-
modmenu_version=6.1.0-rc.4
22+
modmenu_version=7.0.0-beta.2
2123

2224
# https://maven.wispforest.io/io/wispforest/owo-lib/
23-
owo_version=0.10.3+1.19.4
25+
owo_version=0.11.0+1.20
2426

src/main/java/com/glisco/deathlog/client/ClientDeathLogStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void store(Text deathMessage, PlayerEntity player) {
4747
deathInfo.setProperty(DeathInfo.INVENTORY_KEY, new InventoryProperty(player.getInventory()));
4848

4949
deathInfo.setProperty(DeathInfo.COORDINATES_KEY, new CoordinatesProperty(player.getBlockPos()));
50-
deathInfo.setProperty(DeathInfo.DIMENSION_KEY, new StringProperty("deathlog.deathinfoproperty.dimension", player.world.getRegistryKey().getValue().toString()));
50+
deathInfo.setProperty(DeathInfo.DIMENSION_KEY, new StringProperty("deathlog.deathinfoproperty.dimension", player.getWorld().getRegistryKey().getValue().toString()));
5151

5252
if (client.isInSingleplayer()) {
5353
deathInfo.setProperty(DeathInfo.LOCATION_KEY, new LocationProperty(((MinecraftServerAccessor) client.getServer()).deathlog_getSession().getDirectoryName(), false));

src/main/java/com/glisco/deathlog/client/gui/DeathListEntryContainer.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
package com.glisco.deathlog.client.gui;
22

3-
import io.wispforest.owo.ui.container.HorizontalFlowLayout;
4-
import io.wispforest.owo.ui.core.Animation;
5-
import io.wispforest.owo.ui.core.Easing;
6-
import io.wispforest.owo.ui.core.Insets;
7-
import io.wispforest.owo.ui.core.Sizing;
8-
import io.wispforest.owo.ui.util.Drawer;
3+
import io.wispforest.owo.ui.container.FlowLayout;
4+
import io.wispforest.owo.ui.core.*;
95
import io.wispforest.owo.ui.util.UISounds;
106
import io.wispforest.owo.util.EventSource;
117
import io.wispforest.owo.util.EventStream;
12-
import net.minecraft.client.util.math.MatrixStack;
138
import org.lwjgl.glfw.GLFW;
149

15-
public class DeathListEntryContainer extends HorizontalFlowLayout {
10+
public class DeathListEntryContainer extends FlowLayout {
1611

1712
protected final EventStream<OnSelected> selectedEvents = OnSelected.newStream();
1813
protected final Animation<Insets> slideAnimation;
@@ -21,7 +16,7 @@ public class DeathListEntryContainer extends HorizontalFlowLayout {
2116
protected boolean selected = false;
2217

2318
public DeathListEntryContainer() {
24-
super(Sizing.content(), Sizing.content());
19+
super(Sizing.content(), Sizing.content(), Algorithm.HORIZONTAL);
2520
this.slideAnimation = this.padding.animate(150, Easing.QUADRATIC, this.padding.get().add(0, 0, 5, 0));
2621
}
2722

@@ -30,9 +25,9 @@ public EventSource<OnSelected> onSelected() {
3025
}
3126

3227
@Override
33-
public void draw(MatrixStack matrices, int mouseX, int mouseY, float partialTicks, float delta) {
34-
super.draw(matrices, mouseX, mouseY, partialTicks, delta);
35-
if (this.selected) Drawer.drawRectOutline(matrices, this.x, this.y, this.width, this.height, 0xFFAFAFAF);
28+
public void draw(OwoUIDrawContext context, int mouseX, int mouseY, float partialTicks, float delta) {
29+
super.draw(context, mouseX, mouseY, partialTicks, delta);
30+
if (this.selected) context.drawRectOutline(this.x, this.y, this.width, this.height, 0xFFAFAFAF);
3631
}
3732

3833
@Override

src/main/java/com/glisco/deathlog/client/gui/DeathLogToast.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.glisco.deathlog.client.gui;
22

33
import com.glisco.deathlog.mixin.SystemToastAccessor;
4+
import net.minecraft.client.gui.DrawContext;
45
import net.minecraft.client.toast.SystemToast;
56
import net.minecraft.client.toast.Toast;
67
import net.minecraft.client.toast.ToastManager;
@@ -15,8 +16,8 @@ public DeathLogToast(Type type, Text title, @Nullable Text description) {
1516
}
1617

1718
@Override
18-
public Visibility draw(MatrixStack matrices, ToastManager manager, long startTime) {
19-
super.draw(matrices, manager, startTime);
19+
public Visibility draw(DrawContext context, ToastManager manager, long startTime) {
20+
super.draw(context, manager, startTime);
2021
return startTime - ((SystemToastAccessor) this).deathlog_getStartTime() < 10000L ? Toast.Visibility.SHOW : Toast.Visibility.HIDE;
2122
}
2223
}

src/main/java/com/glisco/deathlog/mixin/TitleScreenMixin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.glisco.deathlog.client.DeathLogClient;
44
import com.glisco.deathlog.client.gui.DeathLogToast;
55
import net.minecraft.client.MinecraftClient;
6+
import net.minecraft.client.gui.DrawContext;
67
import net.minecraft.client.gui.screen.TitleScreen;
78
import net.minecraft.client.toast.SystemToast;
89
import net.minecraft.client.util.math.MatrixStack;
@@ -20,7 +21,7 @@ public class TitleScreenMixin {
2021
private static boolean firstRenderCompleted = false;
2122

2223
@Inject(method = "render", at = @At("HEAD"))
23-
private void onFirstRender(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
24+
private void onFirstRender(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
2425
if (firstRenderCompleted) return;
2526
firstRenderCompleted = true;
2627

src/main/java/com/glisco/deathlog/server/DeathLogServer.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,18 @@ private int executeList(CommandContext<ServerCommandSource> context, @Nullable S
7373
var leftText = deathInfo.getLeftColumnText().iterator();
7474
var rightText = deathInfo.getRightColumnText().iterator();
7575

76-
context.getSource().sendFeedback(Text.literal(""), false);
77-
context.getSource().sendFeedback(Text.literal("§7-- §aBegin §bDeath Info Entry [" + i + "]§7--"), false);
76+
int idx = i;
77+
78+
context.getSource().sendFeedback(() -> Text.literal(""), false);
79+
context.getSource().sendFeedback(() -> Text.literal("§7-- §aBegin §bDeath Info Entry [" + idx + "]§7--"), false);
7880
while (leftText.hasNext()) {
79-
context.getSource().sendFeedback(((MutableText) leftText.next()).append(Text.literal(": ")).append(((MutableText) rightText.next()).formatted(Formatting.WHITE)), false);
81+
context.getSource().sendFeedback(() -> ((MutableText) leftText.next()).append(Text.literal(": ")).append(((MutableText) rightText.next()).formatted(Formatting.WHITE)), false);
8082
}
81-
context.getSource().sendFeedback(Text.literal("§7-- §cEnd §bDeath Info Entry [" + i + "]§7--"), false);
83+
context.getSource().sendFeedback(() -> Text.literal("§7-- §cEnd §bDeath Info Entry [" + idx + "]§7--"), false);
8284
}
8385

84-
if (infoListSize > 0) context.getSource().sendFeedback(Text.literal(""), false);
85-
context.getSource().sendFeedback(Text.literal("Queried §b" + infoListSize + "§r death info entries for player ").append("§b" + profile.getName()), false);
86+
if (infoListSize > 0) context.getSource().sendFeedback(() -> Text.literal(""), false);
87+
context.getSource().sendFeedback(() -> Text.literal("Queried §b" + infoListSize + "§r death info entries for player ").append("§b" + profile.getName()), false);
8688

8789
return infoListSize;
8890
}

src/main/java/com/glisco/deathlog/server/ServerDeathLogStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void store(Text deathMessage, PlayerEntity player) {
7979
deathInfo.setProperty(DeathInfo.INVENTORY_KEY, new InventoryProperty(player.getInventory()));
8080

8181
deathInfo.setProperty(DeathInfo.COORDINATES_KEY, new CoordinatesProperty(player.getBlockPos()));
82-
deathInfo.setProperty(DeathInfo.DIMENSION_KEY, new StringProperty("deathlog.deathinfoproperty.dimension", player.world.getRegistryKey().getValue().toString()));
82+
deathInfo.setProperty(DeathInfo.DIMENSION_KEY, new StringProperty("deathlog.deathinfoproperty.dimension", player.getWorld().getRegistryKey().getValue().toString()));
8383
deathInfo.setProperty(DeathInfo.LOCATION_KEY, new LocationProperty("Server", true));
8484
deathInfo.setProperty(DeathInfo.SCORE_KEY, new ScoreProperty(player.getScore(), player.experienceLevel, player.experienceProgress, player.totalExperience));
8585
deathInfo.setProperty(DeathInfo.DEATH_MESSAGE_KEY, new StringProperty("deathlog.deathinfoproperty.death_message", deathMessage.getString()));

0 commit comments

Comments
 (0)