|
7 | 7 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; |
8 | 8 | import net.minecraft.client.MinecraftClient; |
9 | 9 | import net.minecraft.client.gui.DrawContext; |
10 | | -import net.minecraft.client.gui.screen.world.SelectWorldScreen; |
| 10 | +import net.minecraft.client.gui.screen.Screen; |
11 | 11 | import net.minecraft.client.gui.screen.world.WorldListWidget; |
12 | 12 | import net.minecraft.world.level.storage.LevelStorage; |
13 | 13 | import net.minecraft.world.level.storage.LevelSummary; |
|
19 | 19 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
20 | 20 |
|
21 | 21 | @Mixin(WorldListWidget.WorldEntry.class) |
22 | | -public abstract class WorldListWidgetWorldEntryMixin { |
23 | | - |
| 22 | +public abstract class WorldListWidgetWorldEntryMixin extends WorldListWidget.Entry { |
24 | 23 | @Shadow |
25 | 24 | @Final |
26 | | - private SelectWorldScreen screen; |
| 25 | + private Screen screen; |
27 | 26 | @Shadow |
28 | 27 | @Final |
29 | 28 | private MinecraftClient client; |
@@ -73,18 +72,18 @@ public abstract class WorldListWidgetWorldEntryMixin { |
73 | 72 | method = "render", |
74 | 73 | at = @At( |
75 | 74 | value = "INVOKE", |
76 | | - target = "Lnet/minecraft/client/gui/DrawContext;drawTextWithShadow(Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/text/Text;III)V", |
| 75 | + target = "Lnet/minecraft/client/gui/widget/TextWidget;render(Lnet/minecraft/client/gui/DrawContext;IIF)V", |
77 | 76 | ordinal = 0, |
78 | 77 | shift = At.Shift.AFTER |
79 | 78 | ) |
80 | 79 | ) |
81 | | - private void fastquit$renderSavingTimeOnWorldList(DrawContext context, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta, CallbackInfo ci) { |
| 80 | + private void fastquit$renderSavingTimeOnWorldList(DrawContext context, int mouseX, int mouseY, boolean hovered, float deltaTicks, CallbackInfo ci) { |
82 | 81 | if (FastQuit.CONFIG.showSavingTime == FastQuitConfig.ShowSavingTime.TRUE) { |
83 | 82 | FastQuit.getSavingWorld(this.client.getLevelStorage().getSavesDirectory().resolve(this.level.getName())).ifPresent(server -> { |
84 | 83 | WorldInfo info = FastQuit.savingWorlds.get(server); |
85 | 84 | if (info != null) { |
86 | 85 | String time = info.getTimeSaving() + " ⌛"; |
87 | | - context.drawText(this.client.textRenderer, time, x + entryWidth - this.client.textRenderer.getWidth(time) - 4, y + 1, -6939106, false); |
| 86 | + context.drawText(this.client.textRenderer, time, this.getX() + this.getWidth() - this.client.textRenderer.getWidth(time) - 4, this.getY() + 1, -6939106, false); |
88 | 87 | } |
89 | 88 | }); |
90 | 89 | } |
|
0 commit comments