Skip to content

Commit

Permalink
Merge pull request #24 from Exceptionflug/1.15
Browse files Browse the repository at this point in the history
1.15
  • Loading branch information
Exceptionflug authored Dec 10, 2019
2 parents 0d51060 + 542ac82 commit 457978e
Show file tree
Hide file tree
Showing 33 changed files with 8,707 additions and 6,081 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.7-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.4.7-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-inventory</artifactId>
<version>1.4.7-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-world</artifactId>
<version>1.4.7-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
Expand Down
10 changes: 7 additions & 3 deletions 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.7-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
Expand Down Expand Up @@ -42,20 +42,24 @@
<id>bungeecord-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
<repository>
<id>exceptionflug</id>
<url>http://mvn.exceptionflug.de/repository/exceptionflug-public/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.13-SNAPSHOT</version>
<version>1.14-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-proxy</artifactId>
<version>1.13-SNAPSHOT</version>
<version>1.14-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
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.7-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,21 @@ public boolean isWaterfall() {

private void registerPacketBungeeCord(final TIntObjectMap<Object> protocols, final int protocolVersion, final int packetId, final Class<?> clazz) throws IllegalAccessException, NoSuchMethodException {
final Object protocolData = protocols.get(protocolVersion);
((TObjectIntMap<Class<?>>)protocolDataPacketMapField.get(protocolData)).put(clazz, packetId);
if(protocolData == null) {
ProxyServer.getInstance().getLogger().warning("[Protocolize] Protocol version "+protocolVersion+" is not supported on this bungeecord version. Skipping registration for that specific version.");
return;
}
TObjectIntMap<Class<?>> map = ((TObjectIntMap<Class<?>>)protocolDataPacketMapField.get(protocolData));
map.put(clazz, packetId);
((Constructor[])protocolDataConstructorsField.get(protocolData))[packetId] = clazz.getDeclaredConstructor();
}

private void registerPacketWaterfall(final TIntObjectMap<Object> protocols, final int protocolVersion, final int packetId, final Class<?> clazz) throws IllegalAccessException, NoSuchMethodException {
final Object protocolData = protocols.get(protocolVersion);
if(protocolData == null) {
ProxyServer.getInstance().getLogger().warning("[Protocolize] Protocol version "+protocolVersion+" is not supported on this waterfall version. Skipping registration for that specific version.");
return;
}
((TObjectIntMap<Class<?>>)protocolDataPacketMapField.get(protocolData)).put(clazz, packetId);
((Supplier[])protocolDataConstructorsField.get(protocolData))[packetId] = () -> {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ public final class ProtocolVersions {
public final static int MINECRAFT_1_14_2 = 485;
public final static int MINECRAFT_1_14_3 = 490;
public final static int MINECRAFT_1_14_4 = 498;
public final static int MINECRAFT_1_15 = 573;


public final static int MINECRAFT_LATEST = MINECRAFT_1_14_4;
public final static int MINECRAFT_LATEST = MINECRAFT_1_15;

private ProtocolVersions() {}

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.7-SNAPSHOT</version>
<version>1.5.0-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.7-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.4.7-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-inventory</artifactId>
<version>1.4.7-SNAPSHOT</version>
<version>1.5.0-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.7-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-inventory</artifactId>
<version>1.4.7-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.4.7-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class ClickWindow extends AbstractPacket {
MAPPING.put(MINECRAFT_1_14_2, 0x09);
MAPPING.put(MINECRAFT_1_14_3, 0x09);
MAPPING.put(MINECRAFT_1_14_4, 0x09);
MAPPING.put(MINECRAFT_1_15, 0x09);
}

private int windowId, actionNumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class CloseWindow extends AbstractPacket {
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14_2, 0x13);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14_3, 0x13);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14_4, 0x13);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_15, 0x14);

MAPPING_SERVERBOUND.put(MINECRAFT_1_8, 0x0D);
MAPPING_SERVERBOUND.put(MINECRAFT_1_9, 0x08);
Expand All @@ -55,6 +56,7 @@ public class CloseWindow extends AbstractPacket {
MAPPING_SERVERBOUND.put(MINECRAFT_1_14_2, 0x0A);
MAPPING_SERVERBOUND.put(MINECRAFT_1_14_3, 0x0A);
MAPPING_SERVERBOUND.put(MINECRAFT_1_14_4, 0x0A);
MAPPING_SERVERBOUND.put(MINECRAFT_1_15, 0x0A);
}

private int windowId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.google.common.collect.Maps;
import de.exceptionflug.protocolize.api.protocol.AbstractPacket;
import io.netty.buffer.ByteBuf;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.protocol.ProtocolConstants.Direction;

import java.util.Map;
Expand Down Expand Up @@ -37,6 +36,7 @@ public class ConfirmTransaction extends AbstractPacket {
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14_2, 0x12);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14_3, 0x12);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14_4, 0x12);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_15, 0x13);

