Skip to content

Commit

Permalink
Merge pull request #2 from Exceptionflug/1.14.1
Browse files Browse the repository at this point in the history
1.14.1 support
  • Loading branch information
Exceptionflug authored May 14, 2019
2 parents b88ef89 + 29ef8d0 commit ca3a158
Show file tree
Hide file tree
Showing 34 changed files with 981 additions and 944 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@ This is the full portfolio of protocolize dependencies:
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-inventory</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-world</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion protocolize-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public final class ProtocolVersions {
public final static int MINECRAFT_1_13_1 = 401;
public final static int MINECRAFT_1_13_2 = 404;
public final static int MINECRAFT_1_14 = 477;
public final static int MINECRAFT_1_14_1 = 480;

private ProtocolVersions() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import net.md_5.bungee.protocol.PacketWrapper;

import java.lang.reflect.Field;
import java.util.logging.LogManager;
import java.util.logging.Logger;

public final class ReflectionUtil {

Expand Down Expand Up @@ -59,7 +61,7 @@ public final class ReflectionUtil {
handlerBossHandlerField = handlerBossClass.getDeclaredField("handler");
handlerBossHandlerField.setAccessible(true);
} catch (final Exception e) {
e.printStackTrace();
Logger.getLogger("ReflectionUtil").severe("We have ugly bungeecord implementation right here ._.");
}
}

Expand Down
8 changes: 4 additions & 4 deletions protocolize-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
Expand All @@ -18,19 +18,19 @@
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-inventory</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions protocolize-inventory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-inventory</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,13 @@ public static void sendInventory(final ProxiedPlayer p, Inventory inventory) {

if(!alreadyOpen)
p.unsafe().sendPacket(new OpenWindow(windowId, inventory.getType(), inventory.getTitle()));
final List<ItemStack> items = Lists.newArrayList(inventory.getItemsIndexed(ReflectionUtil.getProtocolVersion(p)));
int protocolVersion;
try {
protocolVersion = ReflectionUtil.getProtocolVersion(p);
} catch (final Throwable t) {
protocolVersion = 47;
}
final List<ItemStack> items = Lists.newArrayList(inventory.getItemsIndexed(protocolVersion));

if(ItemsModule.isSpigotInventoryTracking()) {
final PlayerInventory playerInventory = InventoryManager.getInventory(p.getUniqueId());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
package de.exceptionflug.protocolize.inventory;

import net.md_5.bungee.api.ProxyServer;

import static de.exceptionflug.protocolize.api.util.ProtocolVersions.*;

public enum InventoryType {

GENERIC_9X1(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:container", 9), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 0, 9)),
GENERIC_9X2(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:container", 18), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 1, 18)),
GENERIC_9X3(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:container", 27), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 2, 27)),
GENERIC_9X4(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:container", 36), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 3, 36)),
GENERIC_9X5(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:container", 45), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 4, 45)),
GENERIC_9X6(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:container", 54), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 5, 54)),
GENERIC_3X3(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:dropper", 9), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 6, 9)),
ANVIL(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:anvil", 3), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 7, 3)),
BEACON(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:beacon", 1), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 8, 1)),
BLAST_FURNACE(new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 9, 2)),
BREWING_STAND(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_8, "minecraft:brewing_stand", 4), new InventoryIDMapping(MINECRAFT_1_9, MINECRAFT_1_13_2, "minecraft:brewing_stand", 5), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 10, 5)),
CRAFTING(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:crafting_table", 10), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 11, 10)),
ENCHANTMENT(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:enchanting_table", 2), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 12, 2)),
FURNACE(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:furnace", 3), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 13, 3)),
GRINDSTONE(new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 14, 3)),
HOPPER(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:hopper", 5), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 15, 5)),
LECTERN(new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 16, 0)),
LOOM(new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 17, 4)),
MERCHANT(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:villager", 3), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 18, 3)),
SHULKER_BOX(new InventoryIDMapping(MINECRAFT_1_9, MINECRAFT_1_13_2, "minecraft:shulker_box", 27), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 19, 27)),
SMOKER(new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 20, 3)),
CARTOGRAPHY(new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 21, 3)),
STONECUTTER(new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, 22, 2)),
PLAYER(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_8, "Player", 45), new InventoryIDMapping(MINECRAFT_1_9, MINECRAFT_1_13_2, "Player", 46), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14, -1, 46));
GENERIC_9X1(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:container", 9), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 0, 9)),
GENERIC_9X2(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:container", 18), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 1, 18)),
GENERIC_9X3(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:container", 27), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 2, 27)),
GENERIC_9X4(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:container", 36), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 3, 36)),
GENERIC_9X5(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:container", 45), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 4, 45)),
GENERIC_9X6(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:container", 54), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 5, 54)),
GENERIC_3X3(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:dropper", 9), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 6, 9)),
ANVIL(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:anvil", 3), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 7, 3)),
BEACON(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:beacon", 1), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 8, 1)),
BLAST_FURNACE(new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 9, 2)),
BREWING_STAND(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_8, "minecraft:brewing_stand", 4), new InventoryIDMapping(MINECRAFT_1_9, MINECRAFT_1_13_2, "minecraft:brewing_stand", 5), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 10, 5)),
CRAFTING(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:crafting_table", 10), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 11, 10)),
ENCHANTMENT(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:enchanting_table", 2), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 12, 2)),
FURNACE(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:furnace", 3), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 13, 3)),
GRINDSTONE(new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 14, 3)),
HOPPER(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:hopper", 5), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 15, 5)),
LECTERN(new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 16, 0)),
LOOM(new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 17, 4)),
MERCHANT(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_13_2, "minecraft:villager", 3), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 18, 3)),
SHULKER_BOX(new InventoryIDMapping(MINECRAFT_1_9, MINECRAFT_1_13_2, "minecraft:shulker_box", 27), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 19, 27)),
SMOKER(new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 20, 3)),
CARTOGRAPHY(new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 21, 3)),
STONECUTTER(new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, 22, 2)),
PLAYER(new InventoryIDMapping(MINECRAFT_1_8, MINECRAFT_1_8, "Player", 45), new InventoryIDMapping(MINECRAFT_1_9, MINECRAFT_1_13_2, "Player", 46), new InventoryIDMapping(MINECRAFT_1_14, MINECRAFT_1_14_1, -1, 46));

private final InventoryIDMapping[] mappings;

Expand Down Expand Up @@ -87,6 +89,7 @@ public int getTypicalSize(final int protocolVersion) {
return mapping.getTypicalSize();
}
}
ProxyServer.getInstance().getLogger().warning("[Protocolize] Unable to find typical inventory size of "+name()+" in version "+protocolVersion);
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ public void receive(final PacketReceiveEvent<WindowItems> event) {
return;
}
final PlayerInventory playerInventory = InventoryManager.getCombinedSendInventory(event.getPlayer().getUniqueId(), event.getServerInfo().getName());
final int protocolVersion = ReflectionUtil.getProtocolVersion(event.getPlayer());
int protocolVersion;
try {
protocolVersion = ReflectionUtil.getProtocolVersion(event.getPlayer());
} catch (final Exception e) {
protocolVersion = 47;
}
for (int i = 0; i < packet.getItems().size(); i++) {
if(InventoryUtil.isLowerInventory(i, inventory, protocolVersion)) {
// LOWER PLAYER INVENTORY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class ClickWindow extends AbstractPacket {
MAPPING.put(MINECRAFT_1_13_1, 0x08);
MAPPING.put(MINECRAFT_1_13_2, 0x08);
MAPPING.put(MINECRAFT_1_14, 0x09);
MAPPING.put(MINECRAFT_1_14_1, 0x09);
}

private int windowId, actionNumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class CloseWindow extends AbstractPacket {
MAPPING_CLIENTBOUND.put(MINECRAFT_1_13_1, 0x13);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_13_2, 0x13);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14, 0x13);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14_1, 0x13);

MAPPING_SERVERBOUND.put(MINECRAFT_1_8, 0x0D);
MAPPING_SERVERBOUND.put(MINECRAFT_1_9, 0x08);
Expand All @@ -47,6 +48,7 @@ public class CloseWindow extends AbstractPacket {
MAPPING_SERVERBOUND.put(MINECRAFT_1_13_1, 0x09);
MAPPING_SERVERBOUND.put(MINECRAFT_1_13_2, 0x09);
MAPPING_SERVERBOUND.put(MINECRAFT_1_14, 0x0A);
MAPPING_SERVERBOUND.put(MINECRAFT_1_14_1, 0x0A);
}

private int windowId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class ConfirmTransaction extends AbstractPacket {
MAPPING_CLIENTBOUND.put(MINECRAFT_1_13_1, 0x12);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_13_2, 0x12);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14, 0x12);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14_1, 0x12);

MAPPING_SERVERBOUND.put(MINECRAFT_1_9, 0x05);
MAPPING_SERVERBOUND.put(MINECRAFT_1_9_1, 0x05);
Expand All @@ -48,6 +49,7 @@ public class ConfirmTransaction extends AbstractPacket {
MAPPING_SERVERBOUND.put(MINECRAFT_1_13_1, 0x06);
MAPPING_SERVERBOUND.put(MINECRAFT_1_13_2, 0x06);
MAPPING_SERVERBOUND.put(MINECRAFT_1_14, 0x07);
MAPPING_SERVERBOUND.put(MINECRAFT_1_14_1, 0x07);
}

private int windowId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class OpenWindow extends AbstractPacket {
MAPPING.put(MINECRAFT_1_13_1, 0x14);
MAPPING.put(MINECRAFT_1_13_2, 0x14);
MAPPING.put(MINECRAFT_1_14, 0x2E);
MAPPING.put(MINECRAFT_1_14_1, 0x2E);
}

private int windowId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class WindowProperty extends AbstractPacket {
MAPPING.put(MINECRAFT_1_13_1, 0x16);
MAPPING.put(MINECRAFT_1_13_2, 0x16);
MAPPING.put(MINECRAFT_1_14, 0x15);
MAPPING.put(MINECRAFT_1_14_1, 0x15);
}

private int windowId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ public final class InventoryUtil {
private InventoryUtil() {}

public static boolean isLowerInventory(final int i, final Inventory inventory, final int protocolVersion) {
return i >= inventory.getType().getTypicalSize(protocolVersion);
final InventoryType type = inventory.getType();
if(type == null)
return false;
return i >= type.getTypicalSize(protocolVersion);
}

}
6 changes: 3 additions & 3 deletions protocolize-items/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<plugin>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen-plugin</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>
<executions>
<execution>
<phase>generate-sources</phase>
Expand All @@ -33,12 +33,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.4.2-SNAPSHOT</version>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import de.exceptionflug.protocolize.api.Hand;
import de.exceptionflug.protocolize.api.protocol.AbstractPacket;
import de.exceptionflug.protocolize.items.ItemStack;
import de.exceptionflug.protocolize.items.ItemType;
import io.netty.buffer.ByteBuf;
import net.md_5.bungee.protocol.ProtocolConstants.Direction;

Expand All @@ -34,6 +33,7 @@ public class BlockPlacement extends AbstractPacket {
MAPPING.put(MINECRAFT_1_13_1, 0x29);
MAPPING.put(MINECRAFT_1_13_2, 0x29);
MAPPING.put(MINECRAFT_1_14, 0x2C);
MAPPING.put(MINECRAFT_1_14_1, 0x2C);
}

private BlockPosition position;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class HeldItemChange extends AbstractPacket {
MAPPING_CLIENTBOUND.put(MINECRAFT_1_13_1, 0x3D);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_13_2, 0x3D);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14, 0x3F);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14_1, 0x3F);

MAPPING_SERVERBOUND.put(MINECRAFT_1_8, 0x09);
MAPPING_SERVERBOUND.put(MINECRAFT_1_9, 0x17);
Expand All @@ -47,6 +48,7 @@ public class HeldItemChange extends AbstractPacket {
MAPPING_SERVERBOUND.put(MINECRAFT_1_13_1, 0x21);
MAPPING_SERVERBOUND.put(MINECRAFT_1_13_2, 0x21);
MAPPING_SERVERBOUND.put(MINECRAFT_1_14, 0x23);
MAPPING_SERVERBOUND.put(MINECRAFT_1_14_1, 0x23);
}

private short newSlot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class SetSlot extends AbstractPacket {
MAPPING.put(MINECRAFT_1_13_1, 0x17);
MAPPING.put(MINECRAFT_1_13_2, 0x17);
MAPPING.put(MINECRAFT_1_14, 0x16);
MAPPING.put(MINECRAFT_1_14_1, 0x16);
}

private byte windowId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class UseItem extends AbstractPacket {
MAPPING.put(MINECRAFT_1_13_1, 0x2A);
MAPPING.put(MINECRAFT_1_13_2, 0x2A);
MAPPING.put(MINECRAFT_1_14, 0x2D);
MAPPING.put(MINECRAFT_1_14_1, 0x2D);
}

private Hand hand;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class WindowItems extends AbstractPacket {
MAPPING.put(MINECRAFT_1_13_1, 0x15);
MAPPING.put(MINECRAFT_1_13_2, 0x15);
MAPPING.put(MINECRAFT_1_14, 0x14);
MAPPING.put(MINECRAFT_1_14_1, 0x14);
}

public WindowItems(final short windowId, final List<ItemStack> items) {
Expand Down
Loading

0 comments on commit ca3a158

Please sign in to comment.