Skip to content

Commit

Permalink
Ported to 1.20.5-pre3
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Apr 16, 2024
1 parent fc0dcc6 commit 14f11de
Show file tree
Hide file tree
Showing 15 changed files with 117 additions and 117 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ org.gradle.debug=false

java_version=21

minecraft_version=1.20.5-pre2
neoform_version=20240415.193619
minecraft_version=1.20.5-pre3
neoform_version=20240416.143558
# on snapshot versions, used to prefix the version
neoforge_snapshot_next_stable=20.5

Expand Down
14 changes: 7 additions & 7 deletions patches/net/minecraft/client/gui/screens/Screen.java.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
--- a/net/minecraft/client/gui/screens/Screen.java
+++ b/net/minecraft/client/gui/screens/Screen.java
@@ -118,6 +_,7 @@
@@ -119,6 +_,7 @@
}
}

+ /** Neo: mixins targeting this method won't fire for container screens as {@link net.minecraft.client.gui.screens.inventory.AbstractContainerScreen#render} replicates this method in place of a super call to insert an event */
@Override
public void render(GuiGraphics p_281549_, int p_281550_, int p_282878_, float p_282465_) {
this.renderBackground(p_281549_, p_281550_, p_282878_, p_282465_);
@@ -203,7 +_,7 @@
@@ -204,7 +_,7 @@
}

public void onClose() {
Expand All @@ -17,7 +17,7 @@
}

protected <T extends GuiEventListener & Renderable & NarratableEntry> T addRenderableWidget(T p_169406_) {
@@ -319,8 +_,11 @@
@@ -320,8 +_,11 @@
this.width = p_96608_;
this.height = p_96609_;
if (!this.initialized) {
Expand All @@ -29,7 +29,7 @@
} else {
this.repositionElements();
}
@@ -333,8 +_,11 @@
@@ -334,8 +_,11 @@
protected void rebuildWidgets() {
this.clearWidgets();
this.clearFocus();
Expand All @@ -41,15 +41,15 @@
}

@Override
@@ -361,6 +_,7 @@
@@ -362,6 +_,7 @@

this.renderBlurredBackground(p_294317_);
this.renderMenuBackground(p_283688_);
+ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.ScreenEvent.BackgroundRendered(this, p_283688_));
}

protected void renderBlurredBackground(float p_330683_) {
@@ -487,6 +_,10 @@
@@ -496,6 +_,10 @@
public void onFilesDrop(List<Path> p_96591_) {
}

Expand All @@ -60,7 +60,7 @@
private void scheduleNarration(long p_169381_, boolean p_169382_) {
this.nextNarrationTime = Util.getMillis() + p_169381_;
if (p_169382_) {
@@ -657,5 +_,13 @@
@@ -666,5 +_,13 @@
this.index = p_169425_;
this.priority = p_169426_;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java
+++ b/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java
@@ -105,17 +_,17 @@
@@ -112,17 +_,17 @@
public void handleCustomPayload(ClientboundCustomPayloadPacket p_295727_) {
CustomPacketPayload custompacketpayload = p_295727_.payload();
if (!(custompacketpayload instanceof DiscardedPayload)) {
Expand All @@ -21,7 +21,7 @@

@Override
public void handleResourcePackPush(ClientboundResourcePackPushPacket p_314606_) {
@@ -219,6 +_,10 @@
@@ -222,6 +_,10 @@
}

public void send(Packet<?> p_295097_) {
Expand All @@ -32,17 +32,17 @@
this.connection.send(p_295097_);
}

@@ -226,6 +_,9 @@
@@ -229,6 +_,9 @@
public void onDisconnect(Component p_295485_) {
this.telemetryManager.onDisconnect();
this.minecraft.disconnect(this.createDisconnectScreen(p_295485_), this.keepResourcePacks);
this.minecraft.disconnect(this.createDisconnectScreen(p_295485_), this.isTransferring);
+ if (!this.connection.isMemoryConnection()) {
+ net.neoforged.neoforge.registries.RegistryManager.revertToFrozen();
+ }
LOGGER.warn("Client disconnected with reason: {}", p_295485_.getString());
}

@@ -345,5 +_,15 @@
@@ -348,5 +_,15 @@
@OnlyIn(Dist.CLIENT)
static record PendingRequest(UUID id, URL url, String hash) {
}
Expand Down
4 changes: 2 additions & 2 deletions patches/net/minecraft/resources/RegistryOps.java.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/resources/RegistryOps.java
+++ b/net/minecraft/resources/RegistryOps.java
@@ -51,6 +_,11 @@
@@ -35,6 +_,11 @@
this.lookupProvider = p_255799_;
}

Expand All @@ -12,7 +12,7 @@
public <U> RegistryOps<U> withParent(DynamicOps<U> p_330654_) {
return (RegistryOps<U>)(p_330654_ == this.delegate ? this : new RegistryOps<>(p_330654_, this.lookupProvider));
}
@@ -73,6 +_,20 @@
@@ -74,6 +_,20 @@
: DataResult.error(() -> "Not a registry ops")
)
.forGetter(p_255526_ -> null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -235,6 +_,7 @@
@@ -234,6 +_,7 @@
private final MessageSignatureCache messageSignatureCache = MessageSignatureCache.createDefault();
private final FutureChain chatMessageChain;
private boolean waitingForSwitchToConfig;
+ private net.neoforged.neoforge.network.connection.ConnectionType connectionType;

public ServerGamePacketListenerImpl(MinecraftServer p_9770_, Connection p_9771_, ServerPlayer p_9772_, CommonListenerCookie p_301978_) {
super(p_9770_, p_9771_, p_301978_);
@@ -244,6 +_,7 @@
@@ -243,6 +_,7 @@
p_9772_.getTextFilter().join();
this.signedMessageDecoder = SignedMessageChain.Decoder.unsigned(p_9772_.getUUID(), p_9770_::enforceSecureProfile);
this.chatMessageChain = new FutureChain(p_9770_);
+ this.connectionType = p_301978_.connectionType();
}

@Override
@@ -439,9 +_,11 @@
@@ -438,9 +_,11 @@
}

entity.absMoveTo(d3, d4, d5, f, f1);
Expand All @@ -28,7 +28,7 @@
this.send(new ClientboundMoveVehiclePacket(entity));
return;
}
@@ -460,6 +_,23 @@
@@ -459,6 +_,23 @@
}
}

Expand All @@ -52,7 +52,7 @@
private boolean noBlocksAround(Entity p_9794_) {
return p_9794_.level()
.getBlockStates(p_9794_.getBoundingBox().inflate(0.0625).expandTowards(0.0, -0.55, 0.0))
@@ -937,7 +_,7 @@
@@ -936,7 +_,7 @@
&& !flag1
&& this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR
&& !this.server.isFlightAllowed()
Expand All @@ -61,7 +61,7 @@
&& !this.player.hasEffect(MobEffects.LEVITATION)
&& !flag
&& !flag3
@@ -1020,8 +_,10 @@
@@ -1019,8 +_,10 @@
case SWAP_ITEM_WITH_OFFHAND:
if (!this.player.isSpectator()) {
ItemStack itemstack = this.player.getItemInHand(InteractionHand.OFF_HAND);
Expand All @@ -74,7 +74,7 @@
this.player.stopUsingItem();
}

@@ -1049,7 +_,7 @@
@@ -1048,7 +_,7 @@
.handleBlockBreakAction(
blockpos, serverboundplayeractionpacket$action, p_9889_.getDirection(), this.player.level().getMaxBuildHeight(), p_9889_.getSequence()
);
Expand All @@ -83,7 +83,7 @@
return;
default:
throw new IllegalArgumentException("Invalid player action");
@@ -1068,7 +_,7 @@
@@ -1067,7 +_,7 @@
@Override
public void handleUseItemOn(ServerboundUseItemOnPacket p_9930_) {
PacketUtils.ensureRunningOnSameThread(p_9930_, this, this.player.serverLevel());
Expand All @@ -92,7 +92,7 @@
ServerLevel serverlevel = this.player.serverLevel();
InteractionHand interactionhand = p_9930_.getHand();
ItemStack itemstack = this.player.getItemInHand(interactionhand);
@@ -1214,8 +_,9 @@
@@ -1213,8 +_,9 @@
}

CompletableFuture<FilteredText> completablefuture = this.filterTextPacket(playerchatmessage.signedContent());
Expand All @@ -103,7 +103,7 @@
PlayerChatMessage playerchatmessage1 = playerchatmessage.withUnsignedContent(component).filter(p_300785_.mask());
this.broadcastChatMessage(playerchatmessage1);
});
@@ -1542,7 +_,11 @@
@@ -1541,7 +_,11 @@

@Override
public void onInteraction(InteractionHand p_143682_, Vec3 p_143683_) {
Expand All @@ -116,7 +116,7 @@
}

@Override
@@ -1729,7 +_,7 @@
@@ -1733,7 +_,7 @@
@Override
public void handlePlayerAbilities(ServerboundPlayerAbilitiesPacket p_9887_) {
PacketUtils.ensureRunningOnSameThread(p_9887_, this, this.player.serverLevel());
Expand All @@ -125,7 +125,7 @@
}

@Override
@@ -1788,7 +_,7 @@
@@ -1792,7 +_,7 @@
this.connection
.setupInboundProtocol(
ConfigurationProtocols.SERVERBOUND,
Expand All @@ -134,7 +134,7 @@
);
}
}
@@ -1822,7 +_,27 @@
@@ -1826,7 +_,27 @@
}

@Override
Expand Down Expand Up @@ -163,7 +163,7 @@
}

@Override
@@ -1833,5 +_,9 @@
@@ -1837,5 +_,9 @@
@FunctionalInterface
interface EntityInteraction {
InteractionResult run(ServerPlayer p_143695_, Entity p_143696_, InteractionHand p_143697_);
Expand Down
Loading

0 comments on commit 14f11de

Please sign in to comment.