MAPPING_SERVERBOUND.put(MINECRAFT_1_9, 0x05);
MAPPING_SERVERBOUND.put(MINECRAFT_1_9_1, 0x05);
Expand All @@ -56,6 +56,7 @@ public class ConfirmTransaction extends AbstractPacket {
MAPPING_SERVERBOUND.put(MINECRAFT_1_14_2, 0x07);
MAPPING_SERVERBOUND.put(MINECRAFT_1_14_3, 0x07);
MAPPING_SERVERBOUND.put(MINECRAFT_1_14_4, 0x07);
MAPPING_SERVERBOUND.put(MINECRAFT_1_15, 0x07);
}

private int windowId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class OpenWindow extends AbstractPacket {
MAPPING.put(MINECRAFT_1_14_2, 0x2E);
MAPPING.put(MINECRAFT_1_14_3, 0x2E);
MAPPING.put(MINECRAFT_1_14_4, 0x2E);
MAPPING.put(MINECRAFT_1_15, 0x2F);
}

private int windowId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class WindowProperty extends AbstractPacket {
MAPPING.put(MINECRAFT_1_14_2, 0x15);
MAPPING.put(MINECRAFT_1_14_3, 0x15);
MAPPING.put(MINECRAFT_1_14_4, 0x15);
MAPPING.put(MINECRAFT_1_15, 0x16);
}

private int windowId;
Expand Down
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.7-SNAPSHOT</version>
<version>1.5.0-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.7-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.4.7-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class BlockPlacement extends AbstractPacket {
MAPPING.put(MINECRAFT_1_14_2, 0x2C);
MAPPING.put(MINECRAFT_1_14_3, 0x2C);
MAPPING.put(MINECRAFT_1_14_4, 0x2C);
MAPPING.put(MINECRAFT_1_15, 0x2C);
}

private BlockPosition position;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class HeldItemChange extends AbstractPacket {
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14_2, 0x3F);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14_3, 0x3F);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_14_4, 0x3F);
MAPPING_CLIENTBOUND.put(MINECRAFT_1_15, 0x40);

MAPPING_SERVERBOUND.put(MINECRAFT_1_8, 0x09);
MAPPING_SERVERBOUND.put(MINECRAFT_1_9, 0x17);
Expand All @@ -55,6 +56,7 @@ public class HeldItemChange extends AbstractPacket {
MAPPING_SERVERBOUND.put(MINECRAFT_1_14_2, 0x23);
MAPPING_SERVERBOUND.put(MINECRAFT_1_14_3, 0x23);
MAPPING_SERVERBOUND.put(MINECRAFT_1_14_4, 0x23);
MAPPING_SERVERBOUND.put(MINECRAFT_1_15, 0x23);
}

private short newSlot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import de.exceptionflug.protocolize.api.protocol.AbstractPacket;
import de.exceptionflug.protocolize.items.ItemStack;
import io.netty.buffer.ByteBuf;
import net.md_5.bungee.protocol.Protocol;
import net.md_5.bungee.protocol.ProtocolConstants.Direction;

import java.util.Map;
Expand Down Expand Up @@ -37,6 +36,7 @@ public class SetSlot extends AbstractPacket {
MAPPING.put(MINECRAFT_1_14_2, 0x16);
MAPPING.put(MINECRAFT_1_14_3, 0x16);
MAPPING.put(MINECRAFT_1_14_4, 0x16);
MAPPING.put(MINECRAFT_1_15, 0x17);
}

private byte windowId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class UseItem extends AbstractPacket {
MAPPING.put(MINECRAFT_1_14_2, 0x2D);
MAPPING.put(MINECRAFT_1_14_3, 0x2D);
MAPPING.put(MINECRAFT_1_14_4, 0x2D);
MAPPING.put(MINECRAFT_1_15, 0x2D);
}

private Hand hand;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class WindowItems extends AbstractPacket {
MAPPING.put(MINECRAFT_1_14_2, 0x14);
MAPPING.put(MINECRAFT_1_14_3, 0x14);
MAPPING.put(MINECRAFT_1_14_4, 0x14);
MAPPING.put(MINECRAFT_1_15, 0x15);
}

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

0 comments on commit 457978e

Please sign in to comment.