1
- From 269d1473ce33cce252f7f377423c7529c85679b1 Mon Sep 17 00:00:00 2001
1
+ From 16fdf073cc91a3a3c1adbfc265b42847020ed760 Mon Sep 17 00:00:00 2001
2
2
From: Justsnoopy30 <everettallen30@gmail.com>
3
3
Date: Sun, 16 Feb 2020 16:45:16 -0600
4
4
Subject: [PATCH] Minecraft 1.16 Support
@@ -1169,14 +1169,14 @@ index aa1515f4..04345a3f 100644
1169
1169
/*
1170
1170
} catch ( NoSuchMethodException ex )
1171
1171
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
1173
1173
--- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
1174
1174
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
1175
1175
@@ -28,6 +28,7 @@ public class ProtocolConstants
1176
1176
public static final int MINECRAFT_1_15 = 573;
1177
1177
public static final int MINECRAFT_1_15_1 = 575;
1178
1178
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
1180
1180
public static final List<String> SUPPORTED_VERSIONS = Arrays.asList(
1181
1181
"1.8.x",
1182
1182
"1.9.x",
@@ -1392,6 +1392,50 @@ index 00000000..67bb1a58
1392
1392
+
1393
1393
+
1394
1394
+ }
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
+ + }
1395
1439
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
1396
1440
new file mode 100644
1397
1441
index 00000000..1391631f
@@ -1544,10 +1588,10 @@ index 00000000..a238d9e3
1544
1588
\ No newline at end of file
1545
1589
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
1546
1590
new file mode 100644
1547
- index 00000000..02fc4453
1591
+ index 00000000..aad7cc21
1548
1592
--- /dev/null
1549
1593
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/nbt/NBTTagTypes.java
1550
- @@ -0,0 +1,35 @@
1594
+ @@ -0,0 +1,37 @@
1551
1595
+ package net.md_5.bungee.protocol.nbt;
1552
1596
+
1553
1597
+ import java.io.IOException;
@@ -1567,6 +1611,8 @@ index 00000000..02fc4453
1567
1611
+ return new EndTag();
1568
1612
+ case 1:
1569
1613
+ return new ByteTag();
1614
+ + case 3:
1615
+ + return new IntTag();
1570
1616
+ case 4:
1571
1617
+ return new LongTag();
1572
1618
+ case 5:
@@ -1630,7 +1676,7 @@ index 00000000..7fa0a7de
1630
1676
+ }
1631
1677
\ No newline at end of file
1632
1678
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
1634
1680
--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java
1635
1681
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Chat.java
1636
1682
@@ -9,6 +9,8 @@ import net.md_5.bungee.protocol.AbstractPacketHandler;
@@ -1642,11 +1688,17 @@ index 0ded6739..c33b5064 100644
1642
1688
@Data
1643
1689
@NoArgsConstructor
1644
1690
@AllArgsConstructor
1645
- @@ -18,10 +20,11 @@ public class Chat extends DefinedPacket
1691
+ @@ -18,10 +20,17 @@ public class Chat extends DefinedPacket
1646
1692
1647
1693
private String message;
1648
1694
private byte position;
1649
1695
+ 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
+ + }
1650
1702
1651
1703
public Chat(String message)
1652
1704
{
@@ -1655,7 +1707,7 @@ index 0ded6739..c33b5064 100644
1655
1707
}
1656
1708
1657
1709
@Override
1658
- @@ -36,6 +39 ,12 @@ public class Chat extends DefinedPacket
1710
+ @@ -36,6 +45 ,12 @@ public class Chat extends DefinedPacket
1659
1711
if ( direction == ProtocolConstants.Direction.TO_CLIENT )
1660
1712
{
1661
1713
position = buf.readByte();
@@ -1668,7 +1720,7 @@ index 0ded6739..c33b5064 100644
1668
1720
}
1669
1721
}
1670
1722
1671
- @@ -51,6 +60 ,13 @@ public class Chat extends DefinedPacket
1723
+ @@ -51,6 +66 ,13 @@ public class Chat extends DefinedPacket
1672
1724
if ( direction == ProtocolConstants.Direction.TO_CLIENT )
1673
1725
{
1674
1726
buf.writeByte( position );
@@ -2198,7 +2250,7 @@ index bc1de55a..ef2a66fa 100644
2198
2250
}
2199
2251
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
2200
2252
new file mode 100644
2201
- index 00000000..381a8ac9
2253
+ index 00000000..7c270dc9
2202
2254
--- /dev/null
2203
2255
+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_16.java
2204
2256
@@ -0,0 +1,194 @@
@@ -2379,7 +2431,7 @@ index 00000000..381a8ac9
2379
2431
+ int packetId = DefinedPacket.readVarInt( packet );
2380
2432
+ int packetIdLength = packet.readerIndex() - readerIndex;
2381
2433
+
2382
- + if ( packetId == 0x2B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() )
2434
+ + if ( packetId == 0x2C /* HyperFall 20w16a+ 0x2B -> 0x2C Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() )
2383
2435
+ {
2384
2436
+ UUID uuid = DefinedPacket.readUUID( packet );
2385
2437
+ ProxiedPlayer player;
0 commit comments