Skip to content

Commit

Permalink
Update to 1.19.1 Pre-release 2
Browse files Browse the repository at this point in the history
  • Loading branch information
acrylic-style committed Jul 1, 2022
1 parent f74be16 commit d1d9e4b
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void registerEvents(@NotNull BlueberryMod mod, @NotNull Object listener)
* @param <T> the event type
*/
@SuppressWarnings("unchecked")
public <T extends Event> void registerEvent(@NotNull Class<T> clazz, @NotNull BlueberryMod mod, @NotNull EventPriority priority, @NotNull ThrowableConsumer<T> consumer) {
public <T extends Event> void registerEvent(@NotNull Class<T> clazz, @NotNull BlueberryMod mod, @NotNull EventPriority priority, @NotNull ThrowableConsumer<@NotNull T> consumer) {
Nag.deprecatedEvent(clazz, mod); // notify the mod authors if event is deprecated
getHandlerList(clazz).add(event -> consumer.accept((T) event), priority, (Object) null, mod);
}
Expand Down
2 changes: 1 addition & 1 deletion MagmaCube-Patches/0001-POM-Changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ 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 f631124b85fb375c6375d595aa5a635b371734d1..608f29b206581bbf31b1ab1561c02c54ebcf1b0e 100644
index a8478cb007b26ef2c2bcdcd99419f5173f724593..3d5d90b083b96f64d88062dc7b3d687126d48f9d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -920,7 +920,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Get our version instead of magmacube's


diff --git a/src/main/java/net/minecraft/DetectedVersion.java b/src/main/java/net/minecraft/DetectedVersion.java
index 1e110685839e47df6df97e4e08c521db1c55af52..b623e5be02c8301083f65dc8d98b481a50d1869a 100644
index 0599a17f3240b79ac70b1317553ff1584e4f4ead..9671e0ad8da0b010c6ac0109b38a14565fdb3366 100644
--- a/src/main/java/net/minecraft/DetectedVersion.java
+++ b/src/main/java/net/minecraft/DetectedVersion.java
@@ -26,7 +26,7 @@ public class DetectedVersion implements WorldVersion {
Expand Down Expand Up @@ -36,10 +36,10 @@ index 1e110685839e47df6df97e4e08c521db1c55af52..b623e5be02c8301083f65dc8d98b481a

public static WorldVersion tryDetectVersion() {
diff --git a/src/main/java/net/minecraft/client/Minecraft.java b/src/main/java/net/minecraft/client/Minecraft.java
index 33d43573684cff826783466503af0a8ea70ad626..334c25a4127f6dddda3c966f25800e2b1c102a04 100644
index 18058417adad03d06c61e5f711db46f1966548f1..914872b02766cc6822491c2ca230b3fb03d949fc 100644
--- a/src/main/java/net/minecraft/client/Minecraft.java
+++ b/src/main/java/net/minecraft/client/Minecraft.java
@@ -723,7 +723,7 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
@@ -728,7 +728,7 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
}

public String getLaunchedVersion() {
Expand Down
42 changes: 21 additions & 21 deletions MagmaCube-Patches/0004-Mods-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ index da5ac7b22dd629ec1fffcdabc35743c161c5d611..89ff780da13eb16eb1a06fa4652c8604

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 334c25a4127f6dddda3c966f25800e2b1c102a04..e79b97b31579b95bca90981a8a47f2463d1cb2e9 100644
index 914872b02766cc6822491c2ca230b3fb03d949fc..e8682313699cb2199bc365ef43b3006c748f6a4b 100644
--- a/src/main/java/net/minecraft/client/Minecraft.java
+++ b/src/main/java/net/minecraft/client/Minecraft.java
@@ -458,7 +458,9 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
@@ -461,7 +461,9 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> 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);
Expand All @@ -112,31 +112,31 @@ index 334c25a4127f6dddda3c966f25800e2b1c102a04..e79b97b31579b95bca90981a8a47f246
this.resourcePackRepository.reload();
this.options.loadSelectedResourcePacks(this.resourcePackRepository);
this.languageManager = new LanguageManager(this.options.languageCode);
@@ -472,6 +474,7 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
@@ -475,6 +477,7 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
this.splashManager = new SplashManager(this.user);
this.resourceManager.registerReloadListener(this.splashManager);
this.musicManager = new MusicManager(this);
+ net.blueberrymc.client.EarlyLoadingScreen.getInstance().blockUntilFinish(); // Blueberry
this.fontManager = new FontManager(this.textureManager);
this.font = this.fontManager.createFont();
this.resourceManager.registerReloadListener(this.fontManager.getReloadListener());
@@ -490,6 +493,7 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
@@ -493,6 +496,7 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> 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);
+ BlockEntityWithoutLevelRenderer.instance = blockEntityWithoutLevelRenderer; // Blueberry
this.resourceManager.registerReloadListener(blockEntityWithoutLevelRenderer);
this.itemRenderer = new ItemRenderer(this.textureManager, this.modelManager, this.itemColors, blockEntityWithoutLevelRenderer);
this.resourceManager.registerReloadListener(this.itemRenderer);
@@ -543,6 +547,7 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
@@ -548,6 +552,7 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
this.reportingContext = ReportingContext.create(ReportEnvironment.local(), this.userApiService);
LoadingOverlay.registerTextures(this);
List<PackResources> list = this.resourcePackRepository.openAllSelected();
+ net.blueberrymc.common.Blueberry.getModLoader().callInit(); // Blueberry
this.reloadStateTracker.startReload(ResourceLoadStateTracker.ReloadReason.INITIAL, list);
this.setOverlay(new LoadingOverlay(this, this.resourceManager.createReload(Util.backgroundExecutor(), this, RESOURCE_RELOAD_INITIAL_TASK, list), (optional) -> Util.ifElse(optional, this::rollbackResourcePacks, () -> {
if (SharedConstants.IS_RUNNING_IN_IDE) {
@@ -552,8 +557,9 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
@@ -557,8 +562,9 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
this.reloadStateTracker.finishReload();
}), false));
if (s != null) {
Expand All @@ -147,7 +147,7 @@ index 334c25a4127f6dddda3c966f25800e2b1c102a04..e79b97b31579b95bca90981a8a47f246
this.setScreen(BanNoticeScreen.create((flag) -> {
if (flag) {
Util.getPlatform().openUri("https://aka.ms/mcjavamoderation");
@@ -561,8 +567,9 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
@@ -566,8 +572,9 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements

this.setScreen(new TitleScreen(true));
}, this.multiplayerBan()));
Expand All @@ -158,7 +158,7 @@ index 334c25a4127f6dddda3c966f25800e2b1c102a04..e79b97b31579b95bca90981a8a47f246
}

}
@@ -739,9 +746,10 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
@@ -744,9 +751,10 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
}

public static void crash(CrashReport crashReport) {
Expand All @@ -170,31 +170,31 @@ index 334c25a4127f6dddda3c966f25800e2b1c102a04..e79b97b31579b95bca90981a8a47f246
if (crashReport.getSaveFile() != null) {
Bootstrap.realStdoutPrintln("#@!@# Game crashed! Crash report saved to: #@!@# " + crashReport.getSaveFile());
System.exit(-1);
@@ -894,6 +902,7 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
@@ -899,6 +907,7 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements

this.screen = screen;
BufferUploader.reset();
+ net.blueberrymc.client.event.ClientEventFactory.callScreenChangedEvent(this.screen); // Blueberry
if (screen != null) {
this.mouseHandler.releaseMouse();
KeyMapping.releaseAll();
@@ -909,6 +918,7 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
@@ -914,6 +923,7 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements

public void setOverlay(@Nullable Overlay overlay) {
this.overlay = overlay;
+ net.blueberrymc.client.event.ClientEventFactory.callOverlayChangedEvent(overlay); // Blueberry
}

public void destroy() {
@@ -933,6 +943,7 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
@@ -938,6 +948,7 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
this.screen.removed();
}

+ net.blueberrymc.common.Blueberry.shutdown();
this.close();
} finally {
Util.timeSource = System::nanoTime;
@@ -1717,6 +1728,10 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
@@ -1722,6 +1733,10 @@ public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements
this.pendingConnection.tick();
}

Expand All @@ -206,10 +206,10 @@ index 334c25a4127f6dddda3c966f25800e2b1c102a04..e79b97b31579b95bca90981a8a47f246
this.keyboardHandler.tick();
this.profiler.pop();
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 d625340ebe571852dee8f27f2b21a94d165098bc..9ec59c1de0aeb17cec0824d71bfbf8e55855031c 100644
index 59964c89323957ab357f1a19292502de3a47737e..2ba792735a9635a20e269ab99b5654f0ebf4a0d6 100644
--- a/src/main/java/net/minecraft/client/gui/components/ChatComponent.java
+++ b/src/main/java/net/minecraft/client/gui/components/ChatComponent.java
@@ -287,15 +287,27 @@ public class ChatComponent extends GuiComponent {
@@ -365,15 +365,27 @@ public class ChatComponent extends GuiComponent {
}

public static int getWidth(double d) {
Expand Down Expand Up @@ -414,19 +414,19 @@ index 6813cc831731506dedf18d0b475918c149ffb8b8..12d7e2656e89ead6bd08958757328d76
String s = parseArgument(optionSet, optionSpec7);
Proxy proxy = Proxy.NO_PROXY;
diff --git a/src/main/java/net/minecraft/client/multiplayer/ClientPacketListener.java b/src/main/java/net/minecraft/client/multiplayer/ClientPacketListener.java
index c589d9593e66062d7c3f85e0e1decae30bf6ed79..3a62e6d250f076e92a3dd2682847392f79206567 100644
index dadd91f0e1c9369385d29207bb1a5482a3465924..a4081163c75dfb6fb7507a7652c4ff22abbeef37 100644
--- a/src/main/java/net/minecraft/client/multiplayer/ClientPacketListener.java
+++ b/src/main/java/net/minecraft/client/multiplayer/ClientPacketListener.java
@@ -288,7 +288,7 @@ import net.minecraft.world.scores.criteria.ObjectiveCriteria;
import org.apache.commons.lang3.StringUtils;
@@ -281,7 +281,7 @@ import net.minecraft.world.scores.Team;
import net.minecraft.world.scores.criteria.ObjectiveCriteria;
import org.slf4j.Logger;

-public class ClientPacketListener implements ClientGamePacketListener {
+public class ClientPacketListener implements ClientGamePacketListener, net.blueberrymc.network.client.ClientBlueberryPacketListener { // Blueberry
private static final Logger LOGGER = LogUtils.getLogger();
private static final Component GENERIC_DISCONNECT_MESSAGE = Component.translatable("disconnect.lost");
private final Connection connection;
@@ -1658,6 +1658,7 @@ public class ClientPacketListener implements ClientGamePacketListener {
@@ -1606,6 +1606,7 @@ public class ClientPacketListener implements ClientGamePacketListener {

try {
friendlyByteBuf = clientboundCustomPayloadPacket.getData();
Expand Down Expand Up @@ -774,7 +774,7 @@ index 3ef4b97f18968f75213c7d3ce9276d91b46e26c9..3dddac41cf3163217f932217c90e6f21
CrashReport.preload();
if (optionSet.has(optionSpec14)) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 608f29b206581bbf31b1ab1561c02c54ebcf1b0e..a9569e5116b8d8f6acf64b6c5a418712f5037076 100644
index 3d5d90b083b96f64d88062dc7b3d687126d48f9d..7799398738a35933afda336fc91ebb2b898883c3 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -265,6 +265,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand Down Expand Up @@ -831,7 +831,7 @@ index 0d4e654c0b135d5c42226ffc457b34e2428cb0f3..8063cbdf6d6178dded1aea7486ef0dd2
Util.shutdownExecutors();
SkullBlockEntity.clear();
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 702f8d92848c40f53e67b631d0ef1da9e3b2173a..d407d26f82ab2da573c017f9dc91b2b96d3c202a 100644
index cbd3359e3394a7581db377790820de4957c0bc53..9afd6a3fe71dbbb29d26c6539815babba592a055 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -170,7 +170,7 @@ import net.minecraft.world.phys.shapes.VoxelShape;
Expand All @@ -843,7 +843,7 @@ index 702f8d92848c40f53e67b631d0ef1da9e3b2173a..d407d26f82ab2da573c017f9dc91b2b9
static final Logger LOGGER = LogUtils.getLogger();
private static final int LATENCY_CHECK_INTERVAL = 15000;
public static final double MAX_INTERACTION_DISTANCE = Mth.square(6.0D);
@@ -1600,6 +1600,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1596,6 +1596,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}

public void handleCustomPayload(ServerboundCustomPayloadPacket serverboundCustomPayloadPacket) {
Expand Down
8 changes: 4 additions & 4 deletions MagmaCube-Patches/0005-Client-side-command-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 9ba4374027ccd13cf1e66b8ad08fca26373de98a..cbd867e174226153f835f9424b7a6c7d708b976d 100644
index 15fd267f503ebaa2afe05a3bc18f0fcefe7fa37e..268aee1d16e07818b88906b9ce7d0a2967d0aaa1 100644
--- a/src/main/java/net/minecraft/client/gui/components/CommandSuggestions.java
+++ b/src/main/java/net/minecraft/client/gui/components/CommandSuggestions.java
@@ -171,7 +171,13 @@ public class CommandSuggestions {
@@ -170,7 +170,13 @@ public class CommandSuggestions {
boolean flag2 = this.commandsOnly || flag;
int i = this.input.getCursorPosition();
if (flag2) {
Expand All @@ -24,10 +24,10 @@ index 9ba4374027ccd13cf1e66b8ad08fca26373de98a..cbd867e174226153f835f9424b7a6c7d
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 6c5aba67775e36df4c3f83fcb763ec441a477703..0614372b6e0679e3d6c6d70e71edc801d8918842 100644
index 98c9b0628115b9f75cbca01c804296800416e9e7..64f13c620bfcfff0fd594edf1be2537273bfea7d 100644
--- a/src/main/java/net/minecraft/client/gui/screens/ChatScreen.java
+++ b/src/main/java/net/minecraft/client/gui/screens/ChatScreen.java
@@ -368,6 +368,12 @@ public class ChatScreen extends Screen {
@@ -375,6 +375,12 @@ public class ChatScreen extends Screen {

Component component = this.chatPreview.pull(s);
if (s.startsWith("/")) {
Expand Down
6 changes: 3 additions & 3 deletions MagmaCube-Patches/0011-Fire-simple-events.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Fire simple events


diff --git a/src/main/java/net/minecraft/client/player/LocalPlayer.java b/src/main/java/net/minecraft/client/player/LocalPlayer.java
index de2ae33240e1dcb534188e5fbdb57d8ce9aee349..25d55fc101cf9fe1d0d05797ff94c436c807599d 100644
index 3ce5109711b0108df4cb284297fa643a0ceaf5c6..b99f4050f7fb375d2268f24e22db4f568f3f34ec 100644
--- a/src/main/java/net/minecraft/client/player/LocalPlayer.java
+++ b/src/main/java/net/minecraft/client/player/LocalPlayer.java
@@ -292,6 +292,13 @@ public class LocalPlayer extends AbstractClientPlayer {
@@ -289,6 +289,13 @@ public class LocalPlayer extends AbstractClientPlayer {
}

public void chatSigned(String s, @Nullable Component component) {
Expand Down Expand Up @@ -43,7 +43,7 @@ index a19a2c72bf9bd177718b7e4b19f63b3162052cde..c65049641fc01204dd9d105880e0e2b1

public void handleDisconnection() {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 52029aa5f5f0b225b78cb91d2cc78030ac8d9c7f..b1f2ca8bfe0048f48e2cad75b5ab5abc3e4891b7 100644
index b563132c91441a54a05c5792adf5861142358a7d..b8db47f9efb45c3a5f77ef5976a1e3fcf9ec36ab 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -190,6 +190,7 @@ public abstract class PlayerList {
Expand Down
14 changes: 7 additions & 7 deletions MagmaCube-Patches/0012-BungeeCord-ip_forward-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,19 @@ index 4a100529fd9180b2701b75111dcdf162dffe4ab9..b82badc1b5af2cda39792f36a6ab08b4
break;
case STATUS:
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index efd8c5e54d6dc065c8d804bb80be80df3adcfcbc..c93e788570cf513e13c02c8e764c7e1289b7c2ad 100644
index b46aa8580bafc37d2d9b8790819470d6ba6415b2..2b1b33f05578e42679c6e3000385869bc2e54812 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -101,7 +101,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
}
@@ -102,7 +102,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener

public void handleAcceptedLogin() {
ProfilePublicKey profilePublicKey = null;
- if (!this.gameProfile.isComplete()) {
+ if (!net.blueberrymc.common.bml.InternalBlueberryModConfig.Server.bungee && !this.gameProfile.isComplete()) { // Blueberry - handled in initUUID
this.gameProfile = this.createFakeProfile(this.gameProfile);
}

@@ -149,6 +149,18 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
} else {
try {
@@ -147,6 +147,18 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener

}

Expand All @@ -137,7 +137,7 @@ index efd8c5e54d6dc065c8d804bb80be80df3adcfcbc..c93e788570cf513e13c02c8e764c7e12
private void placeNewPlayer(ServerPlayer serverPlayer) {
this.server.getPlayerList().placeNewPlayer(this.connection, serverPlayer);
}
@@ -200,6 +212,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
@@ -198,6 +210,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
this.state = ServerLoginPacketListenerImpl.State.KEY;
this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.nonce));
} else {
Expand Down
Loading

0 comments on commit d1d9e4b

Please sign in to comment.