Skip to content

Commit ba33a1f

Browse files
committed
Minecraft 1.16 Prerelease 4
1 parent bf9abf0 commit ba33a1f

File tree

1 file changed

+63
-11
lines changed

1 file changed

+63
-11
lines changed

Waterfall-Proxy-Patches/0003-Minecraft-1.16-Support.patch

Lines changed: 63 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 269d1473ce33cce252f7f377423c7529c85679b1 Mon Sep 17 00:00:00 2001
1+
From 16fdf073cc91a3a3c1adbfc265b42847020ed760 Mon Sep 17 00:00:00 2001
22
From: Justsnoopy30 <everettallen30@gmail.com>
33
Date: Sun, 16 Feb 2020 16:45:16 -0600
44
Subject: [PATCH] Minecraft 1.16 Support
@@ -1169,14 +1169,14 @@ index aa1515f4..04345a3f 100644
11691169
/*
11701170
} catch ( NoSuchMethodException ex )
11711171
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
1172-
index cd987c8a..94001221 100644
1172+
index cd987c8a..e7f897e0 100644
11731173
--- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
11741174
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
11751175
@@ -28,6 +28,7 @@ public class ProtocolConstants
11761176
public static final int MINECRAFT_1_15 = 573;
11771177
public static final int MINECRAFT_1_15_1 = 575;
11781178
public static final int MINECRAFT_1_15_2 = 578;
1179-
+ public static final int MINECRAFT_1_16 = 722; // HyperFall 1.16 Pre-2
1179+
+ public static final int MINECRAFT_1_16 = 727; // HyperFall 1.16 Pre-4
11801180
public static final List<String> SUPPORTED_VERSIONS = Arrays.asList(
11811181
"1.8.x",
11821182
"1.9.x",
@@ -1392,6 +1392,50 @@ index 00000000..67bb1a58
13921392
+
13931393
+
13941394
+}
1395+
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/nbt/IntTag.java b/protocol/src/main/java/net/md_5/bungee/protocol/nbt/IntTag.java
1396+
new file mode 100644
1397+
index 00000000..b903262f
1398+
--- /dev/null
1399+
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/nbt/IntTag.java
1400+
@@ -0,0 +1,38 @@
1401+
+package net.md_5.bungee.protocol.nbt;
1402+
+
1403+
+import java.io.DataInput;
1404+
+import java.io.DataOutput;
1405+
+import java.io.IOException;
1406+
+
1407+
+/*
1408+
+ * Waterfall NBT-Library substitute module
1409+
+ * Minecraft 1.16 - 20w21a
1410+
+ * by Xernium (Five)
1411+
+ * */
1412+
+
1413+
+public class IntTag extends NBTTag {
1414+
+
1415+
+ private int value;
1416+
+
1417+
+ @Override
1418+
+ public int getTagIndex() {
1419+
+ return 3;
1420+
+ }
1421+
+
1422+
+ @Override
1423+
+ public void write(DataOutput to) throws IOException {
1424+
+ to.writeInt(value);
1425+
+ }
1426+
+
1427+
+ @Override
1428+
+ public void read(DataInput from) throws IOException {
1429+
+ value = from.readInt();
1430+
+ }
1431+
+
1432+
+ @Override
1433+
+ public String toString() {
1434+
+ return "value: '" + value + "'\n";
1435+
+ }
1436+
+
1437+
+
1438+
+}
13951439
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/nbt/ListTag.java b/protocol/src/main/java/net/md_5/bungee/protocol/nbt/ListTag.java
13961440
new file mode 100644
13971441
index 00000000..1391631f
@@ -1544,10 +1588,10 @@ index 00000000..a238d9e3
15441588
\ No newline at end of file
15451589
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/nbt/NBTTagTypes.java b/protocol/src/main/java/net/md_5/bungee/protocol/nbt/NBTTagTypes.java
15461590
new file mode 100644
1547-
index 00000000..02fc4453
1591+
index 00000000..aad7cc21
15481592
--- /dev/null
15491593
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/nbt/NBTTagTypes.java
1550-
@@ -0,0 +1,35 @@
1594+
@@ -0,0 +1,37 @@
15511595
+package net.md_5.bungee.protocol.nbt;
15521596
+
15531597
+import java.io.IOException;
@@ -1567,6 +1611,8 @@ index 00000000..02fc4453
15671611
+ return new EndTag();
15681612
+ case 1:
15691613
+ return new ByteTag();
1614+
+ case 3:
1615+
+ return new IntTag();
15701616
+ case 4:
15711617
+ return new LongTag();
15721618
+ case 5:
@@ -1630,7 +1676,7 @@ index 00000000..7fa0a7de
16301676
+}
16311677
\ No newline at end of file
16321678
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java
1633-
index 0ded6739..c33b5064 100644
1679+
index 0ded6739..b425dcab 100644
16341680
--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java
16351681
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java
16361682
@@ -9,6 +9,8 @@ import net.md_5.bungee.protocol.AbstractPacketHandler;
@@ -1642,11 +1688,17 @@ index 0ded6739..c33b5064 100644
16421688
@Data
16431689
@NoArgsConstructor
16441690
@AllArgsConstructor
1645-
@@ -18,10 +20,11 @@ public class Chat extends DefinedPacket
1691+
@@ -18,10 +20,17 @@ public class Chat extends DefinedPacket
16461692

16471693
private String message;
16481694
private byte position;
16491695
+ private UUID sender; // HyperFall 20w21a+
1696+
+
1697+
+ // HyperFall (1.16+ retain API)
1698+
+ public Chat(String message, byte position)
1699+
+ {
1700+
+ this( message, position, /* HyperFall 20w21a+ */ new UUID( 0, 0 ) );
1701+
+ }
16501702

16511703
public Chat(String message)
16521704
{
@@ -1655,7 +1707,7 @@ index 0ded6739..c33b5064 100644
16551707
}
16561708

16571709
@Override
1658-
@@ -36,6 +39,12 @@ public class Chat extends DefinedPacket
1710+
@@ -36,6 +45,12 @@ public class Chat extends DefinedPacket
16591711
if ( direction == ProtocolConstants.Direction.TO_CLIENT )
16601712
{
16611713
position = buf.readByte();
@@ -1668,7 +1720,7 @@ index 0ded6739..c33b5064 100644
16681720
}
16691721
}
16701722

1671-
@@ -51,6 +60,13 @@ public class Chat extends DefinedPacket
1723+
@@ -51,6 +66,13 @@ public class Chat extends DefinedPacket
16721724
if ( direction == ProtocolConstants.Direction.TO_CLIENT )
16731725
{
16741726
buf.writeByte( position );
@@ -2198,7 +2250,7 @@ index bc1de55a..ef2a66fa 100644
21982250
}
21992251
diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java
22002252
new file mode 100644
2201-
index 00000000..381a8ac9
2253+
index 00000000..7c270dc9
22022254
--- /dev/null
22032255
+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java
22042256
@@ -0,0 +1,194 @@
@@ -2379,7 +2431,7 @@ index 00000000..381a8ac9
23792431
+ int packetId = DefinedPacket.readVarInt( packet );
23802432
+ int packetIdLength = packet.readerIndex() - readerIndex;
23812433
+
2382-
+ if ( packetId == 0x2B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() )
2434+
+ if ( packetId == 0x2C /* HyperFall 20w16a+ 0x2B -> 0x2C Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() )
23832435
+ {
23842436
+ UUID uuid = DefinedPacket.readUUID( packet );
23852437
+ ProxiedPlayer player;

0 commit comments

Comments
 (0)