diff --git a/Blueberry-API/build.gradle.kts b/Blueberry-API/build.gradle.kts index 217f37dc..3cd653b3 100644 --- a/Blueberry-API/build.gradle.kts +++ b/Blueberry-API/build.gradle.kts @@ -10,10 +10,10 @@ dependencies { api("com.google.code.findbugs:jsr305:3.0.2") api("com.google.code.gson:gson:2.10") api("com.google.guava:guava:31.1-jre") - api("com.mojang:brigadier:1.0.18") - api("com.mojang:datafixerupper:5.0.28") - api("com.mojang:javabridge:2.0.25") - api("com.mojang:authlib:3.16.29") + api("com.mojang:brigadier:1.1.8") + api("com.mojang:datafixerupper:6.0.8") + api("com.mojang:javabridge:2.0.25") // removed in 1.20.1? + api("com.mojang:authlib:4.0.43") api("it.unimi.dsi:fastutil:8.5.9") api("io.netty:netty-all:4.1.82.Final") api("org.apache.commons:commons-lang3:3.12.0") diff --git a/Blueberry-API/src/main/java/net/blueberrymc/client/EarlyLoadingScreen.java b/Blueberry-API/src/main/java/net/blueberrymc/client/EarlyLoadingScreen.java index 305fd31d..076fabd5 100644 --- a/Blueberry-API/src/main/java/net/blueberrymc/client/EarlyLoadingScreen.java +++ b/Blueberry-API/src/main/java/net/blueberrymc/client/EarlyLoadingScreen.java @@ -1,6 +1,5 @@ package net.blueberrymc.client; -import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.datafixers.util.Pair; import net.blueberrymc.client.util.GLUtils; import net.blueberrymc.common.Blueberry; @@ -9,9 +8,9 @@ import net.blueberrymc.common.util.Versioning; import net.blueberrymc.util.Util; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.font.FontManager; import net.minecraft.client.gui.screens.LoadingOverlay; -import net.minecraft.client.gui.screens.Screen; import net.minecraft.util.Mth; import net.minecraft.util.profiling.InactiveProfiler; import org.jetbrains.annotations.Contract; @@ -312,7 +311,7 @@ public void run() { glfwMakeContextCurrent(0); } - public void renderMessagesFromGUI(@NotNull PoseStack poseStack) { + public void renderMessagesFromGUI(@NotNull GuiGraphics guiGraphics) { blockUntilFinish(); Minecraft mc = Minecraft.getInstance(); Objects.requireNonNull(mc); @@ -321,14 +320,12 @@ public void renderMessagesFromGUI(@NotNull PoseStack poseStack) { loadingFont = true; // load fonts early to show logs early FontManager fontManager = (FontManager) ReflectionHelper.getFieldWithoutException(Minecraft.class, mc, "fontManager"); - //noinspection NullableProblems Objects.requireNonNull(fontManager) - .getReloadListener() .reload(CompletableFuture::completedFuture, mc.getResourceManager(), InactiveProfiler.INSTANCE, InactiveProfiler.INSTANCE, Runnable::run, Runnable::run); isFontReady = (boolean) Objects.requireNonNull(ReflectionHelper.getFieldWithoutException(LoadingOverlay.class, null, "isFontReady")); } if (isFontReady && mc.getWindow().getWindow() == this.window) { - renderMessages(TextRenderer.minecraft(poseStack)); + renderMessages(TextRenderer.minecraft(guiGraphics)); } } @@ -403,7 +400,7 @@ private interface TextRenderer { } @Contract(pure = true) - static @NotNull TextRenderer minecraft(@NotNull PoseStack poseStack) { + static @NotNull TextRenderer minecraft(@NotNull GuiGraphics guiGraphics) { return (message, color, line, alpha) -> { if (alpha <= 0.02) { return; @@ -413,7 +410,7 @@ private interface TextRenderer { int b = (int) (color[2] * 255); int a = (int) (alpha * 255); int rgba = (r << 16) | (g << 8) | b | (a << 24); - Screen.drawString(poseStack, Minecraft.getInstance().font, message, 10, line * 10, rgba); + guiGraphics.drawString(Minecraft.getInstance().font, message, 10, line * 10, rgba); }; } } diff --git a/Blueberry-API/src/main/java/net/blueberrymc/client/command/ClientBlueberryCommand.java b/Blueberry-API/src/main/java/net/blueberrymc/client/command/ClientBlueberryCommand.java index a68dc00a..72a7eebd 100644 --- a/Blueberry-API/src/main/java/net/blueberrymc/client/command/ClientBlueberryCommand.java +++ b/Blueberry-API/src/main/java/net/blueberrymc/client/command/ClientBlueberryCommand.java @@ -56,7 +56,7 @@ public void register(@NotNull CommandDispatcher dispatcher) private static int executeDiscordAccept(@NotNull CommandSourceStack source, long id) { DiscordRPCTaskExecutor.submitTask(core -> core.activityManager().sendRequestReply(id, ActivityJoinRequestReply.YES, result -> { if (result == Result.OK) { - source.sendSuccess(BlueberryText.text("blueberry", "discord.activity.join_request.accept.accepted"), false); + source.sendSuccess(() -> BlueberryText.text("blueberry", "discord.activity.join_request.accept.accepted"), false); } else { source.sendFailure(BlueberryText.text("blueberry", "discord.error_with_result", result.name())); } @@ -67,7 +67,7 @@ private static int executeDiscordAccept(@NotNull CommandSourceStack source, long private static int executeDiscordDeny(@NotNull CommandSourceStack source, long id) { DiscordRPCTaskExecutor.submitTask(core -> core.activityManager().sendRequestReply(id, ActivityJoinRequestReply.NO, result -> { if (result == Result.OK) { - source.sendSuccess(BlueberryText.text("blueberry", "discord.activity.join_request.deny.denied"), false); + source.sendSuccess(() -> BlueberryText.text("blueberry", "discord.activity.join_request.deny.denied"), false); } else { source.sendFailure(BlueberryText.text("blueberry", "discord.error_with_result", result.name())); } @@ -78,7 +78,7 @@ private static int executeDiscordDeny(@NotNull CommandSourceStack source, long i private static int executeDiscordIgnore(@NotNull CommandSourceStack source, long id) { DiscordRPCTaskExecutor.submitTask(core -> core.activityManager().sendRequestReply(id, ActivityJoinRequestReply.IGNORE, result -> { if (result == Result.OK) { - source.sendSuccess(BlueberryText.text("blueberry", "discord.activity.join_request.ignore.ignored"), false); + source.sendSuccess(() -> BlueberryText.text("blueberry", "discord.activity.join_request.ignore.ignored"), false); } else { source.sendFailure(BlueberryText.text("blueberry", "discord.error_with_result", result.name())); } diff --git a/Blueberry-API/src/main/java/net/blueberrymc/client/gui/components/ScrollableContainer.java b/Blueberry-API/src/main/java/net/blueberrymc/client/gui/components/ScrollableContainer.java index 677075f2..f32b413b 100644 --- a/Blueberry-API/src/main/java/net/blueberrymc/client/gui/components/ScrollableContainer.java +++ b/Blueberry-API/src/main/java/net/blueberrymc/client/gui/components/ScrollableContainer.java @@ -1,12 +1,12 @@ package net.blueberrymc.client.gui.components; import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiComponent; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.AbstractWidget; import net.minecraft.client.gui.components.events.AbstractContainerEventHandler; import net.minecraft.client.gui.components.events.GuiEventListener; +import net.minecraft.client.gui.screens.Screen; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import org.jetbrains.annotations.NotNull; @@ -180,36 +180,35 @@ protected int getMaxPosition() { protected void clickedHeader(int i, int i2) { } - protected void renderHeader(PoseStack poseStack, int i, int i2) { + protected void renderHeader(@NotNull GuiGraphics guiGraphics, int i, int i2) { } - protected void renderBackground(@NotNull PoseStack poseStack) { + protected void renderBackground(@NotNull GuiGraphics guiGraphics) { } - protected void renderDecorations(@NotNull PoseStack poseStack, int i, int i2) { + protected void renderDecorations(@NotNull GuiGraphics guiGraphics, int i, int i2) { } protected void enableScissor() { - enableScissor(this.left, this.bottom, this.right, this.top); + RenderSystem.enableScissor(this.left, this.bottom, this.right, this.top); } /** * Renders the container. - * @param poseStack pose stack + * @param guiGraphics gui graphics * @param mouseX mouse x position * @param mouseY mouse y position * @param deltaFrameTime delta frame time */ - public void render(@NotNull PoseStack poseStack, int mouseX, int mouseY, float deltaFrameTime) { - this.renderBackground(poseStack); + public void render(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float deltaFrameTime) { + this.renderBackground(guiGraphics); int i3 = this.getScrollbarPosition(); int i4 = i3 + 6; //this.hovered = this.isMouseOver((double)mouseX, (double)mouseX) ? this.getEntryAtPosition((double)mouseX, (double)mouseX) : null; if (this.renderBackground) { - RenderSystem.setShaderTexture(0, GuiComponent.BACKGROUND_LOCATION); RenderSystem.setShaderColor(0.125F, 0.125F, 0.125F, 1.0F); int i5 = 32; - blit(poseStack, this.left, this.top, (float)this.right, (float)(this.bottom + (int)this.getScrollAmount()), this.right - this.left, this.bottom - this.top, 32, 32); + guiGraphics.blit(Screen.BACKGROUND_LOCATION, this.left, this.top, (float)this.right, (float)(this.bottom + (int)this.getScrollAmount()), this.right - this.left, this.bottom - this.top, 32, 32); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); } @@ -217,21 +216,21 @@ public void render(@NotNull PoseStack poseStack, int mouseX, int mouseY, float d int i7 = this.top + 4 - (int)this.getScrollAmount(); this.enableScissor(); if (this.renderHeader) { - this.renderHeader(poseStack, i6, i7); + this.renderHeader(guiGraphics, i6, i7); } - this.renderList(poseStack, getRowLeft(), i6, mouseX, mouseY, deltaFrameTime); - disableScissor(); + this.renderList(guiGraphics, getRowLeft(), i6, mouseX, mouseY, deltaFrameTime); + RenderSystem.disableScissor(); if (this.renderTopAndBottom) { - RenderSystem.setShaderTexture(0, GuiComponent.BACKGROUND_LOCATION); + RenderSystem.setShaderTexture(0, Screen.BACKGROUND_LOCATION); int i8 = 32; RenderSystem.setShaderColor(0.25F, 0.25F, 0.25F, 1.0F); - blit(poseStack, this.left, 0, 0.0F, 0.0F, this.width, this.top, 32, 32); - blit(poseStack, this.left, this.bottom, 0.0F, (float)this.bottom, this.width, this.height - this.bottom, 32, 32); + guiGraphics.blit(Screen.BACKGROUND_LOCATION, this.left, 0, 0.0F, 0.0F, this.width, this.top, 32, 32); + guiGraphics.blit(Screen.BACKGROUND_LOCATION, this.left, this.bottom, 0.0F, (float)this.bottom, this.width, this.height - this.bottom, 32, 32); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); int i9 = 4; - fillGradient(poseStack, this.left, this.top, this.right, this.top + 4, -16777216, 0); - fillGradient(poseStack, this.left, this.bottom - 4, this.right, this.bottom, 0, -16777216); + guiGraphics.fillGradient(this.left, this.top, this.right, this.top + 4, -16777216, 0); + guiGraphics.fillGradient(this.left, this.bottom - 4, this.right, this.bottom, 0, -16777216); } int i10 = this.getMaxScroll(); @@ -243,14 +242,14 @@ public void render(@NotNull PoseStack poseStack, int mouseX, int mouseY, float d i12 = this.top; } - fill(poseStack, i3, this.top, i4, this.bottom, -16777216); - fill(poseStack, i3, i12, i4, i12 + i11, -8355712); - fill(poseStack, i3, i12, i4 - 1, i12 + i11 - 1, -4144960); + guiGraphics.fill(i3, this.top, i4, this.bottom, -16777216); + guiGraphics.fill(i3, i12, i4, i12 + i11, -8355712); + guiGraphics.fill(i3, i12, i4 - 1, i12 + i11 - 1, -4144960); } - this.renderDecorations(poseStack, mouseX, mouseX); + this.renderDecorations(guiGraphics, mouseX, mouseX); - children.forEach(e -> e.render(poseStack, mouseX, mouseY, deltaFrameTime)); + children.forEach(e -> e.render(guiGraphics, mouseX, mouseY, deltaFrameTime)); RenderSystem.disableBlend(); } @@ -375,7 +374,7 @@ public boolean isMouseOver(double x, double y) { return y >= (double)this.top && y <= (double)this.bottom && x >= (double)this.left && x <= (double)this.right; } - protected void renderList(@NotNull PoseStack poseStack, int rowLeft, int adjustedScrollAmount, int i3, int i4, float deltaFrameTime) { + protected void renderList(@NotNull GuiGraphics guiGraphics, int rowLeft, int adjustedScrollAmount, int i3, int i4, float deltaFrameTime) { int itemCount = this.getItemCount(); int offset = 38; int prevY = Integer.MIN_VALUE; @@ -385,7 +384,7 @@ protected void renderList(@NotNull PoseStack poseStack, int rowLeft, int adjuste int rowBottom = this.getRowBottom(i); if (rowBottom >= this.top && rowTop <= this.bottom) { E entry = this.getEntry(i); - entry.render(poseStack, i3, i4, deltaFrameTime); + entry.render(guiGraphics, i3, i4, deltaFrameTime); if (prevY == entry.getY()) { offset -= 22; } diff --git a/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/FileDialogScreen.java b/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/FileDialogScreen.java index c703bc79..f87d06d0 100644 --- a/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/FileDialogScreen.java +++ b/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/FileDialogScreen.java @@ -1,10 +1,10 @@ package net.blueberrymc.client.gui.screens; -import com.mojang.blaze3d.vertex.PoseStack; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.blueberrymc.common.util.FileUtil; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.ObjectSelectionList; import net.minecraft.client.gui.screens.Screen; @@ -54,11 +54,11 @@ public void onClose() { } @Override - public void render(@NotNull PoseStack poseStack, int mouseX, int mouseY, float deltaFrameTime) { - fileList.render(poseStack, mouseX, mouseY, deltaFrameTime); - drawCenteredString(poseStack, this.font, this.title, this.width / 2, 16, 16777215); - drawCenteredString(poseStack, this.font, this.description, this.width / 2, 32, 16777215); - cancelButton.render(poseStack, mouseX, mouseY, deltaFrameTime); + public void render(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float deltaFrameTime) { + fileList.render(guiGraphics, mouseX, mouseY, deltaFrameTime); + guiGraphics.drawCenteredString(this.font, this.title, this.width / 2, 16, 16777215); + guiGraphics.drawCenteredString(this.font, this.description, this.width / 2, 32, 16777215); + cancelButton.render(guiGraphics, mouseX, mouseY, deltaFrameTime); } public void invokeCallback(@Nullable File file) { @@ -183,8 +183,8 @@ public void setSelected(@Nullable FileDialogScreen.FileList.Entry entry) { super.setSelected(entry); } - protected void renderBackground(@NotNull PoseStack poseStack) { - FileDialogScreen.this.renderBackground(poseStack); + protected void renderBackground(@NotNull GuiGraphics guiGraphics) { + FileDialogScreen.this.renderBackground(guiGraphics); } public boolean isFocused() { @@ -192,8 +192,8 @@ public boolean isFocused() { } @Override - protected void renderList(@NotNull PoseStack poseStack, int mouseX, int mouseY, float deltaFrameTime) { - super.renderList(poseStack, mouseX, mouseY, deltaFrameTime); + protected void renderList(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float deltaFrameTime) { + super.renderList(guiGraphics, mouseX, mouseY, deltaFrameTime); int itemCount = this.getItemCount(); for (int itemIndex = 0; itemIndex < itemCount; ++itemIndex) { @@ -207,13 +207,13 @@ protected void renderList(@NotNull PoseStack poseStack, int mouseX, int mouseY, cdButton.setX(getRowLeft() + rowWidth); cdButton.setY(rowTop - 3); cdButton.visible = true; - cdButton.render(poseStack, mouseX, mouseY, deltaFrameTime); + cdButton.render(guiGraphics, mouseX, mouseY, deltaFrameTime); if (options.fileType() == FileDialogScreenOptions.FileType.DIRECTORY || options.fileType() == FileDialogScreenOptions.FileType.ALL) { selectButton.setX(getRowLeft() + rowWidth + 22); selectButton.setY(rowTop - 3); selectButton.visible = true; - selectButton.render(poseStack, mouseX, mouseY, deltaFrameTime); + selectButton.render(guiGraphics, mouseX, mouseY, deltaFrameTime); } else { selectButton.visible = false; } @@ -222,7 +222,7 @@ protected void renderList(@NotNull PoseStack poseStack, int mouseX, int mouseY, selectButton.setX(getRowLeft() + rowWidth); selectButton.setY(rowTop - 3); selectButton.visible = true; - selectButton.render(poseStack, mouseX, mouseY, deltaFrameTime); + selectButton.render(guiGraphics, mouseX, mouseY, deltaFrameTime); } } } @@ -247,8 +247,8 @@ public Entry(@NotNull String name, @NotNull File file) { this.file = file; } - public void render(@NotNull PoseStack poseStack, int i, int i2, int i3, int i4, int i5, int i6, int i7, boolean flag, float f) { - FileDialogScreen.this.font.drawShadow(poseStack, name, (float)(FileList.this.width / 2 - FileDialogScreen.this.font.width(name) / 2), (float)(i2 + 2), 16777215, false); + public void render(@NotNull GuiGraphics guiGraphics, int i, int i2, int i3, int i4, int i5, int i6, int i7, boolean flag, float f) { + guiGraphics.drawString(FileDialogScreen.this.font, name, FileList.this.width / 2 - FileDialogScreen.this.font.width(name) / 2, i2 + 2, 16777215, false); } public boolean mouseClicked(double d, double d2, int i) { diff --git a/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/GenerateModScreen.java b/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/GenerateModScreen.java index d21eafb9..a05edb01 100644 --- a/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/GenerateModScreen.java +++ b/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/GenerateModScreen.java @@ -1,10 +1,10 @@ package net.blueberrymc.client.gui.screens; -import com.mojang.blaze3d.vertex.PoseStack; import net.blueberrymc.common.Blueberry; import net.blueberrymc.common.resources.BlueberryText; import net.blueberrymc.config.ModDescriptionFile; import net.minecraft.ChatFormatting; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.AbstractWidget; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.EditBox; @@ -26,7 +26,7 @@ public class GenerateModScreen extends BlueberryScreen { private final Screen previousScreen; private final List blockers = new ArrayList<>(); - private final List> callbacks = new ArrayList<>(); + private final List> callbacks = new ArrayList<>(); private String modName = ""; private String modId = ""; private String targetDirectory = ""; @@ -53,8 +53,8 @@ protected void init() { if (textWidth > _maxWidth) _maxWidth = textWidth; } final int maxWidth = _maxWidth; - BiConsumer addLabel = (component, finalOffset) -> callbacks.add(poseStack -> { - drawString(poseStack, font, component, this.width / 2 - this.width / 6 - maxWidth - 6, finalOffset + 6, 0xFFFFFF); + BiConsumer addLabel = (component, finalOffset) -> callbacks.add(guiGraphics -> { + guiGraphics.drawString(font, component, this.width / 2 - this.width / 6 - maxWidth - 6, finalOffset + 6, 0xFFFFFF); }); this.addRenderableWidget( Button.builder(CommonComponents.GUI_BACK, (button) -> this.minecraft.setScreen(previousScreen)) @@ -188,9 +188,9 @@ private void unblock(Object blocker) { } @Override - public void render(@NotNull PoseStack poseStack, int mouseX, int mouseY, float deltaFrameTime) { - renderBackground(poseStack); - for (var callback : callbacks) callback.accept(poseStack); - super.render(poseStack, mouseX, mouseY, deltaFrameTime); + public void render(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float deltaFrameTime) { + renderBackground(guiGraphics); + for (var callback : callbacks) callback.accept(guiGraphics); + super.render(guiGraphics, mouseX, mouseY, deltaFrameTime); } } diff --git a/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/ModConfigScreen.java b/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/ModConfigScreen.java index 84f1e07e..fc809188 100644 --- a/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/ModConfigScreen.java +++ b/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/ModConfigScreen.java @@ -1,7 +1,6 @@ package net.blueberrymc.client.gui.screens; import com.mojang.blaze3d.platform.InputConstants; -import com.mojang.blaze3d.vertex.PoseStack; import net.blueberrymc.client.gui.components.ScrollableContainer; import net.blueberrymc.common.Blueberry; import net.blueberrymc.common.bml.InternalBlueberryModConfig; @@ -28,6 +27,7 @@ import net.blueberrymc.util.Util; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.AbstractSliderButton; import net.minecraft.client.gui.components.AbstractWidget; import net.minecraft.client.gui.components.Button; @@ -59,7 +59,7 @@ public class ModConfigScreen extends BlueberryScreen { private static final Component UNKNOWN_TEXT = Component.literal("").withStyle(ChatFormatting.GRAY); private static final Component BOOLEAN_TRUE = Component.literal("true").withStyle(ChatFormatting.GREEN); private static final Component BOOLEAN_FALSE = Component.literal("false").withStyle(ChatFormatting.RED); - private final List> callbacks = new ArrayList<>(); + private final List> callbacks = new ArrayList<>(); private final CompoundVisualConfig compoundVisualConfig; private final Screen previousScreen; private final Component description; @@ -103,10 +103,10 @@ protected void init() { } } final int maxWidth = _maxWidth; - BiConsumer, Integer> addLabel = (config, finalOffset) -> callbacks.add(poseStack -> { + BiConsumer, Integer> addLabel = (config, finalOffset) -> callbacks.add(guiGraphics -> { int y = finalOffset + 6 - (int) container.getScrollAmount(); if (y > 60 && y < this.height - 54) { - drawString(poseStack, font, Util.getOrDefault(config.getComponent(), UNKNOWN_TEXT), this.width / 2 - maxWidth - 6, y, 0xFFFFFF); + guiGraphics.drawString(font, Util.getOrDefault(config.getComponent(), UNKNOWN_TEXT), this.width / 2 - maxWidth - 6, y, 0xFFFFFF); } }); for (VisualConfig config : this.compoundVisualConfig) { @@ -431,19 +431,19 @@ private static Component getButtonMessage(@NotNull BooleanVisualConfig booleanVi return bool == null || !bool ? BOOLEAN_FALSE : BOOLEAN_TRUE; } - public void render(@NotNull PoseStack poseStack, int i, int i2, float f) { - this.renderBackground(poseStack); + public void render(@NotNull GuiGraphics guiGraphics, int i, int i2, float f) { + this.renderBackground(guiGraphics); this.children().forEach(e -> { if (e instanceof ScrollableContainer) { - ((ScrollableContainer) e).render(poseStack, i, i2, f); + ((ScrollableContainer) e).render(guiGraphics, i, i2, f); } }); - for (Consumer callback : callbacks) callback.accept(poseStack); - drawCenteredString(poseStack, this.font, this.title, this.width / 2, 16, 16777215); + for (var callback : callbacks) callback.accept(guiGraphics); + guiGraphics.drawCenteredString(this.font, this.title, this.width / 2, 16, 16777215); if (this.description != null) { - drawCenteredString(poseStack, this.font, this.description, this.width / 2, 30, 16777215); + guiGraphics.drawCenteredString(this.font, this.description, this.width / 2, 30, 16777215); } - super.render(poseStack, i, i2, f); + super.render(guiGraphics, i, i2, f); } @NotNull diff --git a/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/ModListScreen.java b/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/ModListScreen.java index ef49d3a4..a482944b 100644 --- a/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/ModListScreen.java +++ b/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/ModListScreen.java @@ -1,7 +1,6 @@ package net.blueberrymc.client.gui.screens; import com.google.common.base.Joiner; -import com.mojang.blaze3d.vertex.PoseStack; import net.blueberrymc.common.Blueberry; import net.blueberrymc.common.bml.BlueberryMod; import net.blueberrymc.common.bml.BlueberryModLoader; @@ -16,6 +15,7 @@ import net.blueberrymc.common.util.ReflectionHelper; import net.blueberrymc.config.ModDescriptionFile; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.ObjectSelectionList; import net.minecraft.client.gui.components.Tooltip; @@ -235,9 +235,9 @@ private static boolean isReloadSupported(@NotNull BlueberryMod mod) { private static final Joiner JOINER = Joiner.on(", "); - public void render(@NotNull PoseStack poseStack, int i, int i2, float f) { - this.modsList.render(poseStack, i, i2, f); - drawCenteredString(poseStack, this.font, this.title, this.width / 2, 16, 16777215); + public void render(@NotNull GuiGraphics guiGraphics , int i, int i2, float f) { + this.modsList.render(guiGraphics, i, i2, f); + guiGraphics.drawCenteredString(this.font, this.title, this.width / 2, 16, 16777215); ModsList.Entry entry = this.modsList.getSelected(); if (entry != null) { BlueberryMod mod = entry.mod; @@ -254,27 +254,27 @@ public void render(@NotNull PoseStack poseStack, int i, int i2, float f) { this.disableButton.setMessage(BlueberryText.text("blueberry", "gui.screens.mods.disable")); } int y = 40; - drawString(poseStack, this.font, "Mod Name: " + mod.getName(), this.width / 4, y, 16777215); - drawString(poseStack, this.font, "Mod ID: " + mod.getDescription().getModId(), this.width / 4, y += 10, 16777215); - drawString(poseStack, this.font, "Version: " + mod.getDescription().getVersion(), this.width / 4, y += 10, 16777215); + guiGraphics.drawString(this.font, "Mod Name: " + mod.getName(), this.width / 4, y, 16777215); + guiGraphics.drawString(this.font, "Mod ID: " + mod.getDescription().getModId(), this.width / 4, y += 10, 16777215); + guiGraphics.drawString(this.font, "Version: " + mod.getDescription().getVersion(), this.width / 4, y += 10, 16777215); List authors = mod.getDescription().getAuthors(); if (authors != null) { - drawString(poseStack, this.font, "Authors: " + JOINER.join(authors), this.width / 4, y += 10, 16777215); + guiGraphics.drawString(this.font, "Authors: " + JOINER.join(authors), this.width / 4, y += 10, 16777215); } List credits = mod.getDescription().getCredits(); if (credits != null) { - drawString(poseStack, this.font, "Credits: " + JOINER.join(credits), this.width / 4, y += 10, 16777215); + guiGraphics.drawString(this.font, "Credits: " + JOINER.join(credits), this.width / 4, y += 10, 16777215); } - drawString(poseStack, this.font, "Status: " + mod.getStateList().getCurrentState().getName(), this.width / 4, y += 10, 16777215); + guiGraphics.drawString(this.font, "Status: " + mod.getStateList().getCurrentState().getName(), this.width / 4, y += 10, 16777215); List description = mod.getDescription().getDescription(); if (description != null) { y += 10; for (String s : description.stream().flatMap(s -> Arrays.stream(s.split("\\n"))).toList()) { - drawString(poseStack, this.font, s, this.width / 4, y += 10, 16777215); + guiGraphics.drawString(this.font, s, this.width / 4, y += 10, 16777215); } } } - super.render(poseStack, i, i2, f); + super.render(guiGraphics, i, i2, f); } class ModsList extends ObjectSelectionList { @@ -303,8 +303,8 @@ public void setSelected(@Nullable Entry entry) { updateTooltip(); } - protected void renderBackground(@NotNull PoseStack poseStack) { - ModListScreen.this.renderBackground(poseStack); + protected void renderBackground(@NotNull GuiGraphics guiGraphics) { + ModListScreen.this.renderBackground(guiGraphics); } public boolean isFocused() { @@ -318,9 +318,9 @@ public Entry(@NotNull BlueberryMod mod) { this.mod = mod; } - public void render(@NotNull PoseStack poseStack, int i, int i2, int i3, int i4, int i5, int i6, int i7, boolean flag, float f) { + public void render(@NotNull GuiGraphics guiGraphics, int i, int i2, int i3, int i4, int i5, int i6, int i7, boolean flag, float f) { String s = this.mod.getName(); - ModListScreen.this.font.drawShadow(poseStack, s, (float)(ModsList.this.width / 2 - ModListScreen.this.font.width(s) / 2), (float)(i2 + 2), 16777215, true); + guiGraphics.drawString(ModListScreen.this.font, s, ModsList.this.width / 2 - ModListScreen.this.font.width(s) / 2, i2 + 2, 16777215, true); } public boolean mouseClicked(double d, double d2, int i) { diff --git a/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/MultiLineBackupConfirmScreen.java b/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/MultiLineBackupConfirmScreen.java index 89af3a5e..98529d40 100644 --- a/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/MultiLineBackupConfirmScreen.java +++ b/Blueberry-API/src/main/java/net/blueberrymc/client/gui/screens/MultiLineBackupConfirmScreen.java @@ -1,6 +1,7 @@ package net.blueberrymc.client.gui.screens; import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.Checkbox; import net.minecraft.client.gui.components.MultiLineLabel; @@ -62,19 +63,19 @@ protected void init() { } - public void render(@NotNull PoseStack poseStack, int i, int i2, float f) { - this.renderBackground(poseStack); - drawCenteredString(poseStack, this.font, this.title, this.width / 2, 50, 16777215); + public void render(@NotNull GuiGraphics guiGraphics, int i, int i2, float f) { + this.renderBackground(guiGraphics); + guiGraphics.drawCenteredString(this.font, this.title, this.width / 2, 50, 16777215); int y = 70; for (MultiLineLabel label : this.message) { - label.renderCentered(poseStack, this.width / 2, y); + label.renderCentered(guiGraphics, this.width / 2, y); if (y + 150 > this.height) { - drawCenteredString(poseStack, this.font, "...", this.width / 2, y + 9, 16777215); + guiGraphics.drawCenteredString(this.font, "...", this.width / 2, y + 9, 16777215); break; } y += label.getLineCount() * 9; } - super.render(poseStack, i, i2, f); + super.render(guiGraphics, i, i2, f); } @Override diff --git a/Blueberry-API/src/main/java/net/blueberrymc/command/BlueberryCommand.java b/Blueberry-API/src/main/java/net/blueberrymc/command/BlueberryCommand.java index 861dcb28..098a8273 100644 --- a/Blueberry-API/src/main/java/net/blueberrymc/command/BlueberryCommand.java +++ b/Blueberry-API/src/main/java/net/blueberrymc/command/BlueberryCommand.java @@ -84,7 +84,7 @@ public static void register(@NotNull CommandDispatcher dispa } private static int executeModStatusCommand(CommandSourceStack source, BlueberryMod mod) { - source.sendSuccess(Component.literal("Mod status of '" + mod.getName() + "': " + mod.getStateList() + " (Current: " + mod.getStateList().getCurrentState().getName() + ")"), false); + source.sendSuccess(() -> Component.literal("Mod status of '" + mod.getName() + "': " + mod.getStateList() + " (Current: " + mod.getStateList().getCurrentState().getName() + ")"), false); return 1; } @@ -94,12 +94,12 @@ private static int executeModReloadCommand(CommandSourceStack source, BlueberryM player = source.getPlayerOrException(); } catch (CommandSyntaxException ignore) {} if (new ModReloadEvent(player, mod).callEvent()) { - source.sendSuccess(BlueberryText.text("blueberry", "blueberry.mod.command.mod.reload.reloading", mod.getName()), true); + source.sendSuccess(() -> BlueberryText.text("blueberry", "blueberry.mod.command.mod.reload.reloading", mod.getName()), true); try { if (mod.onReload()) { - Minecraft.getInstance().reloadResourcePacks().thenAccept(v -> source.sendSuccess(BlueberryText.text("blueberry", "blueberry.mod.command.mod.reload.success", mod.getName()), true)); + Minecraft.getInstance().reloadResourcePacks().thenAccept(v -> source.sendSuccess(() -> BlueberryText.text("blueberry", "blueberry.mod.command.mod.reload.success", mod.getName()), true)); } else { - source.sendSuccess(BlueberryText.text("blueberry", "blueberry.mod.command.mod.reload.success", mod.getName()), true); + source.sendSuccess(() -> BlueberryText.text("blueberry", "blueberry.mod.command.mod.reload.success", mod.getName()), true); } } catch (RuntimeException ex) { source.sendFailure(BlueberryText.text("blueberry", "blueberry.mod.command.mod.reload.failure.error", mod.getName(), ex.getMessage())); @@ -128,19 +128,19 @@ private static int executeTpsCommand(CommandSourceStack source) throws CommandSy double last10t = round(getAverageTPS(Arrays.stream(tickTimes).limit(10))); double l10t = round(getLowestTPS(Arrays.stream(tickTimes).limit(10))); source.sendSuccess( - Component.literal("Average TPS in last 100 ticks (5 seconds): ") + () -> Component.literal("Average TPS in last 100 ticks (5 seconds): ") .append(Component.literal(Double.toString(last100t)).withStyle(getTPSColor(last100t))).append(" (Lowest: ") .append(Component.literal(Double.toString(l100t)).withStyle(getTPSColor(l100t))) .append(")"), false); source.sendSuccess( - Component.literal("Average TPS in last 20 ticks (1 second): ") + () -> Component.literal("Average TPS in last 20 ticks (1 second): ") .append(Component.literal(Double.toString(last20t)).withStyle(getTPSColor(last20t))).append(" (Lowest: ") .append(Component.literal(Double.toString(l20t)).withStyle(getTPSColor(l20t))) .append(")"), false); source.sendSuccess( - Component.literal("Average TPS in last 10 ticks (500 ms): ") + () -> Component.literal("Average TPS in last 10 ticks (500 ms): ") .append(Component.literal(Double.toString(last10t)).withStyle(getTPSColor(last10t))).append(" (Lowest: ") .append(Component.literal(Double.toString(l10t)).withStyle(getTPSColor(l10t))) .append(")"), @@ -173,7 +173,7 @@ public static int executeVersionCommand(@NotNull CommandSourceStack source) { } } source.sendSuccess( - Component.literal(" | ") + () -> Component.literal(" | ") .append(Component.literal(Util.capitalize(v.getName())).withStyle(ChatFormatting.AQUA, ChatFormatting.BOLD)) .append(" ") .append(Component.literal((Character.isDigit(v.getVersion().charAt(0)) ? "v" : "") + v.getVersion() + "." + v.getBuildNumber()).withStyle(ChatFormatting.LIGHT_PURPLE)) @@ -184,18 +184,19 @@ public static int executeVersionCommand(@NotNull CommandSourceStack source) { .append(Component.literal(")").withStyle(ChatFormatting.DARK_GRAY)), false); source.sendSuccess( - Component.literal(" | ") + () -> Component.literal(" | ") .append(BlueberryText.text("blueberry", "blueberry.mod.command.version.built_at").withStyle(ChatFormatting.YELLOW, ChatFormatting.BOLD)) .append(Component.literal(v.getBuiltAt())), false); + MutableComponent finalVersionDiff = versionDiff; source.sendSuccess( - Component.literal(" | ") + () -> Component.literal(" | ") .append(BlueberryText.text("blueberry", "blueberry.mod.command.version.commit_hash").withStyle(ChatFormatting.YELLOW, ChatFormatting.BOLD)) .append(Component.literal(v.getShortCommit()).withStyle(style -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Component.literal("Click to open GitHub"))).withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/" + Constants.GITHUB_REPO + "/commit/" + v.getCommit())))) - .append(versionDiff), + .append(finalVersionDiff), false); source.sendSuccess( - Component.literal(" | ") + () -> Component.literal(" | ") .append(BlueberryText.text("blueberry", "blueberry.mod.command.version.magmacube_commit_hash").withStyle(ChatFormatting.YELLOW, ChatFormatting.BOLD)) .append(Component.literal(v.getShortMagmaCubeCommit()) .withStyle(style -> @@ -204,7 +205,7 @@ public static int executeVersionCommand(@NotNull CommandSourceStack source) { ), false); if (!cached) { - source.sendSuccess(Component.literal("").append(BlueberryText.text("blueberry", "blueberry.mod.command.version.checking_for_new_version").withStyle(ChatFormatting.YELLOW, ChatFormatting.ITALIC)), false); + source.sendSuccess(() -> Component.literal("").append(BlueberryText.text("blueberry", "blueberry.mod.command.version.checking_for_new_version").withStyle(ChatFormatting.YELLOW, ChatFormatting.ITALIC)), false); VersionChecker.check().thenAccept(result -> { String key = result.getStatusKey(); Object[] args = switch (key) { @@ -215,9 +216,9 @@ public static int executeVersionCommand(@NotNull CommandSourceStack source) { }; MutableComponent text = BlueberryText.text("blueberry", "blueberry.mod.command.version.checker." + key, args); if (key.equals("error")) { - source.sendSuccess(text.withStyle(ChatFormatting.RED), false); + source.sendSuccess(() -> text.withStyle(ChatFormatting.RED), false); } else { - source.sendSuccess(BlueberryText.text("blueberry", "blueberry.mod.command.version.checker.result").append(text).withStyle(getChatFormattingForVersionCheckerKey(key)), false); + source.sendSuccess(() -> BlueberryText.text("blueberry", "blueberry.mod.command.version.checker.result").append(text).withStyle(getChatFormattingForVersionCheckerKey(key)), false); } }); } @@ -227,10 +228,10 @@ public static int executeVersionCommand(@NotNull CommandSourceStack source) { public static int executePermissionCheckCommand(@NotNull CommandSourceStack source, @NotNull String permission, @Nullable Player player) { PermissionHolder holder = (PermissionHolder) Objects.requireNonNullElse(player, source); PermissionState state = holder.getPermissionState(permission); - source.sendSuccess(Component.literal("") + source.sendSuccess(() -> Component.literal("") .append(Component.literal("Permission check for ").withStyle(ChatFormatting.AQUA)) .append(Component.literal(permission).withStyle(ChatFormatting.GOLD)), false); - source.sendSuccess(Component.literal("") + source.sendSuccess(() -> Component.literal("") .append(Component.literal(" Result: ").withStyle(ChatFormatting.AQUA)) .append(Component.literal(state.name().toLowerCase()).withStyle(getChatFormattingForPermissionState(state))), false); return 0; diff --git a/Blueberry-API/src/main/java/net/blueberrymc/common/bml/client/gui/screens/ModLoadingProblemScreen.java b/Blueberry-API/src/main/java/net/blueberrymc/common/bml/client/gui/screens/ModLoadingProblemScreen.java index 17491e7d..a39eb51d 100644 --- a/Blueberry-API/src/main/java/net/blueberrymc/common/bml/client/gui/screens/ModLoadingProblemScreen.java +++ b/Blueberry-API/src/main/java/net/blueberrymc/common/bml/client/gui/screens/ModLoadingProblemScreen.java @@ -1,6 +1,5 @@ package net.blueberrymc.common.bml.client.gui.screens; -import com.mojang.blaze3d.vertex.PoseStack; import net.blueberrymc.client.gui.screens.BlueberryScreen; import net.blueberrymc.common.resources.BlueberryCommonComponents; import net.blueberrymc.common.resources.BlueberryText; @@ -10,6 +9,7 @@ import net.minecraft.ChatFormatting; import net.minecraft.Util; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.ObjectSelectionList; import net.minecraft.client.gui.screens.Screen; @@ -67,10 +67,10 @@ protected void init() { super.init(); } - public void render(@NotNull PoseStack poseStack, int i, int i2, float f) { - this.problemList.render(poseStack, i, i2, f); - drawCenteredString(poseStack, this.font, this.title, this.width / 2, 16, 16777215); - super.render(poseStack, i, i2, f); + public void render(@NotNull GuiGraphics guiGraphics, int i, int i2, float f) { + this.problemList.render(guiGraphics, i, i2, f); + guiGraphics.drawCenteredString(this.font, this.title, this.width / 2, 16, 16777215); + super.render(guiGraphics, i, i2, f); } class ProblemList extends ObjectSelectionList { @@ -97,8 +97,8 @@ public void setSelected(@Nullable Entry entry) { super.setSelected(entry); } - protected void renderBackground(@NotNull PoseStack poseStack) { - ModLoadingProblemScreen.this.renderBackground(poseStack); + protected void renderBackground(@NotNull GuiGraphics guiGraphics) { + ModLoadingProblemScreen.this.renderBackground(guiGraphics); } public boolean isFocused() { @@ -112,10 +112,10 @@ public Entry(@NotNull ModLoadingError error) { this.error = error; } - public void render(@NotNull PoseStack poseStack, int i, int i2, int i3, int i4, int i5, int i6, int i7, boolean flag, float f) { + public void render(@NotNull GuiGraphics guiGraphics, int i, int i2, int i3, int i4, int i5, int i6, int i7, boolean flag, float f) { String modName = this.error.modInfo != null ? this.error.modInfo.getName() + ": " : ""; String s = modName + this.error.getMessage(); - ModLoadingProblemScreen.this.font.drawShadow(poseStack, s, (float)(ProblemList.this.width / 2 - ModLoadingProblemScreen.this.font.width(s) / 2), (float)(i2 + 2), this.error.isWarning ? 0xFFFF55 : 0xFF5555, true); + guiGraphics.drawString(ModLoadingProblemScreen.this.font, s, ProblemList.this.width / 2 - ModLoadingProblemScreen.this.font.width(s) / 2, i2 + 2, this.error.isWarning ? 0xFFFF55 : 0xFF5555, true); } public boolean mouseClicked(double d, double d2, int i) { @@ -137,4 +137,4 @@ private void select() { } } } -} \ No newline at end of file +} diff --git a/Blueberry-API/src/main/java/net/minecraft/launchwrapper/LaunchClassLoader.java b/Blueberry-API/src/main/java/net/minecraft/launchwrapper/LaunchClassLoader.java index 0e73a214..42409da5 100644 --- a/Blueberry-API/src/main/java/net/minecraft/launchwrapper/LaunchClassLoader.java +++ b/Blueberry-API/src/main/java/net/minecraft/launchwrapper/LaunchClassLoader.java @@ -82,6 +82,8 @@ public LaunchClassLoader(@NotNull URL@NotNull[] sources, @Nullable ClassLoader p addClassLoaderExclusion("com.google.gson."); addClassLoaderExclusion("com.google.common."); addClassLoaderExclusion("com.mojang.bridge."); + addClassLoaderExclusion("com.mojang.blocklist."); + addClassLoaderExclusion("com.mojang.patchy."); addClassLoaderExclusion("io.netty."); addClassLoaderExclusion("it.unimi.dsi.fastutil."); addClassLoaderExclusion("org.slf4j."); diff --git a/MagmaCube b/MagmaCube index 9fdf35ab..57d8c54f 160000 --- a/MagmaCube +++ b/MagmaCube @@ -1 +1 @@ -Subproject commit 9fdf35ab89d00ec2b2e5383e01631f68b0acdda5 +Subproject commit 57d8c54fed06e54b8bde38d569b71fb78bca2cc4 diff --git a/MagmaCube-Patches/0001-POM-Changes.patch b/MagmaCube-Patches/0001-POM-Changes.patch index 34acd9c6..1f8c3431 100644 --- a/MagmaCube-Patches/0001-POM-Changes.patch +++ b/MagmaCube-Patches/0001-POM-Changes.patch @@ -27,10 +27,10 @@ index fb84bbcd532981037e97b33e7b8bdef539dbbd2c..871ca99691b10950eeeb6d4b7630708f @DontObfuscate public static String getClientModName() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e60fe3c67c4ce77246f7de89c3f7cad7051d7f24..ebb6692769a66cd6c8e96a6fa4f480fa49c4e2ff 100644 +index 1eec24171a152be1b2d3c6e8fac0748fdc1a14a4..e0b28c1de32fdbc558f4a9cabf3a51b139988594 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -944,7 +944,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements +@@ -764,7 +764,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements } public String getLaunchedVersion() { diff --git a/MagmaCube-Patches/0004-Mods-support.patch b/MagmaCube-Patches/0004-Mods-support.patch index eccee7e3..89679ff1 100644 --- a/MagmaCube-Patches/0004-Mods-support.patch +++ b/MagmaCube-Patches/0004-Mods-support.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Mods support diff --git a/src/main/java/com/mojang/blaze3d/platform/Window.java b/src/main/java/com/mojang/blaze3d/platform/Window.java -index 05575121e5b84eeb54e5ec2add4cf31e26b7c193..c6ca0edf81e87c3f22276953d0fb6533d6dd4b09 100644 +index b9da64ff83ecc1e8dbce379455e83583bce79671..2cf67b8e8e28485089052fe0e7f7f400e4e2c2a9 100644 --- a/src/main/java/com/mojang/blaze3d/platform/Window.java +++ b/src/main/java/com/mojang/blaze3d/platform/Window.java -@@ -80,7 +80,7 @@ public final class Window implements AutoCloseable { +@@ -81,7 +81,7 @@ public final class Window implements AutoCloseable { GLFW.glfwWindowHint(139267, 2); GLFW.glfwWindowHint(139272, 204801); GLFW.glfwWindowHint(139270, 1); @@ -99,10 +99,10 @@ index d407afcacaad89de4836abdc8a975f73570614ef..e87e91bc99e99b69b7f319f3bf3f4d2f public void setDetail(String s, String s2) { diff --git a/src/main/java/net/minecraft/client/Minecraft.java b/src/main/java/net/minecraft/client/Minecraft.java -index f9d4c4d75f4d539f750b8de0c5af16dddb15f3cd..59934ec2e47b8a2d6a4698c2c08190a3c73e30a5 100644 +index 695dbb5f052dbd92b9c97bddb867b07deb7e8efd..d2c229a4e6489d9a5b960db1875b06c096733974 100644 --- a/src/main/java/net/minecraft/client/Minecraft.java +++ b/src/main/java/net/minecraft/client/Minecraft.java -@@ -466,7 +466,9 @@ public class Minecraft extends ReentrantBlockableEventLoop implements +@@ -454,7 +454,9 @@ public class Minecraft extends ReentrantBlockableEventLoop implements this.mainRenderTarget = new MainTarget(this.window.getWidth(), this.window.getHeight()); this.mainRenderTarget.setClearColor(0.0F, 0.0F, 0.0F, 0.0F); this.mainRenderTarget.clear(ON_OSX); @@ -112,7 +112,7 @@ index f9d4c4d75f4d539f750b8de0c5af16dddb15f3cd..59934ec2e47b8a2d6a4698c2c08190a3 this.resourcePackRepository.reload(); this.options.loadSelectedResourcePacks(this.resourcePackRepository); this.languageManager = new LanguageManager(this.options.languageCode); -@@ -480,6 +482,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements +@@ -470,6 +472,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements this.splashManager = new SplashManager(this.user); this.resourceManager.registerReloadListener(this.splashManager); this.musicManager = new MusicManager(this); @@ -120,7 +120,7 @@ index f9d4c4d75f4d539f750b8de0c5af16dddb15f3cd..59934ec2e47b8a2d6a4698c2c08190a3 this.fontManager = new FontManager(this.textureManager); this.font = this.fontManager.createFont(); this.fontFilterFishy = this.fontManager.createFontFilterFishy(); -@@ -499,6 +502,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements +@@ -489,6 +492,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements this.blockEntityRenderDispatcher = new BlockEntityRenderDispatcher(this.font, this.entityModels, this::getBlockRenderer, this::getItemRenderer, this::getEntityRenderDispatcher); this.resourceManager.registerReloadListener(this.blockEntityRenderDispatcher); BlockEntityWithoutLevelRenderer blockEntityWithoutLevelRenderer = new BlockEntityWithoutLevelRenderer(this.blockEntityRenderDispatcher, this.entityModels); @@ -128,30 +128,31 @@ index f9d4c4d75f4d539f750b8de0c5af16dddb15f3cd..59934ec2e47b8a2d6a4698c2c08190a3 this.resourceManager.registerReloadListener(blockEntityWithoutLevelRenderer); this.itemRenderer = new ItemRenderer(this, this.textureManager, this.modelManager, this.itemColors, blockEntityWithoutLevelRenderer); this.resourceManager.registerReloadListener(this.itemRenderer); -@@ -556,6 +560,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements +@@ -548,6 +552,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements this.reportingContext = ReportingContext.create(ReportEnvironment.local(), this.userApiService); LoadingOverlay.registerTextures(this); List list = this.resourcePackRepository.openAllSelected(); + net.blueberrymc.common.Blueberry.getModLoader().callInit(); // Blueberry this.reloadStateTracker.startReload(ResourceLoadStateTracker.ReloadReason.INITIAL, list); ReloadInstance reloadInstance = this.resourceManager.createReload(Util.backgroundExecutor(), this, RESOURCE_RELOAD_INITIAL_TASK, list); - this.setOverlay(new LoadingOverlay(this, reloadInstance, (optional) -> Util.ifElse(optional, this::rollbackResourcePacks, () -> { -@@ -567,8 +572,9 @@ public class Minecraft extends ReentrantBlockableEventLoop implements + GameLoadTimesEvent.INSTANCE.beginStep(TelemetryProperty.LOAD_TIME_LOADING_OVERLAY_MS); +@@ -561,6 +566,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements }), false)); - if (s != null) { - ServerAddress serverAddress = new ServerAddress(s, i); -- reloadInstance.done().thenRunAsync(() -> ConnectScreen.startConnecting(new TitleScreen(), this, serverAddress, new ServerData(I18n.get("selectServer.defaultName"), serverAddress.toString(), false)), this); -+ reloadInstance.done().thenRunAsync(() -> new net.blueberrymc.common.bml.client.gui.screens.ModLoadingProblemScreen(() -> ConnectScreen.startConnecting(new TitleScreen(), this, serverAddress, new ServerData(I18n.get("selectServer.defaultName"), serverAddress.toString(), false))), this); // Blueberry - } else if (this.shouldShowBanNotice()) { + this.quickPlayLog = QuickPlayLog.of(gameConfig.quickPlay.path()); + if (this.shouldShowBanNotice()) { + this.setScreen(new net.blueberrymc.common.bml.client.gui.screens.ModLoadingProblemScreen(() -> { // Blueberry this.setScreen(BanNoticeScreen.create((flag) -> { if (flag) { Util.getPlatform().openUri("https://aka.ms/mcjavamoderation"); -@@ -576,10 +582,11 @@ public class Minecraft extends ReentrantBlockableEventLoop implements +@@ -568,6 +574,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements - this.setScreen(new TitleScreen(true)); + this.setInitialScreen(realmsClient, reloadInstance, gameConfig.quickPlay); }, this.multiplayerBan())); + })); // Blueberry + } else { + this.setInitialScreen(realmsClient, reloadInstance, gameConfig.quickPlay); + } +@@ -586,7 +593,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements } else if (this.options.onboardAccessibility) { this.setScreen(new AccessibilityOnboardingScreen(this.options)); } else { @@ -160,7 +161,7 @@ index f9d4c4d75f4d539f750b8de0c5af16dddb15f3cd..59934ec2e47b8a2d6a4698c2c08190a3 } } -@@ -782,9 +789,10 @@ public class Minecraft extends ReentrantBlockableEventLoop implements +@@ -780,9 +787,10 @@ public class Minecraft extends ReentrantBlockableEventLoop implements } public static void crash(CrashReport crashReport) { @@ -172,7 +173,7 @@ index f9d4c4d75f4d539f750b8de0c5af16dddb15f3cd..59934ec2e47b8a2d6a4698c2c08190a3 if (crashReport.getSaveFile() != null) { Bootstrap.realStdoutPrintln("#@!@# Game crashed! Crash report saved to: #@!@# " + crashReport.getSaveFile()); System.exit(-1); -@@ -942,6 +950,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements +@@ -939,6 +947,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements } BufferUploader.reset(); @@ -180,7 +181,7 @@ index f9d4c4d75f4d539f750b8de0c5af16dddb15f3cd..59934ec2e47b8a2d6a4698c2c08190a3 if (screen != null) { this.mouseHandler.releaseMouse(); KeyMapping.releaseAll(); -@@ -957,6 +966,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements +@@ -954,6 +963,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements public void setOverlay(@Nullable Overlay overlay) { this.overlay = overlay; @@ -188,7 +189,7 @@ index f9d4c4d75f4d539f750b8de0c5af16dddb15f3cd..59934ec2e47b8a2d6a4698c2c08190a3 } public void destroy() { -@@ -981,6 +991,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements +@@ -978,6 +988,7 @@ public class Minecraft extends ReentrantBlockableEventLoop implements this.screen.removed(); } @@ -196,7 +197,7 @@ index f9d4c4d75f4d539f750b8de0c5af16dddb15f3cd..59934ec2e47b8a2d6a4698c2c08190a3 this.close(); } finally { Util.timeSource = System::nanoTime; -@@ -1777,6 +1788,10 @@ public class Minecraft extends ReentrantBlockableEventLoop implements +@@ -1772,6 +1783,10 @@ public class Minecraft extends ReentrantBlockableEventLoop implements this.pendingConnection.tick(); } @@ -207,11 +208,18 @@ index f9d4c4d75f4d539f750b8de0c5af16dddb15f3cd..59934ec2e47b8a2d6a4698c2c08190a3 this.profiler.popPush("keyboard"); this.keyboardHandler.tick(); this.profiler.pop(); +@@ -2758,4 +2773,4 @@ public class Minecraft extends ReentrantBlockableEventLoop implements + + public abstract boolean isChatAllowed(boolean var1); + } +-} +\ No newline at end of file ++} diff --git a/src/main/java/net/minecraft/client/gui/components/ChatComponent.java b/src/main/java/net/minecraft/client/gui/components/ChatComponent.java -index 5701120ea9ba758fdcd2450be85ad0b6629e213a..f5351fe8564990c6ec54bcde42b8234dbfc79d7b 100644 +index b4f13bce60a49df5f721cfc7346baade88690ab6..57e814e56b258d88d4bcfc1b7e9db36727f04347 100644 --- a/src/main/java/net/minecraft/client/gui/components/ChatComponent.java +++ b/src/main/java/net/minecraft/client/gui/components/ChatComponent.java -@@ -443,15 +443,27 @@ public class ChatComponent extends GuiComponent { +@@ -442,15 +442,27 @@ public class ChatComponent { } public static int getWidth(double d) { @@ -242,18 +250,18 @@ index 5701120ea9ba758fdcd2450be85ad0b6629e213a..f5351fe8564990c6ec54bcde42b8234d public static double defaultUnfocusedPct() { diff --git a/src/main/java/net/minecraft/client/gui/components/DebugScreenOverlay.java b/src/main/java/net/minecraft/client/gui/components/DebugScreenOverlay.java -index e8ce7e4b648f320a1a14db66542b019403aa46e1..4168028ea9fea90d5997bdaba1052a3d22caaae5 100644 +index 65bdeb11abdbfe2e6578161a8329dbbbcf9d41e4..71d754d78b307bc6d3fbaf84cddd6c6811385c03 100644 --- a/src/main/java/net/minecraft/client/gui/components/DebugScreenOverlay.java +++ b/src/main/java/net/minecraft/client/gui/components/DebugScreenOverlay.java -@@ -71,6 +71,7 @@ import net.minecraft.world.level.material.FluidState; +@@ -62,6 +62,7 @@ import net.minecraft.world.level.levelgen.RandomState; + import net.minecraft.world.level.material.FluidState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; - import org.joml.Matrix4f; +import net.blueberrymc.common.Blueberry; // Blueberry - public class DebugScreenOverlay extends GuiComponent { + public class DebugScreenOverlay { private static final int COLOR_GREY = 14737632; -@@ -354,6 +355,12 @@ public class DebugScreenOverlay extends GuiComponent { +@@ -348,6 +349,12 @@ public class DebugScreenOverlay { long l3 = Runtime.getRuntime().freeMemory(); long l4 = l2 - l3; List list = Lists.newArrayList(new String[]{String.format(Locale.ROOT, "Java: %s %dbit", System.getProperty("java.version"), this.minecraft.is64Bit() ? 64 : 32), String.format(Locale.ROOT, "Mem: % 2d%% %03d/%03dMB", l4 * 100L / l, bytesToMegabytes(l4), bytesToMegabytes(l)), String.format(Locale.ROOT, "Allocation rate: %03dMB /s", bytesToMegabytes(this.allocationRateCalculator.bytesAllocatedPerSecond(l4))), String.format(Locale.ROOT, "Allocated: % 2d%% %03dMB", l2 * 100L / l, bytesToMegabytes(l2)), "", String.format(Locale.ROOT, "CPU: %s", GlUtil.getCpuInfo()), "", String.format(Locale.ROOT, "Display: %dx%d (%s)", Minecraft.getInstance().getWindow().getWidth(), Minecraft.getInstance().getWindow().getHeight(), GlUtil.getVendor()), GlUtil.getRenderer(), GlUtil.getOpenGLVersion()}); @@ -266,23 +274,30 @@ index e8ce7e4b648f320a1a14db66542b019403aa46e1..4168028ea9fea90d5997bdaba1052a3d if (this.minecraft.showOnlyReducedInfo()) { return list; } else { +@@ -528,4 +535,4 @@ public class DebugScreenOverlay { + return l; + } + } +-} +\ No newline at end of file ++} diff --git a/src/main/java/net/minecraft/client/gui/font/FontManager.java b/src/main/java/net/minecraft/client/gui/font/FontManager.java -index bbae7d696df930a090c530c278eee0526b22e4f9..ff100e69e1271687158fe33d4a032c1e50c64d6e 100644 +index efc36b080d2cccb9c744351e59956b29981360d4..aee7c6eb66b8c86c16ea8f901567306abe6be24d 100644 --- a/src/main/java/net/minecraft/client/gui/font/FontManager.java +++ b/src/main/java/net/minecraft/client/gui/font/FontManager.java -@@ -140,6 +140,7 @@ public class FontManager implements AutoCloseable { - }); - profilerFiller.pop(); - profilerFiller.endTick(); -+ net.minecraft.client.gui.screens.LoadingOverlay.isFontReady = true; // Blueberry +@@ -162,6 +162,7 @@ public class FontManager implements PreparableReloadListener, AutoCloseable { + if (!this.fontSets.containsKey(this.getActualId(Minecraft.DEFAULT_FONT))) { + throw new IllegalStateException("Default font failed to load"); } ++ net.minecraft.client.gui.screens.LoadingOverlay.isFontReady = true; // Blueberry + } - public String getName() { + private static List> loadResourceStack(List list, ResourceLocation resourceLocation) { diff --git a/src/main/java/net/minecraft/client/gui/screens/LoadingOverlay.java b/src/main/java/net/minecraft/client/gui/screens/LoadingOverlay.java -index 0edb07150db799ea36c3c37895078e8991456208..0fd6cd55bab7f95b06d256e70ad0b6c9d2b5350e 100644 +index 521a5d90d5cb22c1b81858ed4b4022d7284463d5..d53f7158eebca5e860bafdb509ed482c5f2a556c 100644 --- a/src/main/java/net/minecraft/client/gui/screens/LoadingOverlay.java +++ b/src/main/java/net/minecraft/client/gui/screens/LoadingOverlay.java -@@ -24,6 +24,7 @@ import net.minecraft.util.FastColor; +@@ -25,6 +25,7 @@ import net.minecraft.util.FastColor; import net.minecraft.util.Mth; public class LoadingOverlay extends Overlay { @@ -290,15 +305,15 @@ index 0edb07150db799ea36c3c37895078e8991456208..0fd6cd55bab7f95b06d256e70ad0b6c9 static final ResourceLocation MOJANG_STUDIOS_LOGO_LOCATION = new ResourceLocation("textures/gui/title/mojangstudios.png"); private static final int LOGO_BACKGROUND_COLOR = FastColor.ARGB32.color(255, 239, 50, 61); private static final int LOGO_BACKGROUND_COLOR_DARK = FastColor.ARGB32.color(255, 0, 0, 0); -@@ -111,6 +112,7 @@ public class LoadingOverlay extends Overlay { - RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - RenderSystem.defaultBlendFunc(); - RenderSystem.disableBlend(); -+ net.blueberrymc.client.EarlyLoadingScreen.getInstance().renderMessagesFromGUI(poseStack); // Blueberry - int i12 = (int)((double)this.minecraft.getWindow().getGuiScaledHeight() * 0.8325D); +@@ -116,6 +117,7 @@ public class LoadingOverlay extends Overlay { + RenderSystem.depthMask(true); + RenderSystem.enableDepthTest(); + int i12 = (int)((double)guiGraphics.guiHeight() * 0.8325D); ++ net.blueberrymc.client.EarlyLoadingScreen.getInstance().renderMessagesFromGUI(guiGraphics); // Blueberry float f10 = this.reload.getActualProgress(); this.currentProgress = Mth.clamp(this.currentProgress * 0.95F + f10 * 0.050000012F, 0.0F, 1.0F); -@@ -119,6 +121,7 @@ public class LoadingOverlay extends Overlay { + if (f2 < 1.0F) { +@@ -123,6 +125,7 @@ public class LoadingOverlay extends Overlay { } if (f2 >= 2.0F) { @@ -306,19 +321,26 @@ index 0edb07150db799ea36c3c37895078e8991456208..0fd6cd55bab7f95b06d256e70ad0b6c9 this.minecraft.setOverlay((Overlay)null); } -@@ -132,6 +135,7 @@ public class LoadingOverlay extends Overlay { +@@ -136,6 +139,7 @@ public class LoadingOverlay extends Overlay { this.fadeOutStart = Util.getMillis(); if (this.minecraft.screen != null) { + if (this.minecraft.screen instanceof net.blueberrymc.common.bml.client.gui.screens.ModLoadingProblemScreen) ((net.blueberrymc.common.bml.client.gui.screens.ModLoadingProblemScreen) minecraft.screen).refresh(); // Blueberry - this.minecraft.screen.init(this.minecraft, this.minecraft.getWindow().getGuiScaledWidth(), this.minecraft.getWindow().getGuiScaledHeight()); + this.minecraft.screen.init(this.minecraft, guiGraphics.guiWidth(), guiGraphics.guiHeight()); } } +@@ -197,4 +201,4 @@ public class LoadingOverlay extends Overlay { + } + } + } +-} +\ No newline at end of file ++} diff --git a/src/main/java/net/minecraft/client/gui/screens/PauseScreen.java b/src/main/java/net/minecraft/client/gui/screens/PauseScreen.java -index 6adbf87391877719214d3bf40d3c1e4867f145d1..7adcb2aa2381894153b42d1f553acef187ee037e 100644 +index 43982f04fcbd2465a6977c7e4cf6171a063718e2..aa038c468e4b52e6902268c5dacf1e478252a2e5 100644 --- a/src/main/java/net/minecraft/client/gui/screens/PauseScreen.java +++ b/src/main/java/net/minecraft/client/gui/screens/PauseScreen.java -@@ -81,6 +81,7 @@ public class PauseScreen extends Screen { +@@ -80,6 +80,7 @@ public class PauseScreen extends Screen { gridLayout.arrangeElements(); FrameLayout.alignInRectangle(gridLayout, 0, 0, this.width, this.height, 0.5F, 0.25F); gridLayout.visitWidgets(this::addRenderableWidget); @@ -327,10 +349,10 @@ index 6adbf87391877719214d3bf40d3c1e4867f145d1..7adcb2aa2381894153b42d1f553acef1 private void onDisconnect() { diff --git a/src/main/java/net/minecraft/client/gui/screens/TitleScreen.java b/src/main/java/net/minecraft/client/gui/screens/TitleScreen.java -index 717cfc1d9832d575d72fb9e4379539016bc14cfb..3e8b6d58393f5798c00f63e89f6af5ff15254eac 100644 +index f2d82c4cae6215e16563c2542853a26bc22117dc..bfc10af4b319dd1cd34b5b5060eeae74a6ae26ea 100644 --- a/src/main/java/net/minecraft/client/gui/screens/TitleScreen.java +++ b/src/main/java/net/minecraft/client/gui/screens/TitleScreen.java -@@ -12,6 +12,9 @@ import java.util.Objects; +@@ -10,6 +10,9 @@ import java.util.Objects; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; import javax.annotation.Nullable; @@ -352,40 +374,39 @@ index 717cfc1d9832d575d72fb9e4379539016bc14cfb..3e8b6d58393f5798c00f63e89f6af5ff } @Nullable -@@ -282,8 +288,12 @@ public class TitleScreen extends Screen { +@@ -274,8 +280,12 @@ public class TitleScreen extends Screen { s = s + I18n.get("menu.modded"); } -- drawString(poseStack, this.font, "MagmaCube " + ((net.minecraft.DetectedVersion) SharedConstants.getCurrentVersion()).magmaCubeVersion, 2, this.height - 20, 0xFFFFFF | i3); // MagmaCube -- drawString(poseStack, this.font, s, 2, this.height - 10, 16777215 | i3); +- guiGraphics.drawString(this.font, s, 2, this.height - 10, 16777215 | i3); +- guiGraphics.drawString(this.font, "MagmaCube " + ((net.minecraft.DetectedVersion) SharedConstants.getCurrentVersion()).magmaCubeVersion, 2, this.height - 20, 0xFFFFFF | i3); // MagmaCube + // Blueberry start -+ drawString(poseStack, this.font, "Blueberry " + net.blueberrymc.common.Blueberry.getVersion().getFullyQualifiedVersion(), 2, this.height - 40, 0xFFFFFF | i3); -+ drawString(poseStack, this.font, "MagmaCube " + net.blueberrymc.common.util.Versioning.getVersion().getShortMagmaCubeCommit(), 2, this.height - 30, 0xFFFFFF | i3); // MagmaCube // Blueberry - offset 20 -> 30 -+ drawString(poseStack, this.font, s, 2, this.height - 20, 16777215 | i3); // Blueberry - offset 10 -> 20 -+ drawString(poseStack, this.font, net.blueberrymc.common.Blueberry.getModLoader().getLoadedMods().size() + " mods loaded, " + net.blueberrymc.common.Blueberry.getModLoader().getActiveMods().size() + " mods active", 2, this.height - 10, 0xFFFFFF | i3); ++ guiGraphics.drawString(this.font, "Blueberry " + net.blueberrymc.common.Blueberry.getVersion().getFullyQualifiedVersion(), 2, this.height - 40, 0xFFFFFF | i3); ++ guiGraphics.drawString(this.font, "MagmaCube " + net.blueberrymc.common.util.Versioning.getVersion().getShortMagmaCubeCommit(), 2, this.height - 30, 0xFFFFFF | i3); // MagmaCube // Blueberry - offset 20 -> 30 ++ guiGraphics.drawString(this.font, s, 2, this.height - 20, 16777215 | i3); // Blueberry - offset 10 -> 20 ++ guiGraphics.drawString(this.font, net.blueberrymc.common.Blueberry.getModLoader().getLoadedMods().size() + " mods loaded, " + net.blueberrymc.common.Blueberry.getModLoader().getActiveMods().size() + " mods active", 2, this.height - 10, 0xFFFFFF | i3); + // Blueberry end for(GuiEventListener guiEventListener : this.children()) { if (guiEventListener instanceof AbstractWidget) { diff --git a/src/main/java/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java b/src/main/java/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java -index 25ebec02d85dd4091e022eeb12e77e28be8c511b..f7bdcdc57ba5de507ce5b343d7526013ca337256 100644 +index 413181a89aad4b51149fd98642cb025dfaf8c1e7..eaddb273ffc76d6f9e1c0c0f4188285eec080e4f 100644 --- a/src/main/java/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java +++ b/src/main/java/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java -@@ -289,6 +289,13 @@ public class ServerSelectionList extends ObjectSelectionList= i4 - 15 && i19 <= i4 - 5 && i20 >= 0 && i20 <= 8) { this.screen.setToolTip(Collections.singletonList(component2)); @@ -398,14 +419,21 @@ index 25ebec02d85dd4091e022eeb12e77e28be8c511b..f7bdcdc57ba5de507ce5b343d7526013 } else if (i19 >= i4 - i9 - 15 - 2 && i19 <= i4 - 15 - 2 && i20 >= 0 && i20 <= 8) { this.screen.setToolTip(list2); } +@@ -464,4 +476,4 @@ public class ServerSelectionList extends ObjectSelectionList new ShulkerBoxBlockEntity(dyeColor, BlockPos.ZERO, Blocks.SHULKER_BOX.defaultBlockState())).toArray((i) -> new ShulkerBoxBlockEntity[i]); private static final ShulkerBoxBlockEntity DEFAULT_SHULKER_BOX = new ShulkerBoxBlockEntity(BlockPos.ZERO, Blocks.SHULKER_BOX.defaultBlockState()); @@ -531,7 +566,7 @@ index 157c6e27fa7a6711626b0f2fa85d9c0242868dc6..78fc1fa63f40195db6614a25ac7fa67f } \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/renderer/block/LiquidBlockRenderer.java b/src/main/java/net/minecraft/client/renderer/block/LiquidBlockRenderer.java -index b1a6665b6167212e4b5ac81da490089e526b1a0c..19d71b147f6d67d9ce96e0beaafad45872647c5e 100644 +index 0aacf75ace7d940e35751e92a82e5473c652b147..53dc1b94980455629fb37b1a985b3f34d9382e7b 100644 --- a/src/main/java/net/minecraft/client/renderer/block/LiquidBlockRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/block/LiquidBlockRenderer.java @@ -67,6 +67,10 @@ public class LiquidBlockRenderer { @@ -572,7 +607,7 @@ index 5481adf92979505840ccbfa1ae721e92198e0030..70811ee71d702e913a8d4ac1ddce6256 } \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/renderer/blockentity/BlockEntityRenderers.java b/src/main/java/net/minecraft/client/renderer/blockentity/BlockEntityRenderers.java -index d4201c111638375441303cbeb0922873f42e1f04..002c00d45e9422bd897dfda12dbd01f9ea2a6778 100644 +index a3d95cee1437135ff16e4893be7d214d0c889f41..55a3195576046cc4f7b91cea67d251868643a401 100644 --- a/src/main/java/net/minecraft/client/renderer/blockentity/BlockEntityRenderers.java +++ b/src/main/java/net/minecraft/client/renderer/blockentity/BlockEntityRenderers.java @@ -11,7 +11,8 @@ import net.minecraft.world.level.block.entity.BlockEntityType; @@ -586,10 +621,10 @@ index d4201c111638375441303cbeb0922873f42e1f04..002c00d45e9422bd897dfda12dbd01f9 } diff --git a/src/main/java/net/minecraft/client/renderer/debug/DebugRenderer.java b/src/main/java/net/minecraft/client/renderer/debug/DebugRenderer.java -index 0d08b58ef9ccddc91ab4cde70f39d4c20f3c517e..14a03484b20211d00d5039d2b8e6ab8703de4b04 100644 +index ad7bf5e4d35994329327200e98b8897fc36309cf..060f558e1da7b410e89fbd4d83cf050b511698d0 100644 --- a/src/main/java/net/minecraft/client/renderer/debug/DebugRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/debug/DebugRenderer.java -@@ -18,6 +18,7 @@ import net.minecraft.world.phys.AABB; +@@ -19,6 +19,7 @@ import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.EntityHitResult; import net.minecraft.world.phys.Vec3; import org.joml.Matrix4f; @@ -597,7 +632,7 @@ index 0d08b58ef9ccddc91ab4cde70f39d4c20f3c517e..14a03484b20211d00d5039d2b8e6ab87 public class DebugRenderer { public final PathfindingRenderer pathfindingRenderer = new PathfindingRenderer(); -@@ -88,7 +89,25 @@ public class DebugRenderer { +@@ -95,7 +96,25 @@ public class DebugRenderer { public void render(PoseStack poseStack, MultiBufferSource.BufferSource bufferSource, double d, double d2, double d3) { if (this.renderChunkborder && !Minecraft.getInstance().showOnlyReducedInfo()) { @@ -625,10 +660,10 @@ index 0d08b58ef9ccddc91ab4cde70f39d4c20f3c517e..14a03484b20211d00d5039d2b8e6ab87 this.gameTestDebugRenderer.render(poseStack, bufferSource, d, d2, d3); diff --git a/src/main/java/net/minecraft/client/renderer/entity/ItemRenderer.java b/src/main/java/net/minecraft/client/renderer/entity/ItemRenderer.java -index 1e2c2e012e12485e7ae6b928fa93b72a374cb2e6..79d990f85e2faf3d293405e1023bffb536dfe4bb 100644 +index 75012454e79bf5efcaf3109c96479e4c7e435479..595d422cefb1927c9b449cc87affae6063a940e4 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/ItemRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/entity/ItemRenderer.java -@@ -156,7 +156,7 @@ public class ItemRenderer implements ResourceManagerReloadListener { +@@ -143,7 +143,7 @@ public class ItemRenderer implements ResourceManagerReloadListener { this.renderModelLists(bakedModel, itemStack, i, i2, poseStack, vertexConsumer); } else { @@ -715,19 +750,19 @@ index 43f39473c5ef3de9e53e6722bea6a0a58382526e..f5254cecd40e9d643cb59316e929560a void handlePongResponse(ClientboundPongResponsePacket var1); diff --git a/src/main/java/net/minecraft/server/Bootstrap.java b/src/main/java/net/minecraft/server/Bootstrap.java -index 3a5da7cd65866508ed4843d5c64edf5036462a63..ee8aa2dd61ce1fef6d17aa3224e1925d57093572 100644 +index 19b414e315dd2de49365e1273fc581673802d4bf..a756e2f92ab34517405c7a9e844d333b85f67f6d 100644 --- a/src/main/java/net/minecraft/server/Bootstrap.java +++ b/src/main/java/net/minecraft/server/Bootstrap.java -@@ -46,6 +46,7 @@ public class Bootstrap { +@@ -52,6 +52,7 @@ public class Bootstrap { EntitySelectorOptions.bootStrap(); DispenseItemBehavior.bootStrap(); CauldronInteraction.bootStrap(); + net.blueberrymc.common.event.lifecycle.RegistryBootstrappedEvent.fire(); // Blueberry BuiltInRegistries.bootStrap(); + CreativeModeTabs.validate(); wrapStreams(); - } diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 9080febfc3d5e71f5873bc2c5d2e0066cfae92d1..e684fec2a117bd9c4a177cb94ff6314749c1d792 100644 +index 3ad26e5bdfb0bfa7c38189d9fa385e22cc752b4a..03560114dd7b0d28ff50d4de767596dc4d965279 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -67,7 +67,7 @@ public class Main { @@ -760,10 +795,10 @@ index 9080febfc3d5e71f5873bc2c5d2e0066cfae92d1..e684fec2a117bd9c4a177cb94ff63147 Path path = (Path)optionSet.valueOf(optionSpec15); if (path != null) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ebb6692769a66cd6c8e96a6fa4f480fa49c4e2ff..d7d5f52fa91e2b7445235f01c070aeebeff1f16a 100644 +index e0b28c1de32fdbc558f4a9cabf3a51b139988594..c7cc5e9191bd611aa7f92ae7f8925155c3fdc1c8 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -273,6 +273,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements FeatureElement +@@ -44,7 +44,8 @@ public class MenuType implements FeatureElement return Registry.register(BuiltInRegistries.MENU, s, new MenuType<>(menuSupplier, FeatureFlags.REGISTRY.subset(featureFlags))); } @@ -876,7 +911,7 @@ index 970e6155629e1a0f035c7c84fb08b3a61179b382..a1924b5815dda117424d96c78288ad08 this.constructor = menuSupplier; this.requiredFeatures = featureFlagSet; } -@@ -58,6 +59,7 @@ public class MenuType implements FeatureElement +@@ -57,6 +58,7 @@ public class MenuType implements FeatureElement return this.requiredFeatures; } @@ -935,10 +970,10 @@ index d9514fbaa0c7069024553948084b757add655cd5..550b93d6ebd2fea64a64e2a3a0833ea4 } \ No newline at end of file diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntityType.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntityType.java -index 363cfb1fb500ceeb56af9a6631923a5a0a82743f..8f06d60ff688fb49d5ef4b6151a87bafafd368a4 100644 +index 7b2553f5d58ad49ea9261cea56b1e219b1b0b4ec..a40745359d24e03d8777f6ef22ad7d60a5fb9b83 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntityType.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntityType.java -@@ -100,6 +100,7 @@ public class BlockEntityType { +@@ -101,6 +101,7 @@ public class BlockEntityType { } @FunctionalInterface diff --git a/MagmaCube-Patches/0005-Client-side-command-support.patch b/MagmaCube-Patches/0005-Client-side-command-support.patch index cb81fe01..96c46a59 100644 --- a/MagmaCube-Patches/0005-Client-side-command-support.patch +++ b/MagmaCube-Patches/0005-Client-side-command-support.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Client-side command support diff --git a/src/main/java/net/minecraft/client/gui/components/CommandSuggestions.java b/src/main/java/net/minecraft/client/gui/components/CommandSuggestions.java -index 247b7c66a92acd5a18efc7ac3e4c94d8bd158aeb..992d70eb95687e6cf41ad29cc678a8a83815b0a7 100644 +index f5533a29cc8a0c4f353dd1b493b4233463123243..23b3b83ebe83296842049647808bf2e551f50642 100644 --- a/src/main/java/net/minecraft/client/gui/components/CommandSuggestions.java +++ b/src/main/java/net/minecraft/client/gui/components/CommandSuggestions.java -@@ -173,7 +173,13 @@ public class CommandSuggestions { +@@ -172,7 +172,13 @@ public class CommandSuggestions { boolean flag2 = this.commandsOnly || flag; int i = this.input.getCursorPosition(); if (flag2) { @@ -24,7 +24,7 @@ index 247b7c66a92acd5a18efc7ac3e4c94d8bd158aeb..992d70eb95687e6cf41ad29cc678a8a8 this.currentParse = commandDispatcher.parse(stringReader, this.minecraft.player.connection.getSuggestionsProvider()); } diff --git a/src/main/java/net/minecraft/client/gui/screens/ChatScreen.java b/src/main/java/net/minecraft/client/gui/screens/ChatScreen.java -index b932b1a2feb0ed6e0b23180ba8f7a387e6357a9c..52ebfba7ee12c71bcd84422d3c823ca480f305a1 100644 +index 6b2acae07f87255e20fcefd6d52632f6443faa36..612ff4c6a3ada672c7d58c65c0409a89b60808b5 100644 --- a/src/main/java/net/minecraft/client/gui/screens/ChatScreen.java +++ b/src/main/java/net/minecraft/client/gui/screens/ChatScreen.java @@ -217,6 +217,12 @@ public class ChatScreen extends Screen { diff --git a/MagmaCube-Patches/0006-CommandRegistrationEvent-to-register-commands-easily.patch b/MagmaCube-Patches/0006-CommandRegistrationEvent-to-register-commands-easily.patch index 13eb3b91..82095ef4 100644 --- a/MagmaCube-Patches/0006-CommandRegistrationEvent-to-register-commands-easily.patch +++ b/MagmaCube-Patches/0006-CommandRegistrationEvent-to-register-commands-easily.patch @@ -5,10 +5,10 @@ Subject: [PATCH] CommandRegistrationEvent to register commands easily diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index 2958e62a110db69a3fead0c8968b371858754e08..41335f512620aab9a396d8736aa6876e73927699 100644 +index f52297f2f6b46ba2a9f6890f659c1b08e9056e90..8e6177844b2092d22cf365d3bed5b8c67d8a64b7 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -188,6 +188,7 @@ public class Commands { +@@ -190,6 +190,7 @@ public class Commands { TriggerCommand.register(this.dispatcher); WeatherCommand.register(this.dispatcher); WorldBorderCommand.register(this.dispatcher); diff --git a/MagmaCube-Patches/0007-Implement-interfaces.patch b/MagmaCube-Patches/0007-Implement-interfaces.patch index 04652e66..bb75f9e4 100644 --- a/MagmaCube-Patches/0007-Implement-interfaces.patch +++ b/MagmaCube-Patches/0007-Implement-interfaces.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement interfaces diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index e0acfd1303b552ccc117d44ae91ac01c0299836a..e9940bd24194c1bf9e1c7d1c3f25b65bebd031a3 100644 +index 5f4f3fd8e5567d6995e58718f35456dea772ce35..3b3b6b96e76282a50b07a4f0d9a84b87b8cff19e 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -71,7 +71,7 @@ import net.minecraft.world.phys.AABB; diff --git a/MagmaCube-Patches/0008-Implement-PlayerBlockBreakEvent-PlayerBlockDropItemE.patch b/MagmaCube-Patches/0008-Implement-PlayerBlockBreakEvent-PlayerBlockDropItemE.patch index 7f641581..d9bc1833 100644 --- a/MagmaCube-Patches/0008-Implement-PlayerBlockBreakEvent-PlayerBlockDropItemE.patch +++ b/MagmaCube-Patches/0008-Implement-PlayerBlockBreakEvent-PlayerBlockDropItemE.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement PlayerBlockBreakEvent/PlayerBlockDropItemEvent diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 820f60b9518879947ed5fa3cbaf417801498fee5..d905aabdac673b62fb74b427618aaf6fa67df875 100644 +index 42bbd0f808fa9338b2bc495bf0b79719c12a23c3..e703e85acad69fd102787073fd4913625aa93b4c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java @@ -221,9 +221,39 @@ public class ServerPlayerGameMode { @@ -87,10 +87,10 @@ index 820f60b9518879947ed5fa3cbaf417801498fee5..d905aabdac673b62fb74b427618aaf6f } } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index e9940bd24194c1bf9e1c7d1c3f25b65bebd031a3..fceb22c803953be61f1c7476001b0b9d071d1600 100644 +index 3b3b6b96e76282a50b07a4f0d9a84b87b8cff19e..bd65486f729531a912aa81b4c43f33f84a112be5 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -112,6 +112,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, net.blueber +@@ -111,6 +111,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, net.blueber private final RegistryAccess registryAccess; private final DamageSources damageSources; private long subTickCount; @@ -99,10 +99,10 @@ index e9940bd24194c1bf9e1c7d1c3f25b65bebd031a3..fceb22c803953be61f1c7476001b0b9d protected Level(WritableLevelData writableLevelData, ResourceKey resourceKey, RegistryAccess registryAccess, Holder holder, Supplier supplier, boolean flag, boolean flag2, long l, int i) { this.profiler = supplier; diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 161fcf120ad80be5bd5ac20bee9226f32e8a2754..d018109d605ea8c2255c47fdcdaf5367759d72a7 100644 +index 7f8b4b8c18eb9367dc1ec18d4da4d108785dba85..eb8a2e67c17154643520d165b04c112cb820a0cd 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java -@@ -314,11 +314,13 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -306,11 +306,13 @@ public class Block extends BlockBehaviour implements ItemLike { if (!level.isClientSide && !itemStack.isEmpty() && level.getGameRules().getBoolean(GameRules.RULE_DOBLOCKDROPS)) { ItemEntity itemEntity = (ItemEntity)supplier.get(); itemEntity.setDefaultPickUpDelay(); @@ -117,7 +117,7 @@ index 161fcf120ad80be5bd5ac20bee9226f32e8a2754..d018109d605ea8c2255c47fdcdaf5367 if (level.getGameRules().getBoolean(GameRules.RULE_DOBLOCKDROPS)) { ExperienceOrb.award(level, Vec3.atCenterOf(pos), exp); } -@@ -477,8 +479,14 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -469,8 +471,14 @@ public class Block extends BlockBehaviour implements ItemLike { return this.builtInRegistryHolder; } diff --git a/MagmaCube-Patches/0010-MenuScreens-register-PAIL-private-public.patch b/MagmaCube-Patches/0010-MenuScreens-register-PAIL-private-public.patch index eb42a8d3..209cef70 100644 --- a/MagmaCube-Patches/0010-MenuScreens-register-PAIL-private-public.patch +++ b/MagmaCube-Patches/0010-MenuScreens-register-PAIL-private-public.patch @@ -5,10 +5,10 @@ Subject: [PATCH] MenuScreens#register PAIL private -> public diff --git a/src/main/java/net/minecraft/client/gui/screens/MenuScreens.java b/src/main/java/net/minecraft/client/gui/screens/MenuScreens.java -index afdcfbd718e31765071958d2a20601f0070552c3..5890a34fb70cd87b4deea935844173eb25eac6a4 100644 +index 8d0f7a75f8a420c2f6128f413261dbf55981596d..d9722f34ddc2321219195d10093e4fec77e955d1 100644 --- a/src/main/java/net/minecraft/client/gui/screens/MenuScreens.java +++ b/src/main/java/net/minecraft/client/gui/screens/MenuScreens.java -@@ -55,7 +55,8 @@ public class MenuScreens { +@@ -54,7 +54,8 @@ public class MenuScreens { return (MenuScreens.ScreenConstructor)SCREENS.get(menuType); } diff --git a/MagmaCube-Patches/0011-Fire-simple-events.patch b/MagmaCube-Patches/0011-Fire-simple-events.patch index f4508bf7..b5186b2d 100644 --- a/MagmaCube-Patches/0011-Fire-simple-events.patch +++ b/MagmaCube-Patches/0011-Fire-simple-events.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fire simple events diff --git a/src/main/java/net/minecraft/client/multiplayer/ClientPacketListener.java b/src/main/java/net/minecraft/client/multiplayer/ClientPacketListener.java -index da5c2a3545903d9497e41cf28c91ce874c6f12c5..c329e5ac475502f9561b8fb75c4c3092844af002 100644 +index 2cc69a71245f10bb3ea9565c92ea3b95a3fc1d15..0b0ddc54154ada7605a1210ea77a6dee1eb1e6c3 100644 --- a/src/main/java/net/minecraft/client/multiplayer/ClientPacketListener.java +++ b/src/main/java/net/minecraft/client/multiplayer/ClientPacketListener.java -@@ -2349,6 +2349,13 @@ public class ClientPacketListener implements TickablePacketListener, ClientGameP +@@ -2379,6 +2379,13 @@ public class ClientPacketListener implements TickablePacketListener, ClientGameP } public void sendChat(String s) { @@ -23,18 +23,21 @@ index da5c2a3545903d9497e41cf28c91ce874c6f12c5..c329e5ac475502f9561b8fb75c4c3092 long l = Crypt.SaltSupplier.getLong(); LastSeenMessagesTracker.Update update = this.lastSeenMessages.generateAndApplyUpdate(); diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 55152736b714086e19c564ba44ea3ae426de9268..5d8d4614fcf361c8386dab39028ea7c4d8de8471 100644 +index f8b439867e23432603bdd78a907e25c40d7be0d2..874bc4cb9a3b2b743bc19ae7bd2195b1011b867c 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -88,6 +88,7 @@ public class Connection extends SimpleChannelInboundHandler> { - LOGGER.error(LogUtils.FATAL_MARKER, "Failed to change protocol to handshake", var3); +@@ -92,8 +92,10 @@ public class Connection extends SimpleChannelInboundHandler> { + + if (this.delayedDisconnect != null) { + this.disconnect(this.delayedDisconnect); ++ return; // Blueberry } + new net.blueberrymc.common.event.network.ConnectionInitEvent(this.channel, this.receiving).callEvent(); // Blueberry } public void setProtocol(ConnectionProtocol connectionProtocol) { -@@ -380,6 +381,7 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -398,6 +400,7 @@ public class Connection extends SimpleChannelInboundHandler> { } } @@ -42,11 +45,18 @@ index 55152736b714086e19c564ba44ea3ae426de9268..5d8d4614fcf361c8386dab39028ea7c4 } public void handleDisconnection() { +@@ -434,4 +437,4 @@ public class Connection extends SimpleChannelInboundHandler> { + this.listener = packetSendListener; + } + } +-} +\ No newline at end of file ++} diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 372f46bedcae2d72b59c3c314069b74113667354..9eed51527803c06ed3b40f4cd457bae50347997a 100644 +index 61ed5dd71e8d6f8204956253c7862f0a8439cfb8..8a09868b1298ced4adb7fd8df87140b83054525b 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -204,6 +204,7 @@ public abstract class PlayerList { +@@ -210,6 +210,7 @@ public abstract class PlayerList { this.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(serverPlayer))); this.sendLevelInfo(serverPlayer, serverLevel2); serverLevel2.addNewPlayer(serverPlayer); diff --git a/MagmaCube-Patches/0012-BungeeCord-ip_forward-support.patch b/MagmaCube-Patches/0012-BungeeCord-ip_forward-support.patch index 52acf226..dbc27121 100644 --- a/MagmaCube-Patches/0012-BungeeCord-ip_forward-support.patch +++ b/MagmaCube-Patches/0012-BungeeCord-ip_forward-support.patch @@ -5,13 +5,13 @@ Subject: [PATCH] BungeeCord ip_forward support diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 5d8d4614fcf361c8386dab39028ea7c4d8de8471..121acb17de96851000c53dbdb8890de3eb7a109c 100644 +index 874bc4cb9a3b2b743bc19ae7bd2195b1011b867c..efbcf9168d2591ec0fa984f337a6cb6a8e25e0a0 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -72,6 +72,11 @@ public class Connection extends SimpleChannelInboundHandler> { - private float averageSentPackets; - private int tickCount; +@@ -74,6 +74,11 @@ public class Connection extends SimpleChannelInboundHandler> { private boolean handlingFault; + @Nullable + private volatile Component delayedDisconnect; + // Blueberry start + public java.util.UUID spoofedUUID; + public com.mojang.authlib.properties.Property[] spoofedProfile; @@ -20,7 +20,7 @@ index 5d8d4614fcf361c8386dab39028ea7c4d8de8471..121acb17de96851000c53dbdb8890de3 public Connection(PacketFlow packetFlow) { this.receiving = packetFlow; -@@ -81,6 +86,7 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -83,6 +88,7 @@ public class Connection extends SimpleChannelInboundHandler> { super.channelActive(channelHandlerContext); this.channel = channelHandlerContext.channel(); this.address = this.channel.remoteAddress(); @@ -28,16 +28,16 @@ index 5d8d4614fcf361c8386dab39028ea7c4d8de8471..121acb17de96851000c53dbdb8890de3 try { this.setProtocol(ConnectionProtocol.HANDSHAKING); -@@ -265,6 +271,7 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -272,6 +278,7 @@ public class Connection extends SimpleChannelInboundHandler> { } public void disconnect(Component component) { + this.preparing = false; // Blueberry - if (this.channel.isOpen()) { - this.channel.close().awaitUninterruptibly(); - this.disconnectedReason = component; + if (this.channel == null) { + this.delayedDisconnect = component; + } diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index c924aa21e3030ea9f3e0a11c3c4fe5a67c769860..add3eea38847d7c5253333f82c1503d9c52572b5 100644 +index a2f3a59203096525b47fbf4c18e487d510d76888..ab1c03f68feab2dd7ac4fcef1402d0c1b35f8906 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -142,7 +142,14 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -69,7 +69,7 @@ index 5b461d5ce873bd2719f8a8418f707e4d19d0dffa..e8ca3c68fe7b8e766843e6f235e69dd3 connection.handleDisconnection(); } diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -index a2707fabf71fc5bf374692abeb76fb73da98c9a2..ae8edbb902d2d9ae8f63b5c467ee27d958eec4db 100644 +index 9f811cf7021e070dfd41f5fdb85b87badae3b770..537e5e3ed9aa3f5e95178394a57aa287f137865c 100644 --- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java @@ -11,6 +11,7 @@ import net.minecraft.network.protocol.status.ServerStatus; @@ -77,7 +77,7 @@ index a2707fabf71fc5bf374692abeb76fb73da98c9a2..ae8edbb902d2d9ae8f63b5c467ee27d9 public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketListener { + private static final com.google.gson.Gson gson = new com.google.gson.Gson(); // Blueberry - private static final Component IGNORE_STATUS_REASON = Component.literal("Ignoring status request"); + private static final Component IGNORE_STATUS_REASON = Component.translatable("disconnect.ignoring_status_request"); private final MinecraftServer server; private final Connection connection; @@ -36,6 +37,24 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL @@ -105,6 +105,13 @@ index a2707fabf71fc5bf374692abeb76fb73da98c9a2..ae8edbb902d2d9ae8f63b5c467ee27d9 } break; case STATUS: +@@ -59,4 +78,4 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL + public boolean isAcceptingMessages() { + return this.connection.isConnected(); + } +-} +\ No newline at end of file ++} diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java index 1e0faba662da2974eafdab383df1c0d1f3820122..0ecd5515fc2642874db753632932a4fbafa44574 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/MagmaCube-Patches/0014-Implement-debug-packets.patch b/MagmaCube-Patches/0014-Implement-debug-packets.patch index 976f8b5f..a6ab0d7e 100644 --- a/MagmaCube-Patches/0014-Implement-debug-packets.patch +++ b/MagmaCube-Patches/0014-Implement-debug-packets.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement debug packets diff --git a/src/main/java/net/minecraft/network/protocol/game/DebugPackets.java b/src/main/java/net/minecraft/network/protocol/game/DebugPackets.java -index 2037be1b974d0b1c82ccde6a59199bf489d64aa1..090b39cca1979444418a7a0d4f57e8d67c04d304 100644 +index d5a9bfa72d157f575cd4441455f340303f4ae96d..e8b7657f88d7c078c7c92a7f83384ccc12e879bc 100644 --- a/src/main/java/net/minecraft/network/protocol/game/DebugPackets.java +++ b/src/main/java/net/minecraft/network/protocol/game/DebugPackets.java -@@ -92,8 +92,19 @@ public class DebugPackets { +@@ -91,8 +91,19 @@ public class DebugPackets { private static void sendVillageSectionsPacket(ServerLevel serverLevel, BlockPos blockPos) { } @@ -29,7 +29,7 @@ index 2037be1b974d0b1c82ccde6a59199bf489d64aa1..090b39cca1979444418a7a0d4f57e8d6 public static void sendNeighborsUpdatePacket(Level level, BlockPos blockPos) { } -@@ -101,11 +112,23 @@ public class DebugPackets { +@@ -100,11 +111,23 @@ public class DebugPackets { public static void sendStructurePacket(WorldGenLevel worldGenLevel, StructureStart structureStart) { } @@ -54,7 +54,7 @@ index 2037be1b974d0b1c82ccde6a59199bf489d64aa1..090b39cca1979444418a7a0d4f57e8d6 public static void sendRaids(ServerLevel serverLevel, Collection collection) { } -@@ -113,8 +136,38 @@ public class DebugPackets { +@@ -112,8 +135,38 @@ public class DebugPackets { public static void sendEntityBrain(LivingEntity livingEntity) { } diff --git a/MagmaCube-Patches/0015-Add-workaround-for-leaves-not-ticking.patch b/MagmaCube-Patches/0015-Add-workaround-for-leaves-not-ticking.patch index 5b4163f9..e90540cc 100644 --- a/MagmaCube-Patches/0015-Add-workaround-for-leaves-not-ticking.patch +++ b/MagmaCube-Patches/0015-Add-workaround-for-leaves-not-ticking.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add workaround for leaves not ticking diff --git a/src/main/java/net/minecraft/world/level/block/LeavesBlock.java b/src/main/java/net/minecraft/world/level/block/LeavesBlock.java -index 4816ccff6413f2a5e96b09fc79aeb1c0e03a2544..4701adedbaf94fa3f4a54972fa3af9bd7627258d 100644 +index 0c28b0237db0d7cf205f25c8dc31d444408f168a..78035b49467b9526bc403d44f5107a45d8da079a 100644 --- a/src/main/java/net/minecraft/world/level/block/LeavesBlock.java +++ b/src/main/java/net/minecraft/world/level/block/LeavesBlock.java -@@ -69,7 +69,11 @@ public class LeavesBlock extends Block implements SimpleWaterloggedBlock { +@@ -70,7 +70,11 @@ public class LeavesBlock extends Block implements SimpleWaterloggedBlock { int i = getDistanceAt(blockState2) + 1; if (i != 1 || blockState.getValue(DISTANCE) != i) { diff --git a/MagmaCube-Patches/0017-Add-additional-information-to-F3.patch b/MagmaCube-Patches/0017-Add-additional-information-to-F3.patch index e60d455e..79a328bf 100644 --- a/MagmaCube-Patches/0017-Add-additional-information-to-F3.patch +++ b/MagmaCube-Patches/0017-Add-additional-information-to-F3.patch @@ -9,10 +9,10 @@ Added to game information: - Client Protocol Version diff --git a/src/main/java/net/minecraft/client/gui/components/DebugScreenOverlay.java b/src/main/java/net/minecraft/client/gui/components/DebugScreenOverlay.java -index 4168028ea9fea90d5997bdaba1052a3d22caaae5..21db1c0e5a35bdc4212fac500e4837511a57b19b 100644 +index 71d754d78b307bc6d3fbaf84cddd6c6811385c03..ecb24567a9a87ce9eb4c19fb14aedd514d8d6dcd 100644 --- a/src/main/java/net/minecraft/client/gui/components/DebugScreenOverlay.java +++ b/src/main/java/net/minecraft/client/gui/components/DebugScreenOverlay.java -@@ -182,8 +182,9 @@ public class DebugScreenOverlay extends GuiComponent { +@@ -176,8 +176,9 @@ public class DebugScreenOverlay { } BlockPos blockPos = this.minecraft.getCameraEntity().blockPosition(); @@ -23,7 +23,7 @@ index 4168028ea9fea90d5997bdaba1052a3d22caaae5..21db1c0e5a35bdc4212fac500e483751 } else { Entity entity = this.minecraft.getCameraEntity(); Direction direction = entity.getDirection(); -@@ -213,7 +214,7 @@ public class DebugScreenOverlay extends GuiComponent { +@@ -207,7 +208,7 @@ public class DebugScreenOverlay { Level level = this.getLevel(); LongSet longSet = (LongSet)(level instanceof ServerLevel ? ((ServerLevel)level).getForcedChunks() : LongSets.EMPTY_SET); @@ -32,7 +32,7 @@ index 4168028ea9fea90d5997bdaba1052a3d22caaae5..21db1c0e5a35bdc4212fac500e483751 String s8 = this.getServerChunkStats(); if (s8 != null) { list.add(s8); -@@ -301,8 +302,8 @@ public class DebugScreenOverlay extends GuiComponent { +@@ -295,8 +296,8 @@ public class DebugScreenOverlay { } list.add(this.minecraft.getSoundManager().getDebugString() + String.format(Locale.ROOT, " (Mood %d%%)", Math.round(this.minecraft.player.getCurrentMood() * 100.0F))); diff --git a/MagmaCube-Patches/0018-Save-Use-InstalledMods-to-from-level.dat.patch b/MagmaCube-Patches/0018-Save-Use-InstalledMods-to-from-level.dat.patch index 2d4e3345..ea59c219 100644 --- a/MagmaCube-Patches/0018-Save-Use-InstalledMods-to-from-level.dat.patch +++ b/MagmaCube-Patches/0018-Save-Use-InstalledMods-to-from-level.dat.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Save/Use InstalledMods to/from level.dat diff --git a/src/main/java/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java b/src/main/java/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java -index ab4f0bac052f18dbfb12691fcfde0f35259fdc5f..4a97a457e9efa1c53c61ef3f42c6833b4d22292a 100644 +index 6a3de0b3b066fbdbbc5390d409877bb8b3aad47a..6ff03574dd5ed18ddee33f7a679ec720a8e23ece 100644 --- a/src/main/java/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java +++ b/src/main/java/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java -@@ -175,6 +175,12 @@ public class WorldOpenFlows { +@@ -181,6 +181,12 @@ public class WorldOpenFlows { return; } @@ -22,10 +22,10 @@ index ab4f0bac052f18dbfb12691fcfde0f35259fdc5f..4a97a457e9efa1c53c61ef3f42c6833b boolean flag3 = worldData.worldGenOptions().isOldCustomizedWorld(); boolean flag4 = worldData.worldGenSettingsLifecycle() != Lifecycle.stable(); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d7d5f52fa91e2b7445235f01c070aeebeff1f16a..2b4c28c628dae74261845b43578a8d62cccf0406 100644 +index c7cc5e9191bd611aa7f92ae7f8925155c3fdc1c8..22f8c47c82c0e6999a77feb8afbdc48299915cc5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -311,6 +311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop knownServerBrands; +@@ -82,6 +82,7 @@ public class PrimaryLevelData implements ServerLevelData, WorldData { private boolean wasModded; + private final Set removedFeatureFlags; private final TimerQueue scheduledEvents; + private final Set installedMods = new java.util.HashSet<>(); // Blueberry - private PrimaryLevelData(@Nullable DataFixer dataFixer, int i, @Nullable CompoundTag compoundTag, boolean flag, int i2, int i3, int i4, float f, long l, long l2, int i5, int i6, int i7, boolean flag2, int i8, boolean flag3, boolean flag4, boolean flag5, WorldBorder.Settings settings, int i9, int i10, @Nullable UUID uuid, Set set, TimerQueue timerQueue, @Nullable CompoundTag compoundTag2, CompoundTag compoundTag3, LevelSettings levelSettings, WorldOptions worldOptions, PrimaryLevelData.SpecialWorldProperty specialWorldProperty, Lifecycle lifecycle) { + private PrimaryLevelData(@Nullable DataFixer dataFixer, int i, @Nullable CompoundTag compoundTag, boolean flag, int i2, int i3, int i4, float f, long l, long l2, int i5, int i6, int i7, boolean flag2, int i8, boolean flag3, boolean flag4, boolean flag5, WorldBorder.Settings settings, int i9, int i10, @Nullable UUID uuid, Set set, Set set2, TimerQueue timerQueue, @Nullable CompoundTag compoundTag2, EndDragonFight.Data data, LevelSettings levelSettings, WorldOptions worldOptions, PrimaryLevelData.SpecialWorldProperty specialWorldProperty, Lifecycle lifecycle) { this.fixerUpper = dataFixer; -@@ -120,7 +121,11 @@ public class PrimaryLevelData implements ServerLevelData, WorldData { +@@ -123,7 +124,9 @@ public class PrimaryLevelData implements ServerLevelData, WorldData { + public static PrimaryLevelData parse(Dynamic dynamic, DataFixer dataFixer, int i, @Nullable CompoundTag compoundTag, LevelSettings levelSettings, LevelVersion levelVersion, PrimaryLevelData.SpecialWorldProperty specialWorldProperty, WorldOptions worldOptions, Lifecycle lifecycle) { long l = dynamic.get("Time").asLong(0L); - CompoundTag compoundTag2 = (CompoundTag)(dynamic.get("DragonFight").result().orElseGet(() -> dynamic.get("DimensionData").get("1").get("DragonFight").orElseEmptyMap())).convert(NbtOps.INSTANCE).getValue(); -- return new PrimaryLevelData(dataFixer, i, compoundTag, dynamic.get("WasModded").asBoolean(false), dynamic.get("SpawnX").asInt(0), dynamic.get("SpawnY").asInt(0), dynamic.get("SpawnZ").asInt(0), dynamic.get("SpawnAngle").asFloat(0.0F), l, dynamic.get("DayTime").asLong(l), levelVersion.levelDataVersion(), dynamic.get("clearWeatherTime").asInt(0), dynamic.get("rainTime").asInt(0), dynamic.get("raining").asBoolean(false), dynamic.get("thunderTime").asInt(0), dynamic.get("thundering").asBoolean(false), dynamic.get("initialized").asBoolean(true), dynamic.get("DifficultyLocked").asBoolean(false), WorldBorder.Settings.read(dynamic, WorldBorder.DEFAULT_SETTINGS), dynamic.get("WanderingTraderSpawnDelay").asInt(0), dynamic.get("WanderingTraderSpawnChance").asInt(0), (UUID)dynamic.get("WanderingTraderId").read(UUIDUtil.CODEC).result().orElse(null), dynamic.get("ServerBrands").asStream().flatMap((dynamicx) -> dynamicx.asString().result().stream()).collect(Collectors.toCollection(Sets::newLinkedHashSet)), new TimerQueue<>(TimerCallbacks.SERVER_CALLBACKS, dynamic.get("ScheduledEvents").asStream()), (CompoundTag)dynamic.get("CustomBossEvents").orElseEmptyMap().getValue(), compoundTag2, levelSettings, worldOptions, specialWorldProperty, lifecycle); -+ // Blueberry start -+ PrimaryLevelData data = new PrimaryLevelData(dataFixer, i, compoundTag, dynamic.get("WasModded").asBoolean(false), dynamic.get("SpawnX").asInt(0), dynamic.get("SpawnY").asInt(0), dynamic.get("SpawnZ").asInt(0), dynamic.get("SpawnAngle").asFloat(0.0F), l, dynamic.get("DayTime").asLong(l), levelVersion.levelDataVersion(), dynamic.get("clearWeatherTime").asInt(0), dynamic.get("rainTime").asInt(0), dynamic.get("raining").asBoolean(false), dynamic.get("thunderTime").asInt(0), dynamic.get("thundering").asBoolean(false), dynamic.get("initialized").asBoolean(true), dynamic.get("DifficultyLocked").asBoolean(false), WorldBorder.Settings.read(dynamic, WorldBorder.DEFAULT_SETTINGS), dynamic.get("WanderingTraderSpawnDelay").asInt(0), dynamic.get("WanderingTraderSpawnChance").asInt(0), (UUID)dynamic.get("WanderingTraderId").read(UUIDUtil.CODEC).result().orElse(null), dynamic.get("ServerBrands").asStream().flatMap((dynamicx) -> dynamicx.asString().result().stream()).collect(Collectors.toCollection(Sets::newLinkedHashSet)), new TimerQueue<>(TimerCallbacks.SERVER_CALLBACKS, dynamic.get("ScheduledEvents").asStream()), (CompoundTag)dynamic.get("CustomBossEvents").orElseEmptyMap().getValue(), compoundTag2, levelSettings, worldOptions, specialWorldProperty, lifecycle); +- return new PrimaryLevelData(dataFixer, i, compoundTag, dynamic.get("WasModded").asBoolean(false), dynamic.get("SpawnX").asInt(0), dynamic.get("SpawnY").asInt(0), dynamic.get("SpawnZ").asInt(0), dynamic.get("SpawnAngle").asFloat(0.0F), l, dynamic.get("DayTime").asLong(l), levelVersion.levelDataVersion(), dynamic.get("clearWeatherTime").asInt(0), dynamic.get("rainTime").asInt(0), dynamic.get("raining").asBoolean(false), dynamic.get("thunderTime").asInt(0), dynamic.get("thundering").asBoolean(false), dynamic.get("initialized").asBoolean(true), dynamic.get("DifficultyLocked").asBoolean(false), WorldBorder.Settings.read(dynamic, WorldBorder.DEFAULT_SETTINGS), dynamic.get("WanderingTraderSpawnDelay").asInt(0), dynamic.get("WanderingTraderSpawnChance").asInt(0), (UUID)dynamic.get("WanderingTraderId").read(UUIDUtil.CODEC).result().orElse(null), dynamic.get("ServerBrands").asStream().flatMap((dynamicx) -> dynamicx.asString().result().stream()).collect(Collectors.toCollection(Sets::newLinkedHashSet)), dynamic.get("removed_features").asStream().flatMap((dynamicx) -> dynamicx.asString().result().stream()).collect(Collectors.toSet()), new TimerQueue<>(TimerCallbacks.SERVER_CALLBACKS, dynamic.get("ScheduledEvents").asStream()), (CompoundTag)dynamic.get("CustomBossEvents").orElseEmptyMap().getValue(), (EndDragonFight.Data)dynamic.get("DragonFight").read(EndDragonFight.Data.CODEC).resultOrPartial(LOGGER::error).orElse(EndDragonFight.Data.DEFAULT), levelSettings, worldOptions, specialWorldProperty, lifecycle); ++ PrimaryLevelData data = new PrimaryLevelData(dataFixer, i, compoundTag, dynamic.get("WasModded").asBoolean(false), dynamic.get("SpawnX").asInt(0), dynamic.get("SpawnY").asInt(0), dynamic.get("SpawnZ").asInt(0), dynamic.get("SpawnAngle").asFloat(0.0F), l, dynamic.get("DayTime").asLong(l), levelVersion.levelDataVersion(), dynamic.get("clearWeatherTime").asInt(0), dynamic.get("rainTime").asInt(0), dynamic.get("raining").asBoolean(false), dynamic.get("thunderTime").asInt(0), dynamic.get("thundering").asBoolean(false), dynamic.get("initialized").asBoolean(true), dynamic.get("DifficultyLocked").asBoolean(false), WorldBorder.Settings.read(dynamic, WorldBorder.DEFAULT_SETTINGS), dynamic.get("WanderingTraderSpawnDelay").asInt(0), dynamic.get("WanderingTraderSpawnChance").asInt(0), (UUID)dynamic.get("WanderingTraderId").read(UUIDUtil.CODEC).result().orElse(null), dynamic.get("ServerBrands").asStream().flatMap((dynamicx) -> dynamicx.asString().result().stream()).collect(Collectors.toCollection(Sets::newLinkedHashSet)), dynamic.get("removed_features").asStream().flatMap((dynamicx) -> dynamicx.asString().result().stream()).collect(Collectors.toSet()), new TimerQueue<>(TimerCallbacks.SERVER_CALLBACKS, dynamic.get("ScheduledEvents").asStream()), (CompoundTag)dynamic.get("CustomBossEvents").orElseEmptyMap().getValue(), (EndDragonFight.Data)dynamic.get("DragonFight").read(EndDragonFight.Data.CODEC).resultOrPartial(LOGGER::error).orElse(EndDragonFight.Data.DEFAULT), levelSettings, worldOptions, specialWorldProperty, lifecycle); + data.installedMods.addAll(dynamic.get("InstalledMods").asStream().flatMap((dynamicx) -> net.blueberrymc.util.Util.toStream(net.blueberrymc.common.bml.SimpleVersionedModInfo.load(dynamicx))).collect(Collectors.toCollection(Sets::newLinkedHashSet))); + return data; -+ // Blueberry end } public CompoundTag createTag(RegistryAccess registryAccess, @Nullable CompoundTag compoundTag) { -@@ -138,6 +143,11 @@ public class PrimaryLevelData implements ServerLevelData, WorldData { - ListTag listTag = new ListTag(); - this.knownServerBrands.stream().map(StringTag::valueOf).forEach(listTag::add); - compoundTag.put("ServerBrands", listTag); +@@ -139,6 +142,11 @@ public class PrimaryLevelData implements ServerLevelData, WorldData { + + private void setTagData(RegistryAccess registryAccess, CompoundTag compoundTag, @Nullable CompoundTag compoundTag2) { + compoundTag.put("ServerBrands", stringCollectionToTag(this.knownServerBrands)); + // Blueberry start -+ listTag.clear(); ++ ListTag listTag = new ListTag(); + this.installedMods.stream().map(net.blueberrymc.common.bml.VersionedModInfo::save).forEach(listTag::add); + compoundTag.put("InstalledMods", listTag); + // Blueberry end compoundTag.putBoolean("WasModded", this.wasModded); - CompoundTag compoundTag3 = new CompoundTag(); - compoundTag3.putString("Name", SharedConstants.getCurrentVersion().getName()); -@@ -467,4 +477,17 @@ public class PrimaryLevelData implements ServerLevelData, WorldData { + if (!this.removedFeatureFlags.isEmpty()) { + compoundTag.put("removed_features", stringCollectionToTag(this.removedFeatureFlags)); +@@ -482,4 +490,17 @@ public class PrimaryLevelData implements ServerLevelData, WorldData { FLAT, DEBUG; } +-} +\ No newline at end of file + + // Blueberry start + @Override @@ -87,14 +87,13 @@ index 8b971a9d9dbdd51cfef525acaacdf0c983b0d5ea..61f300033d0f186242d3888cac3ec27c + return this.installedMods; + } + // Blueberry end - } -\ No newline at end of file ++} diff --git a/src/main/java/net/minecraft/world/level/storage/WorldData.java b/src/main/java/net/minecraft/world/level/storage/WorldData.java -index 7b48bd6811fd1aa9a368c8fcbba91cd784bb6248..69a0fc6f6c3dd9c2e20c3cb2393cbf2eb6dce119 100644 +index 092eda39d48152483aa86f009b4cd1657306b76c..226a83f056af21e0e66d95d9e618bc0b447c1b5a 100644 --- a/src/main/java/net/minecraft/world/level/storage/WorldData.java +++ b/src/main/java/net/minecraft/world/level/storage/WorldData.java -@@ -16,7 +16,7 @@ import net.minecraft.world.level.LevelSettings; - import net.minecraft.world.level.WorldDataConfiguration; +@@ -17,7 +17,7 @@ import net.minecraft.world.level.WorldDataConfiguration; + import net.minecraft.world.level.dimension.end.EndDragonFight; import net.minecraft.world.level.levelgen.WorldOptions; -public interface WorldData { diff --git a/MagmaCube-Patches/0019-Implement-permissions-API.patch b/MagmaCube-Patches/0019-Implement-permissions-API.patch index 7f8cddbf..f9ced30c 100644 --- a/MagmaCube-Patches/0019-Implement-permissions-API.patch +++ b/MagmaCube-Patches/0019-Implement-permissions-API.patch @@ -18,10 +18,10 @@ index da359dc9037eae090646ebb56831b0d54fec2d87..9b09393e545cae57248e6eb7a0c7041c public void sendSystemMessage(Component component) { } diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java -index b54b175e7816b7758bcad03d58aeb38f8af52209..faf0921815dd203b76fe3646035248ad9489b400 100644 +index c571d3746321f638ca8ec96e2ac65662e3a1641e..eb19230239009b0393e5c9fe595e8797b41ecfdf 100644 --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java -@@ -38,7 +38,7 @@ import net.minecraft.world.level.dimension.DimensionType; +@@ -40,7 +40,7 @@ import net.minecraft.world.level.dimension.DimensionType; import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec3; @@ -30,7 +30,7 @@ index b54b175e7816b7758bcad03d58aeb38f8af52209..faf0921815dd203b76fe3646035248ad public static final SimpleCommandExceptionType ERROR_NOT_PLAYER = new SimpleCommandExceptionType(Component.translatable("permissions.requires.player")); public static final SimpleCommandExceptionType ERROR_NOT_ENTITY = new SimpleCommandExceptionType(Component.translatable("permissions.requires.entity")); private final CommandSource source; -@@ -346,4 +346,16 @@ public class CommandSourceStack implements SharedSuggestionProvider { +@@ -364,4 +364,16 @@ public class CommandSourceStack implements SharedSuggestionProvider { public FeatureFlagSet enabledFeatures() { return this.level.enabledFeatures(); } @@ -49,10 +49,10 @@ index b54b175e7816b7758bcad03d58aeb38f8af52209..faf0921815dd203b76fe3646035248ad } \ No newline at end of file diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2b4c28c628dae74261845b43578a8d62cccf0406..70afffca9f20358f2324703ad6046099c9b68c95 100644 +index 22f8c47c82c0e6999a77feb8afbdc48299915cc5..c420c40e822d9800750914405096538e151be492 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1835,4 +1835,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop