Skip to content

Commit

Permalink
Add more helpful NMS changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPowerGamerBR committed Dec 8, 2024
1 parent db8ee6c commit 0fd98d6
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions patches/server/0018-Helpful-NMS-packet-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,33 @@ index 1a37654aff9a9c86c9f7af10a1cf721371f0c5ec..e69ff4e6bb3919340a93ed4c68bdd6c4

public ClientboundSectionBlocksUpdatePacket(SectionPos sectionPos, ShortSet positions, LevelChunkSection section) {
this.sectionPos = sectionPos;
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetCameraPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetCameraPacket.java
index 799f5a8c69f295216997d52fb4bc6c56d3a18115..633f10f17eebd43e8dc7c878b9101decf31190a9 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetCameraPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetCameraPacket.java
@@ -18,6 +18,12 @@ public class ClientboundSetCameraPacket implements Packet<ClientGamePacketListen
this.cameraId = entity.getId();
}

+ // SparklyPaper - Helpful NMS packet changes: add direct entityId constructor
+ public ClientboundSetCameraPacket(int entityId) {
+ this.cameraId = entityId;
+ }
+ // SparklyPaper end
+
private ClientboundSetCameraPacket(FriendlyByteBuf buf) {
this.cameraId = buf.readVarInt();
}
diff --git a/src/main/java/net/minecraft/world/entity/Display.java b/src/main/java/net/minecraft/world/entity/Display.java
index e6cbf4506c75046a89fad778e138b448fb4a29a9..3b705c75b840dbb0e741f46aaa3b98180a27ecf5 100644
--- a/src/main/java/net/minecraft/world/entity/Display.java
+++ b/src/main/java/net/minecraft/world/entity/Display.java
@@ -802,7 +802,7 @@ public abstract class Display extends Entity {
public static final byte FLAG_ALIGN_RIGHT = 16;
private static final byte INITIAL_TEXT_OPACITY = -1;
public static final int INITIAL_BACKGROUND = 1073741824;
- private static final EntityDataAccessor<Component> DATA_TEXT_ID = SynchedEntityData.defineId(Display.TextDisplay.class, EntityDataSerializers.COMPONENT);
+ public static final EntityDataAccessor<Component> DATA_TEXT_ID = SynchedEntityData.defineId(Display.TextDisplay.class, EntityDataSerializers.COMPONENT); // SparklyPaper - Helpful NMS packet changes: make public
public static final EntityDataAccessor<Integer> DATA_LINE_WIDTH_ID = SynchedEntityData.defineId(Display.TextDisplay.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Integer> DATA_BACKGROUND_COLOR_ID = SynchedEntityData.defineId(
Display.TextDisplay.class, EntityDataSerializers.INT

0 comments on commit 0fd98d6

Please sign in to comment.