mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-11-14 19:34:58 -05:00
Update to new packetlib changes
This commit is contained in:
parent
87c0953d27
commit
c5032fb425
3 changed files with 249 additions and 215 deletions
52
Jenkinsfile
vendored
Normal file
52
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
pipeline {
|
||||
agent any
|
||||
tools {
|
||||
maven 'Maven 3'
|
||||
jdk 'Java 8'
|
||||
}
|
||||
options {
|
||||
buildDiscarder(logRotator(artifactNumToKeepStr: '20'))
|
||||
}
|
||||
stages {
|
||||
stage ('Build') {
|
||||
steps {
|
||||
sh 'mvn clean package'
|
||||
}
|
||||
post {
|
||||
success {
|
||||
archiveArtifacts artifacts: 'target/*.jar', excludes: 'target/*-sources.jar', fingerprint: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ('Deploy') {
|
||||
when {
|
||||
branch "master"
|
||||
}
|
||||
|
||||
steps {
|
||||
rtMavenDeployer(
|
||||
id: "maven-deployer",
|
||||
serverId: "opencollab-artifactory",
|
||||
releaseRepo: "maven-releases",
|
||||
snapshotRepo: "maven-snapshots"
|
||||
)
|
||||
rtMavenResolver(
|
||||
id: "maven-resolver",
|
||||
serverId: "opencollab-artifactory",
|
||||
releaseRepo: "maven-deploy-release",
|
||||
snapshotRepo: "maven-deploy-snapshot"
|
||||
)
|
||||
rtMavenRun(
|
||||
pom: 'pom.xml',
|
||||
goals: 'javadoc:jar source:jar install -DskipTests',
|
||||
deployerId: "maven-deployer",
|
||||
resolverId: "maven-resolver"
|
||||
)
|
||||
rtPublishBuildInfo(
|
||||
serverId: "opencollab-artifactory"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
20
pom.xml
20
pom.xml
|
@ -47,6 +47,26 @@
|
|||
</issueManagement>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>opencollab-release-repo</id>
|
||||
<url>https://repo.opencollab.dev/maven-releases/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>opencollab-snapshot-repo</id>
|
||||
<url>https://repo.opencollab.dev/maven-snapshots/</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
|
|
|
@ -3,30 +3,7 @@ package com.github.steveice10.mc.protocol;
|
|||
import com.github.steveice10.mc.auth.data.GameProfile;
|
||||
import com.github.steveice10.mc.protocol.data.SubProtocol;
|
||||
import com.github.steveice10.mc.protocol.packet.handshake.serverbound.ClientIntentionPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundAwardStatsPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundBossEventPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundChangeDifficultyPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundChatPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundCommandSuggestionsPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundCommandsPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundCooldownPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundCustomPayloadPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundDisconnectPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundKeepAlivePacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundLoginPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundPingPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundPlayerInfoPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundRecipePacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundResourcePackPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundRespawnPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundSelectAdvancementsTabPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundSetCameraPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundSoundEntityPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundStopSoundPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundTabListPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundUpdateAdvancementsPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundUpdateRecipesPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundUpdateTagsPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.*;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundAnimatePacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundEntityEventPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundMoveEntityPosPacket;
|
||||
|
@ -60,28 +37,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.spawn.
|
|||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.spawn.ClientboundAddMobPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.spawn.ClientboundAddPaintingPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.spawn.ClientboundAddPlayerPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundAddVibrationSignalPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundBlockDestructionPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundBlockEntityDataPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundBlockEventPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundBlockUpdatePacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundCustomSoundPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundExplodePacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundForgetLevelChunkPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundGameEventPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundLevelChunkPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundLevelEventPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundLevelParticlesPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundLightUpdatePacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundMapItemDataPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundOpenSignEditorPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundSectionBlocksUpdatePacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundSetChunkCacheCenterPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundSetChunkCacheRadiusPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundSetDefaultSpawnPositionPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundSetTimePacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundSoundPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundTagQueryPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.*;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.border.ClientboundInitializeBorderPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.border.ClientboundSetBorderCenterPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.border.ClientboundSetBorderLerpSizePacket;
|
||||
|
@ -172,6 +128,7 @@ import com.github.steveice10.packetlib.crypt.AESEncryption;
|
|||
import com.github.steveice10.packetlib.crypt.PacketEncryption;
|
||||
import com.github.steveice10.packetlib.packet.DefaultPacketHeader;
|
||||
import com.github.steveice10.packetlib.packet.Packet;
|
||||
import com.github.steveice10.packetlib.packet.PacketFactory;
|
||||
import com.github.steveice10.packetlib.packet.PacketHeader;
|
||||
import com.github.steveice10.packetlib.packet.PacketProtocol;
|
||||
import lombok.Getter;
|
||||
|
@ -181,7 +138,6 @@ import lombok.Setter;
|
|||
import java.security.GeneralSecurityException;
|
||||
import java.security.Key;
|
||||
import java.util.UUID;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
/**
|
||||
* Implements the Minecraft protocol.
|
||||
|
@ -334,185 +290,191 @@ public class MinecraftProtocol extends PacketProtocol {
|
|||
}
|
||||
|
||||
private void initClientHandshake() {
|
||||
this.registerOutgoing(0, ClientIntentionPacket.class);
|
||||
this.registerOutgoing(0, ClientIntentionPacket.class, ClientIntentionPacket::new);
|
||||
}
|
||||
|
||||
private void initServerHandshake() {
|
||||
this.registerIncoming(0, ClientIntentionPacket.class);
|
||||
this.registerIncoming(0, ClientIntentionPacket.class, ClientIntentionPacket::new);
|
||||
}
|
||||
|
||||
private void initLogin(BiConsumer<Integer, Class<? extends Packet>> clientboundPackets, BiConsumer<Integer, Class<? extends Packet>> serverboundPackets) {
|
||||
clientboundPackets.accept(0x00, ClientboundLoginDisconnectPacket.class);
|
||||
clientboundPackets.accept(0x01, ClientboundHelloPacket.class);
|
||||
clientboundPackets.accept(0x02, ClientboundGameProfilePacket.class);
|
||||
clientboundPackets.accept(0x03, ClientboundLoginCompressionPacket.class);
|
||||
clientboundPackets.accept(0x04, ClientboundCustomQueryPacket.class);
|
||||
private void initLogin(PacketRegisterFactory clientboundPackets, PacketRegisterFactory serverboundPackets) {
|
||||
clientboundPackets.register(0x00, ClientboundLoginDisconnectPacket.class, ClientboundLoginDisconnectPacket::new);
|
||||
clientboundPackets.register(0x01, ClientboundHelloPacket.class, ClientboundHelloPacket::new);
|
||||
clientboundPackets.register(0x02, ClientboundGameProfilePacket.class, ClientboundGameProfilePacket::new);
|
||||
clientboundPackets.register(0x03, ClientboundLoginCompressionPacket.class, ClientboundLoginCompressionPacket::new);
|
||||
clientboundPackets.register(0x04, ClientboundCustomQueryPacket.class, ClientboundCustomQueryPacket::new);
|
||||
|
||||
serverboundPackets.accept(0x00, ServerboundHelloPacket.class);
|
||||
serverboundPackets.accept(0x01, ServerboundKeyPacket.class);
|
||||
serverboundPackets.accept(0x02, ServerboundCustomQueryPacket.class);
|
||||
serverboundPackets.register(0x00, ServerboundHelloPacket.class, ServerboundHelloPacket::new);
|
||||
serverboundPackets.register(0x01, ServerboundKeyPacket.class, ServerboundKeyPacket::new);
|
||||
serverboundPackets.register(0x02, ServerboundCustomQueryPacket.class, ServerboundCustomQueryPacket::new);
|
||||
}
|
||||
|
||||
private void initGame(BiConsumer<Integer, Class<? extends Packet>> clientboundPackets, BiConsumer<Integer, Class<? extends Packet>> serverboundPackets) {
|
||||
clientboundPackets.accept(0x00, ClientboundAddEntityPacket.class);
|
||||
clientboundPackets.accept(0x01, ClientboundAddExperienceOrbPacket.class);
|
||||
clientboundPackets.accept(0x02, ClientboundAddMobPacket.class);
|
||||
clientboundPackets.accept(0x03, ClientboundAddPaintingPacket.class);
|
||||
clientboundPackets.accept(0x04, ClientboundAddPlayerPacket.class);
|
||||
clientboundPackets.accept(0x05, ClientboundAddVibrationSignalPacket.class);
|
||||
clientboundPackets.accept(0x06, ClientboundAnimatePacket.class);
|
||||
clientboundPackets.accept(0x07, ClientboundAwardStatsPacket.class);
|
||||
clientboundPackets.accept(0x08, ClientboundBlockBreakAckPacket.class);
|
||||
clientboundPackets.accept(0x09, ClientboundBlockDestructionPacket.class);
|
||||
clientboundPackets.accept(0x0A, ClientboundBlockEntityDataPacket.class);
|
||||
clientboundPackets.accept(0x0B, ClientboundBlockEventPacket.class);
|
||||
clientboundPackets.accept(0x0C, ClientboundBlockUpdatePacket.class);
|
||||
clientboundPackets.accept(0x0D, ClientboundBossEventPacket.class);
|
||||
clientboundPackets.accept(0x0E, ClientboundChangeDifficultyPacket.class);
|
||||
clientboundPackets.accept(0x0F, ClientboundChatPacket.class);
|
||||
clientboundPackets.accept(0x10, ClientboundClearTitlesPacket.class);
|
||||
clientboundPackets.accept(0x11, ClientboundCommandSuggestionsPacket.class);
|
||||
clientboundPackets.accept(0x12, ClientboundCommandsPacket.class);
|
||||
clientboundPackets.accept(0x13, ClientboundContainerClosePacket.class);
|
||||
clientboundPackets.accept(0x14, ClientboundContainerSetContentPacket.class);
|
||||
clientboundPackets.accept(0x15, ClientboundContainerSetDataPacket.class);
|
||||
clientboundPackets.accept(0x16, ClientboundContainerSetSlotPacket.class);
|
||||
clientboundPackets.accept(0x17, ClientboundCooldownPacket.class);
|
||||
clientboundPackets.accept(0x18, ClientboundCustomPayloadPacket.class);
|
||||
clientboundPackets.accept(0x19, ClientboundCustomSoundPacket.class);
|
||||
clientboundPackets.accept(0x1A, ClientboundDisconnectPacket.class);
|
||||
clientboundPackets.accept(0x1B, ClientboundEntityEventPacket.class);
|
||||
clientboundPackets.accept(0x1C, ClientboundExplodePacket.class);
|
||||
clientboundPackets.accept(0x1D, ClientboundForgetLevelChunkPacket.class);
|
||||
clientboundPackets.accept(0x1E, ClientboundGameEventPacket.class);
|
||||
clientboundPackets.accept(0x1F, ClientboundHorseScreenOpenPacket.class);
|
||||
clientboundPackets.accept(0x20, ClientboundInitializeBorderPacket.class);
|
||||
clientboundPackets.accept(0x21, ClientboundKeepAlivePacket.class);
|
||||
clientboundPackets.accept(0x22, ClientboundLevelChunkPacket.class);
|
||||
clientboundPackets.accept(0x23, ClientboundLevelEventPacket.class);
|
||||
clientboundPackets.accept(0x24, ClientboundLevelParticlesPacket.class);
|
||||
clientboundPackets.accept(0x25, ClientboundLightUpdatePacket.class);
|
||||
clientboundPackets.accept(0x26, ClientboundLoginPacket.class);
|
||||
clientboundPackets.accept(0x27, ClientboundMapItemDataPacket.class);
|
||||
clientboundPackets.accept(0x28, ClientboundMerchantOffersPacket.class);
|
||||
clientboundPackets.accept(0x29, ClientboundMoveEntityPosPacket.class);
|
||||
clientboundPackets.accept(0x2A, ClientboundMoveEntityPosRotPacket.class);
|
||||
clientboundPackets.accept(0x2B, ClientboundMoveEntityRotPacket.class);
|
||||
clientboundPackets.accept(0x2C, ClientboundMoveVehiclePacket.class);
|
||||
clientboundPackets.accept(0x2D, ClientboundOpenBookPacket.class);
|
||||
clientboundPackets.accept(0x2E, ClientboundOpenScreenPacket.class);
|
||||
clientboundPackets.accept(0x2F, ClientboundOpenSignEditorPacket.class);
|
||||
clientboundPackets.accept(0x30, ClientboundPingPacket.class);
|
||||
clientboundPackets.accept(0x31, ClientboundPlaceGhostRecipePacket.class);
|
||||
clientboundPackets.accept(0x32, ClientboundPlayerAbilitiesPacket.class);
|
||||
clientboundPackets.accept(0x33, ClientboundPlayerCombatEndPacket.class);
|
||||
clientboundPackets.accept(0x34, ClientboundPlayerCombatEnterPacket.class);
|
||||
clientboundPackets.accept(0x35, ClientboundPlayerCombatKillPacket.class);
|
||||
clientboundPackets.accept(0x36, ClientboundPlayerInfoPacket.class);
|
||||
clientboundPackets.accept(0x37, ClientboundPlayerLookAtPacket.class);
|
||||
clientboundPackets.accept(0x38, ClientboundPlayerPositionPacket.class);
|
||||
clientboundPackets.accept(0x39, ClientboundRecipePacket.class);
|
||||
clientboundPackets.accept(0x3A, ClientboundRemoveEntitiesPacket.class);
|
||||
clientboundPackets.accept(0x3B, ClientboundRemoveMobEffectPacket.class);
|
||||
clientboundPackets.accept(0x3C, ClientboundResourcePackPacket.class);
|
||||
clientboundPackets.accept(0x3D, ClientboundRespawnPacket.class);
|
||||
clientboundPackets.accept(0x3E, ClientboundRotateHeadPacket.class);
|
||||
clientboundPackets.accept(0x3F, ClientboundSectionBlocksUpdatePacket.class);
|
||||
clientboundPackets.accept(0x40, ClientboundSelectAdvancementsTabPacket.class);
|
||||
clientboundPackets.accept(0x41, ClientboundSetActionBarTextPacket.class);
|
||||
clientboundPackets.accept(0x42, ClientboundSetBorderCenterPacket.class);
|
||||
clientboundPackets.accept(0x43, ClientboundSetBorderLerpSizePacket.class);
|
||||
clientboundPackets.accept(0x44, ClientboundSetBorderSizePacket.class);
|
||||
clientboundPackets.accept(0x45, ClientboundSetBorderWarningDelayPacket.class);
|
||||
clientboundPackets.accept(0x46, ClientboundSetBorderWarningDistancePacket.class);
|
||||
clientboundPackets.accept(0x47, ClientboundSetCameraPacket.class);
|
||||
clientboundPackets.accept(0x48, ClientboundSetCarriedItemPacket.class);
|
||||
clientboundPackets.accept(0x49, ClientboundSetChunkCacheCenterPacket.class);
|
||||
clientboundPackets.accept(0x4A, ClientboundSetChunkCacheRadiusPacket.class);
|
||||
clientboundPackets.accept(0x4B, ClientboundSetDefaultSpawnPositionPacket.class);
|
||||
clientboundPackets.accept(0x4C, ClientboundSetDisplayObjectivePacket.class);
|
||||
clientboundPackets.accept(0x4D, ClientboundSetEntityDataPacket.class);
|
||||
clientboundPackets.accept(0x4E, ClientboundSetEntityLinkPacket.class);
|
||||
clientboundPackets.accept(0x4F, ClientboundSetEntityMotionPacket.class);
|
||||
clientboundPackets.accept(0x50, ClientboundSetEquipmentPacket.class);
|
||||
clientboundPackets.accept(0x51, ClientboundSetExperiencePacket.class);
|
||||
clientboundPackets.accept(0x52, ClientboundSetHealthPacket.class);
|
||||
clientboundPackets.accept(0x53, ClientboundSetObjectivePacket.class);
|
||||
clientboundPackets.accept(0x54, ClientboundSetPassengersPacket.class);
|
||||
clientboundPackets.accept(0x55, ClientboundSetPlayerTeamPacket.class);
|
||||
clientboundPackets.accept(0x56, ClientboundSetScorePacket.class);
|
||||
clientboundPackets.accept(0x57, ClientboundSetSubtitleTextPacket.class);
|
||||
clientboundPackets.accept(0x58, ClientboundSetTimePacket.class);
|
||||
clientboundPackets.accept(0x59, ClientboundSetTitleTextPacket.class);
|
||||
clientboundPackets.accept(0x5A, ClientboundSetTitlesAnimationPacket.class);
|
||||
clientboundPackets.accept(0x5B, ClientboundSoundEntityPacket.class);
|
||||
clientboundPackets.accept(0x5C, ClientboundSoundPacket.class);
|
||||
clientboundPackets.accept(0x5D, ClientboundStopSoundPacket.class);
|
||||
clientboundPackets.accept(0x5E, ClientboundTabListPacket.class);
|
||||
clientboundPackets.accept(0x5F, ClientboundTagQueryPacket.class);
|
||||
clientboundPackets.accept(0x60, ClientboundTakeItemEntityPacket.class);
|
||||
clientboundPackets.accept(0x61, ClientboundTeleportEntityPacket.class);
|
||||
clientboundPackets.accept(0x62, ClientboundUpdateAdvancementsPacket.class);
|
||||
clientboundPackets.accept(0x63, ClientboundUpdateAttributesPacket.class);
|
||||
clientboundPackets.accept(0x64, ClientboundUpdateMobEffectPacket.class);
|
||||
clientboundPackets.accept(0x65, ClientboundUpdateRecipesPacket.class);
|
||||
clientboundPackets.accept(0x66, ClientboundUpdateTagsPacket.class);
|
||||
private void initGame(PacketRegisterFactory clientboundPackets, PacketRegisterFactory serverboundPackets) {
|
||||
clientboundPackets.register(0x00, ClientboundAddEntityPacket.class, ClientboundAddEntityPacket::new);
|
||||
clientboundPackets.register(0x01, ClientboundAddExperienceOrbPacket.class, ClientboundAddExperienceOrbPacket::new);
|
||||
clientboundPackets.register(0x02, ClientboundAddMobPacket.class, ClientboundAddMobPacket::new);
|
||||
clientboundPackets.register(0x03, ClientboundAddPaintingPacket.class, ClientboundAddPaintingPacket::new);
|
||||
clientboundPackets.register(0x04, ClientboundAddPlayerPacket.class, ClientboundAddPlayerPacket::new);
|
||||
clientboundPackets.register(0x05, ClientboundAddVibrationSignalPacket.class, ClientboundAddVibrationSignalPacket::new);
|
||||
clientboundPackets.register(0x06, ClientboundAnimatePacket.class, ClientboundAnimatePacket::new);
|
||||
clientboundPackets.register(0x07, ClientboundAwardStatsPacket.class, ClientboundAwardStatsPacket::new);
|
||||
clientboundPackets.register(0x08, ClientboundBlockBreakAckPacket.class, ClientboundBlockBreakAckPacket::new);
|
||||
clientboundPackets.register(0x09, ClientboundBlockDestructionPacket.class, ClientboundBlockDestructionPacket::new);
|
||||
clientboundPackets.register(0x0A, ClientboundBlockEntityDataPacket.class, ClientboundBlockEntityDataPacket::new);
|
||||
clientboundPackets.register(0x0B, ClientboundBlockEventPacket.class, ClientboundBlockEventPacket::new);
|
||||
clientboundPackets.register(0x0C, ClientboundBlockUpdatePacket.class, ClientboundBlockUpdatePacket::new);
|
||||
clientboundPackets.register(0x0D, ClientboundBossEventPacket.class, ClientboundBossEventPacket::new);
|
||||
clientboundPackets.register(0x0E, ClientboundChangeDifficultyPacket.class, ClientboundChangeDifficultyPacket::new);
|
||||
clientboundPackets.register(0x0F, ClientboundChatPacket.class, ClientboundChatPacket::new);
|
||||
clientboundPackets.register(0x10, ClientboundClearTitlesPacket.class, ClientboundClearTitlesPacket::new);
|
||||
clientboundPackets.register(0x11, ClientboundCommandSuggestionsPacket.class, ClientboundCommandSuggestionsPacket::new);
|
||||
clientboundPackets.register(0x12, ClientboundCommandsPacket.class, ClientboundCommandsPacket::new);
|
||||
clientboundPackets.register(0x13, ClientboundContainerClosePacket.class, ClientboundContainerClosePacket::new);
|
||||
clientboundPackets.register(0x14, ClientboundContainerSetContentPacket.class, ClientboundContainerSetContentPacket::new);
|
||||
clientboundPackets.register(0x15, ClientboundContainerSetDataPacket.class, ClientboundContainerSetDataPacket::new);
|
||||
clientboundPackets.register(0x16, ClientboundContainerSetSlotPacket.class, ClientboundContainerSetSlotPacket::new);
|
||||
clientboundPackets.register(0x17, ClientboundCooldownPacket.class, ClientboundCooldownPacket::new);
|
||||
clientboundPackets.register(0x18, ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new);
|
||||
clientboundPackets.register(0x19, ClientboundCustomSoundPacket.class, ClientboundCustomSoundPacket::new);
|
||||
clientboundPackets.register(0x1A, ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new);
|
||||
clientboundPackets.register(0x1B, ClientboundEntityEventPacket.class, ClientboundEntityEventPacket::new);
|
||||
clientboundPackets.register(0x1C, ClientboundExplodePacket.class, ClientboundExplodePacket::new);
|
||||
clientboundPackets.register(0x1D, ClientboundForgetLevelChunkPacket.class, ClientboundForgetLevelChunkPacket::new);
|
||||
clientboundPackets.register(0x1E, ClientboundGameEventPacket.class, ClientboundGameEventPacket::new);
|
||||
clientboundPackets.register(0x1F, ClientboundHorseScreenOpenPacket.class, ClientboundHorseScreenOpenPacket::new);
|
||||
clientboundPackets.register(0x20, ClientboundInitializeBorderPacket.class, ClientboundInitializeBorderPacket::new);
|
||||
clientboundPackets.register(0x21, ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new);
|
||||
clientboundPackets.register(0x22, ClientboundLevelChunkPacket.class, ClientboundLevelChunkPacket::new);
|
||||
clientboundPackets.register(0x23, ClientboundLevelEventPacket.class, ClientboundLevelEventPacket::new);
|
||||
clientboundPackets.register(0x24, ClientboundLevelParticlesPacket.class, ClientboundLevelParticlesPacket::new);
|
||||
clientboundPackets.register(0x25, ClientboundLightUpdatePacket.class, ClientboundLightUpdatePacket::new);
|
||||
clientboundPackets.register(0x26, ClientboundLoginPacket.class, ClientboundLoginPacket::new);
|
||||
clientboundPackets.register(0x27, ClientboundMapItemDataPacket.class, ClientboundMapItemDataPacket::new);
|
||||
clientboundPackets.register(0x28, ClientboundMerchantOffersPacket.class, ClientboundMerchantOffersPacket::new);
|
||||
clientboundPackets.register(0x29, ClientboundMoveEntityPosPacket.class, ClientboundMoveEntityPosPacket::new);
|
||||
clientboundPackets.register(0x2A, ClientboundMoveEntityPosRotPacket.class, ClientboundMoveEntityPosRotPacket::new);
|
||||
clientboundPackets.register(0x2B, ClientboundMoveEntityRotPacket.class, ClientboundMoveEntityRotPacket::new);
|
||||
clientboundPackets.register(0x2C, ClientboundMoveVehiclePacket.class, ClientboundMoveVehiclePacket::new);
|
||||
clientboundPackets.register(0x2D, ClientboundOpenBookPacket.class, ClientboundOpenBookPacket::new);
|
||||
clientboundPackets.register(0x2E, ClientboundOpenScreenPacket.class, ClientboundOpenScreenPacket::new);
|
||||
clientboundPackets.register(0x2F, ClientboundOpenSignEditorPacket.class, ClientboundOpenSignEditorPacket::new);
|
||||
clientboundPackets.register(0x30, ClientboundPingPacket.class, ClientboundPingPacket::new);
|
||||
clientboundPackets.register(0x31, ClientboundPlaceGhostRecipePacket.class, ClientboundPlaceGhostRecipePacket::new);
|
||||
clientboundPackets.register(0x32, ClientboundPlayerAbilitiesPacket.class, ClientboundPlayerAbilitiesPacket::new);
|
||||
clientboundPackets.register(0x33, ClientboundPlayerCombatEndPacket.class, ClientboundPlayerCombatEndPacket::new);
|
||||
clientboundPackets.register(0x34, ClientboundPlayerCombatEnterPacket.class, ClientboundPlayerCombatEnterPacket::new);
|
||||
clientboundPackets.register(0x35, ClientboundPlayerCombatKillPacket.class, ClientboundPlayerCombatKillPacket::new);
|
||||
clientboundPackets.register(0x36, ClientboundPlayerInfoPacket.class, ClientboundPlayerInfoPacket::new);
|
||||
clientboundPackets.register(0x37, ClientboundPlayerLookAtPacket.class, ClientboundPlayerLookAtPacket::new);
|
||||
clientboundPackets.register(0x38, ClientboundPlayerPositionPacket.class, ClientboundPlayerPositionPacket::new);
|
||||
clientboundPackets.register(0x39, ClientboundRecipePacket.class, ClientboundRecipePacket::new);
|
||||
clientboundPackets.register(0x3A, ClientboundRemoveEntitiesPacket.class, ClientboundRemoveEntitiesPacket::new);
|
||||
clientboundPackets.register(0x3B, ClientboundRemoveMobEffectPacket.class, ClientboundRemoveMobEffectPacket::new);
|
||||
clientboundPackets.register(0x3C, ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new);
|
||||
clientboundPackets.register(0x3D, ClientboundRespawnPacket.class, ClientboundRespawnPacket::new);
|
||||
clientboundPackets.register(0x3E, ClientboundRotateHeadPacket.class, ClientboundRotateHeadPacket::new);
|
||||
clientboundPackets.register(0x3F, ClientboundSectionBlocksUpdatePacket.class, ClientboundSectionBlocksUpdatePacket::new);
|
||||
clientboundPackets.register(0x40, ClientboundSelectAdvancementsTabPacket.class, ClientboundSelectAdvancementsTabPacket::new);
|
||||
clientboundPackets.register(0x41, ClientboundSetActionBarTextPacket.class, ClientboundSetActionBarTextPacket::new);
|
||||
clientboundPackets.register(0x42, ClientboundSetBorderCenterPacket.class, ClientboundSetBorderCenterPacket::new);
|
||||
clientboundPackets.register(0x43, ClientboundSetBorderLerpSizePacket.class, ClientboundSetBorderLerpSizePacket::new);
|
||||
clientboundPackets.register(0x44, ClientboundSetBorderSizePacket.class, ClientboundSetBorderSizePacket::new);
|
||||
clientboundPackets.register(0x45, ClientboundSetBorderWarningDelayPacket.class, ClientboundSetBorderWarningDelayPacket::new);
|
||||
clientboundPackets.register(0x46, ClientboundSetBorderWarningDistancePacket.class, ClientboundSetBorderWarningDistancePacket::new);
|
||||
clientboundPackets.register(0x47, ClientboundSetCameraPacket.class, ClientboundSetCameraPacket::new);
|
||||
clientboundPackets.register(0x48, ClientboundSetCarriedItemPacket.class, ClientboundSetCarriedItemPacket::new);
|
||||
clientboundPackets.register(0x49, ClientboundSetChunkCacheCenterPacket.class, ClientboundSetChunkCacheCenterPacket::new);
|
||||
clientboundPackets.register(0x4A, ClientboundSetChunkCacheRadiusPacket.class, ClientboundSetChunkCacheRadiusPacket::new);
|
||||
clientboundPackets.register(0x4B, ClientboundSetDefaultSpawnPositionPacket.class, ClientboundSetDefaultSpawnPositionPacket::new);
|
||||
clientboundPackets.register(0x4C, ClientboundSetDisplayObjectivePacket.class, ClientboundSetDisplayObjectivePacket::new);
|
||||
clientboundPackets.register(0x4D, ClientboundSetEntityDataPacket.class, ClientboundSetEntityDataPacket::new);
|
||||
clientboundPackets.register(0x4E, ClientboundSetEntityLinkPacket.class, ClientboundSetEntityLinkPacket::new);
|
||||
clientboundPackets.register(0x4F, ClientboundSetEntityMotionPacket.class, ClientboundSetEntityMotionPacket::new);
|
||||
clientboundPackets.register(0x50, ClientboundSetEquipmentPacket.class, ClientboundSetEquipmentPacket::new);
|
||||
clientboundPackets.register(0x51, ClientboundSetExperiencePacket.class, ClientboundSetExperiencePacket::new);
|
||||
clientboundPackets.register(0x52, ClientboundSetHealthPacket.class, ClientboundSetHealthPacket::new);
|
||||
clientboundPackets.register(0x53, ClientboundSetObjectivePacket.class, ClientboundSetObjectivePacket::new);
|
||||
clientboundPackets.register(0x54, ClientboundSetPassengersPacket.class, ClientboundSetPassengersPacket::new);
|
||||
clientboundPackets.register(0x55, ClientboundSetPlayerTeamPacket.class, ClientboundSetPlayerTeamPacket::new);
|
||||
clientboundPackets.register(0x56, ClientboundSetScorePacket.class, ClientboundSetScorePacket::new);
|
||||
clientboundPackets.register(0x57, ClientboundSetSubtitleTextPacket.class, ClientboundSetSubtitleTextPacket::new);
|
||||
clientboundPackets.register(0x58, ClientboundSetTimePacket.class, ClientboundSetTimePacket::new);
|
||||
clientboundPackets.register(0x59, ClientboundSetTitleTextPacket.class, ClientboundSetTitleTextPacket::new);
|
||||
clientboundPackets.register(0x5A, ClientboundSetTitlesAnimationPacket.class, ClientboundSetTitlesAnimationPacket::new);
|
||||
clientboundPackets.register(0x5B, ClientboundSoundEntityPacket.class, ClientboundSoundEntityPacket::new);
|
||||
clientboundPackets.register(0x5C, ClientboundSoundPacket.class, ClientboundSoundPacket::new);
|
||||
clientboundPackets.register(0x5D, ClientboundStopSoundPacket.class, ClientboundStopSoundPacket::new);
|
||||
clientboundPackets.register(0x5E, ClientboundTabListPacket.class, ClientboundTabListPacket::new);
|
||||
clientboundPackets.register(0x5F, ClientboundTagQueryPacket.class, ClientboundTagQueryPacket::new);
|
||||
clientboundPackets.register(0x60, ClientboundTakeItemEntityPacket.class, ClientboundTakeItemEntityPacket::new);
|
||||
clientboundPackets.register(0x61, ClientboundTeleportEntityPacket.class, ClientboundTeleportEntityPacket::new);
|
||||
clientboundPackets.register(0x62, ClientboundUpdateAdvancementsPacket.class, ClientboundUpdateAdvancementsPacket::new);
|
||||
clientboundPackets.register(0x63, ClientboundUpdateAttributesPacket.class, ClientboundUpdateAttributesPacket::new);
|
||||
clientboundPackets.register(0x64, ClientboundUpdateMobEffectPacket.class, ClientboundUpdateMobEffectPacket::new);
|
||||
clientboundPackets.register(0x65, ClientboundUpdateRecipesPacket.class, ClientboundUpdateRecipesPacket::new);
|
||||
clientboundPackets.register(0x66, ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new);
|
||||
|
||||
serverboundPackets.accept(0x00, ServerboundAcceptTeleportationPacket.class);
|
||||
serverboundPackets.accept(0x01, ServerboundBlockEntityTagQuery.class);
|
||||
serverboundPackets.accept(0x02, ServerboundChangeDifficultyPacket.class);
|
||||
serverboundPackets.accept(0x03, ServerboundChatPacket.class);
|
||||
serverboundPackets.accept(0x04, ServerboundClientCommandPacket.class);
|
||||
serverboundPackets.accept(0x05, ServerboundClientInformationPacket.class);
|
||||
serverboundPackets.accept(0x06, ServerboundCommandSuggestionPacket.class);
|
||||
serverboundPackets.accept(0x07, ServerboundContainerButtonClickPacket.class);
|
||||
serverboundPackets.accept(0x08, ServerboundContainerClickPacket.class);
|
||||
serverboundPackets.accept(0x09, ServerboundContainerClosePacket.class);
|
||||
serverboundPackets.accept(0x0A, ServerboundCustomPayloadPacket.class);
|
||||
serverboundPackets.accept(0x0B, ServerboundEditBookPacket.class);
|
||||
serverboundPackets.accept(0x0C, ServerboundEntityTagQuery.class);
|
||||
serverboundPackets.accept(0x0D, ServerboundInteractPacket.class);
|
||||
serverboundPackets.accept(0x0E, ServerboundJigsawGeneratePacket.class);
|
||||
serverboundPackets.accept(0x0F, ServerboundKeepAlivePacket.class);
|
||||
serverboundPackets.accept(0x10, ServerboundLockDifficultyPacket.class);
|
||||
serverboundPackets.accept(0x11, ServerboundMovePlayerPosPacket.class);
|
||||
serverboundPackets.accept(0x12, ServerboundMovePlayerPosRotPacket.class);
|
||||
serverboundPackets.accept(0x13, ServerboundMovePlayerRotPacket.class);
|
||||
serverboundPackets.accept(0x14, ServerboundMovePlayerStatusOnlyPacket.class);
|
||||
serverboundPackets.accept(0x15, ServerboundMoveVehiclePacket.class);
|
||||
serverboundPackets.accept(0x16, ServerboundPaddleBoatPacket.class);
|
||||
serverboundPackets.accept(0x17, ServerboundPickItemPacket.class);
|
||||
serverboundPackets.accept(0x18, ServerboundPlaceRecipePacket.class);
|
||||
serverboundPackets.accept(0x19, ServerboundPlayerAbilitiesPacket.class);
|
||||
serverboundPackets.accept(0x1A, ServerboundPlayerActionPacket.class);
|
||||
serverboundPackets.accept(0x1B, ServerboundPlayerCommandPacket.class);
|
||||
serverboundPackets.accept(0x1C, ServerboundPlayerInputPacket.class);
|
||||
serverboundPackets.accept(0x1D, ServerboundPongPacket.class);
|
||||
serverboundPackets.accept(0x1E, ServerboundRecipeBookChangeSettingsPacket.class);
|
||||
serverboundPackets.accept(0x1F, ServerboundRecipeBookSeenRecipePacket.class);
|
||||
serverboundPackets.accept(0x20, ServerboundRenameItemPacket.class);
|
||||
serverboundPackets.accept(0x21, ServerboundResourcePackPacket.class);
|
||||
serverboundPackets.accept(0x22, ServerboundSeenAdvancementsPacket.class);
|
||||
serverboundPackets.accept(0x23, ServerboundSelectTradePacket.class);
|
||||
serverboundPackets.accept(0x24, ServerboundSetBeaconPacket.class);
|
||||
serverboundPackets.accept(0x25, ServerboundSetCarriedItemPacket.class);
|
||||
serverboundPackets.accept(0x26, ServerboundSetCommandBlockPacket.class);
|
||||
serverboundPackets.accept(0x27, ServerboundSetCommandMinecartPacket.class);
|
||||
serverboundPackets.accept(0x28, ServerboundSetCreativeModeSlotPacket.class);
|
||||
serverboundPackets.accept(0x29, ServerboundSetJigsawBlockPacket.class);
|
||||
serverboundPackets.accept(0x2A, ServerboundSetStructureBlockPacket.class);
|
||||
serverboundPackets.accept(0x2B, ServerboundSignUpdatePacket.class);
|
||||
serverboundPackets.accept(0x2C, ServerboundSwingPacket.class);
|
||||
serverboundPackets.accept(0x2D, ServerboundTeleportToEntityPacket.class);
|
||||
serverboundPackets.accept(0x2E, ServerboundUseItemOnPacket.class);
|
||||
serverboundPackets.accept(0x2F, ServerboundUseItemPacket.class);
|
||||
serverboundPackets.register(0x00, ServerboundAcceptTeleportationPacket.class, ServerboundAcceptTeleportationPacket::new);
|
||||
serverboundPackets.register(0x01, ServerboundBlockEntityTagQuery.class, ServerboundBlockEntityTagQuery::new);
|
||||
serverboundPackets.register(0x02, ServerboundChangeDifficultyPacket.class, ServerboundChangeDifficultyPacket::new);
|
||||
serverboundPackets.register(0x03, ServerboundChatPacket.class, ServerboundChatPacket::new);
|
||||
serverboundPackets.register(0x04, ServerboundClientCommandPacket.class, ServerboundClientCommandPacket::new);
|
||||
serverboundPackets.register(0x05, ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new);
|
||||
serverboundPackets.register(0x06, ServerboundCommandSuggestionPacket.class, ServerboundCommandSuggestionPacket::new);
|
||||
serverboundPackets.register(0x07, ServerboundContainerButtonClickPacket.class, ServerboundContainerButtonClickPacket::new);
|
||||
serverboundPackets.register(0x08, ServerboundContainerClickPacket.class, ServerboundContainerClickPacket::new);
|
||||
serverboundPackets.register(0x09, ServerboundContainerClosePacket.class, ServerboundContainerClosePacket::new);
|
||||
serverboundPackets.register(0x0A, ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new);
|
||||
serverboundPackets.register(0x0B, ServerboundEditBookPacket.class, ServerboundEditBookPacket::new);
|
||||
serverboundPackets.register(0x0C, ServerboundEntityTagQuery.class, ServerboundEntityTagQuery::new);
|
||||
serverboundPackets.register(0x0D, ServerboundInteractPacket.class, ServerboundInteractPacket::new);
|
||||
serverboundPackets.register(0x0E, ServerboundJigsawGeneratePacket.class, ServerboundJigsawGeneratePacket::new);
|
||||
serverboundPackets.register(0x0F, ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new);
|
||||
serverboundPackets.register(0x10, ServerboundLockDifficultyPacket.class, ServerboundLockDifficultyPacket::new);
|
||||
serverboundPackets.register(0x11, ServerboundMovePlayerPosPacket.class, ServerboundMovePlayerPosPacket::new);
|
||||
serverboundPackets.register(0x12, ServerboundMovePlayerPosRotPacket.class, ServerboundMovePlayerPosRotPacket::new);
|
||||
serverboundPackets.register(0x13, ServerboundMovePlayerRotPacket.class, ServerboundMovePlayerRotPacket::new);
|
||||
serverboundPackets.register(0x14, ServerboundMovePlayerStatusOnlyPacket.class, ServerboundMovePlayerStatusOnlyPacket::new);
|
||||
serverboundPackets.register(0x15, ServerboundMoveVehiclePacket.class, ServerboundMoveVehiclePacket::new);
|
||||
serverboundPackets.register(0x16, ServerboundPaddleBoatPacket.class, ServerboundPaddleBoatPacket::new);
|
||||
serverboundPackets.register(0x17, ServerboundPickItemPacket.class, ServerboundPickItemPacket::new);
|
||||
serverboundPackets.register(0x18, ServerboundPlaceRecipePacket.class, ServerboundPlaceRecipePacket::new);
|
||||
serverboundPackets.register(0x19, ServerboundPlayerAbilitiesPacket.class, ServerboundPlayerAbilitiesPacket::new);
|
||||
serverboundPackets.register(0x1A, ServerboundPlayerActionPacket.class, ServerboundPlayerActionPacket::new);
|
||||
serverboundPackets.register(0x1B, ServerboundPlayerCommandPacket.class, ServerboundPlayerCommandPacket::new);
|
||||
serverboundPackets.register(0x1C, ServerboundPlayerInputPacket.class, ServerboundPlayerInputPacket::new);
|
||||
serverboundPackets.register(0x1D, ServerboundPongPacket.class, ServerboundPongPacket::new);
|
||||
serverboundPackets.register(0x1E, ServerboundRecipeBookChangeSettingsPacket.class, ServerboundRecipeBookChangeSettingsPacket::new);
|
||||
serverboundPackets.register(0x1F, ServerboundRecipeBookSeenRecipePacket.class, ServerboundRecipeBookSeenRecipePacket::new);
|
||||
serverboundPackets.register(0x20, ServerboundRenameItemPacket.class, ServerboundRenameItemPacket::new);
|
||||
serverboundPackets.register(0x21, ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new);
|
||||
serverboundPackets.register(0x22, ServerboundSeenAdvancementsPacket.class, ServerboundSeenAdvancementsPacket::new);
|
||||
serverboundPackets.register(0x23, ServerboundSelectTradePacket.class, ServerboundSelectTradePacket::new);
|
||||
serverboundPackets.register(0x24, ServerboundSetBeaconPacket.class, ServerboundSetBeaconPacket::new);
|
||||
serverboundPackets.register(0x25, ServerboundSetCarriedItemPacket.class, ServerboundSetCarriedItemPacket::new);
|
||||
serverboundPackets.register(0x26, ServerboundSetCommandBlockPacket.class, ServerboundSetCommandBlockPacket::new);
|
||||
serverboundPackets.register(0x27, ServerboundSetCommandMinecartPacket.class, ServerboundSetCommandMinecartPacket::new);
|
||||
serverboundPackets.register(0x28, ServerboundSetCreativeModeSlotPacket.class, ServerboundSetCreativeModeSlotPacket::new);
|
||||
serverboundPackets.register(0x29, ServerboundSetJigsawBlockPacket.class, ServerboundSetJigsawBlockPacket::new);
|
||||
serverboundPackets.register(0x2A, ServerboundSetStructureBlockPacket.class, ServerboundSetStructureBlockPacket::new);
|
||||
serverboundPackets.register(0x2B, ServerboundSignUpdatePacket.class, ServerboundSignUpdatePacket::new);
|
||||
serverboundPackets.register(0x2C, ServerboundSwingPacket.class, ServerboundSwingPacket::new);
|
||||
serverboundPackets.register(0x2D, ServerboundTeleportToEntityPacket.class, ServerboundTeleportToEntityPacket::new);
|
||||
serverboundPackets.register(0x2E, ServerboundUseItemOnPacket.class, ServerboundUseItemOnPacket::new);
|
||||
serverboundPackets.register(0x2F, ServerboundUseItemPacket.class, ServerboundUseItemPacket::new);
|
||||
}
|
||||
|
||||
private void initStatus(BiConsumer<Integer, Class<? extends Packet>> clientboundPackets, BiConsumer<Integer, Class<? extends Packet>> serverboundPackets) {
|
||||
clientboundPackets.accept(0x00, ClientboundStatusResponsePacket.class);
|
||||
clientboundPackets.accept(0x01, ClientboundPongResponsePacket.class);
|
||||
private void initStatus(PacketRegisterFactory clientboundPackets, PacketRegisterFactory serverboundPackets) {
|
||||
clientboundPackets.register(0x01, ClientboundStatusResponsePacket.class, ClientboundStatusResponsePacket::new);
|
||||
clientboundPackets.register(0x00, ClientboundStatusResponsePacket.class, ClientboundStatusResponsePacket::new);
|
||||
clientboundPackets.register(0x01, ClientboundPongResponsePacket.class, ClientboundPongResponsePacket::new);
|
||||
|
||||
serverboundPackets.accept(0x00, ServerboundStatusRequestPacket.class);
|
||||
serverboundPackets.accept(0x01, ServerboundPingRequestPacket.class);
|
||||
serverboundPackets.register(0x00, ServerboundStatusRequestPacket.class, ServerboundStatusRequestPacket::new);
|
||||
serverboundPackets.register(0x01, ServerboundPingRequestPacket.class, ServerboundPingRequestPacket::new);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
public interface PacketRegisterFactory {
|
||||
<T extends Packet> void register(int id, Class<T> packetClass, PacketFactory<T> factory);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue