├── .gitattributes ├── .gitignore ├── License.txt ├── PacketWrapper ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── comphenix │ │ │ └── packetwrapper │ │ │ ├── AbstractPacket.java │ │ │ ├── ChunkPacketProcessor.java │ │ │ ├── PacketWrapper.java │ │ │ ├── WrapperHandshakingClientSetProtocol.java │ │ │ ├── WrapperLoginClientCustomPayload.java │ │ │ ├── WrapperLoginClientEncryptionBegin.java │ │ │ ├── WrapperLoginClientStart.java │ │ │ ├── WrapperLoginServerCustomPayload.java │ │ │ ├── WrapperLoginServerDisconnect.java │ │ │ ├── WrapperLoginServerEncryptionBegin.java │ │ │ ├── WrapperLoginServerSetCompression.java │ │ │ ├── WrapperLoginServerSuccess.java │ │ │ ├── WrapperPlayClientAbilities.java │ │ │ ├── WrapperPlayClientAdvancements.java │ │ │ ├── WrapperPlayClientArmAnimation.java │ │ │ ├── WrapperPlayClientAutoRecipe.java │ │ │ ├── WrapperPlayClientBeacon.java │ │ │ ├── WrapperPlayClientBlockDig.java │ │ │ ├── WrapperPlayClientBlockPlace.java │ │ │ ├── WrapperPlayClientBoatMove.java │ │ │ ├── WrapperPlayClientBookEdit.java │ │ │ ├── WrapperPlayClientChat.java │ │ │ ├── WrapperPlayClientClientCommand.java │ │ │ ├── WrapperPlayClientCloseWindow.java │ │ │ ├── WrapperPlayClientCustomPayload.java │ │ │ ├── WrapperPlayClientDifficultyChange.java │ │ │ ├── WrapperPlayClientDifficultyLock.java │ │ │ ├── WrapperPlayClientEnchantItem.java │ │ │ ├── WrapperPlayClientEntityAction.java │ │ │ ├── WrapperPlayClientEntityNbtQuery.java │ │ │ ├── WrapperPlayClientFlying.java │ │ │ ├── WrapperPlayClientHeldItemSlot.java │ │ │ ├── WrapperPlayClientItemName.java │ │ │ ├── WrapperPlayClientKeepAlive.java │ │ │ ├── WrapperPlayClientLook.java │ │ │ ├── WrapperPlayClientPickItem.java │ │ │ ├── WrapperPlayClientPosition.java │ │ │ ├── WrapperPlayClientPositionLook.java │ │ │ ├── WrapperPlayClientRecipeDisplayed.java │ │ │ ├── WrapperPlayClientResourcePackStatus.java │ │ │ ├── WrapperPlayClientSetCommandBlock.java │ │ │ ├── WrapperPlayClientSetCommandMinecart.java │ │ │ ├── WrapperPlayClientSetCreativeSlot.java │ │ │ ├── WrapperPlayClientSetJigsaw.java │ │ │ ├── WrapperPlayClientSettings.java │ │ │ ├── WrapperPlayClientSpectate.java │ │ │ ├── WrapperPlayClientSteerVehicle.java │ │ │ ├── WrapperPlayClientStruct.java │ │ │ ├── WrapperPlayClientStructureBlock.java │ │ │ ├── WrapperPlayClientTabComplete.java │ │ │ ├── WrapperPlayClientTeleportAccept.java │ │ │ ├── WrapperPlayClientTileNbtQuery.java │ │ │ ├── WrapperPlayClientTradeSelect.java │ │ │ ├── WrapperPlayClientTransaction.java │ │ │ ├── WrapperPlayClientUpdateSign.java │ │ │ ├── WrapperPlayClientUseEntity.java │ │ │ ├── WrapperPlayClientUseItem.java │ │ │ ├── WrapperPlayClientVehicleMove.java │ │ │ ├── WrapperPlayClientWindowClick.java │ │ │ ├── WrapperPlayServerAbilities.java │ │ │ ├── WrapperPlayServerAdvancements.java │ │ │ ├── WrapperPlayServerAnimation.java │ │ │ ├── WrapperPlayServerAttachEntity.java │ │ │ ├── WrapperPlayServerAutoRecipe.java │ │ │ ├── WrapperPlayServerBed.java │ │ │ ├── WrapperPlayServerBlockAction.java │ │ │ ├── WrapperPlayServerBlockBreak.java │ │ │ ├── WrapperPlayServerBlockBreakAnimation.java │ │ │ ├── WrapperPlayServerBlockChange.java │ │ │ ├── WrapperPlayServerBoss.java │ │ │ ├── WrapperPlayServerCamera.java │ │ │ ├── WrapperPlayServerChat.java │ │ │ ├── WrapperPlayServerCloseWindow.java │ │ │ ├── WrapperPlayServerCollect.java │ │ │ ├── WrapperPlayServerCombatEvent.java │ │ │ ├── WrapperPlayServerCommands.java │ │ │ ├── WrapperPlayServerCustomPayload.java │ │ │ ├── WrapperPlayServerCustomSoundEffect.java │ │ │ ├── WrapperPlayServerEntity.java │ │ │ ├── WrapperPlayServerEntityDestroy.java │ │ │ ├── WrapperPlayServerEntityEffect.java │ │ │ ├── WrapperPlayServerEntityEquipment.java │ │ │ ├── WrapperPlayServerEntityHeadRotation.java │ │ │ ├── WrapperPlayServerEntityLook.java │ │ │ ├── WrapperPlayServerEntityMetadata.java │ │ │ ├── WrapperPlayServerEntitySound.java │ │ │ ├── WrapperPlayServerEntityStatus.java │ │ │ ├── WrapperPlayServerEntityTeleport.java │ │ │ ├── WrapperPlayServerEntityVelocity.java │ │ │ ├── WrapperPlayServerExperience.java │ │ │ ├── WrapperPlayServerExplosion.java │ │ │ ├── WrapperPlayServerGameStateChange.java │ │ │ ├── WrapperPlayServerHeldItemSlot.java │ │ │ ├── WrapperPlayServerKeepAlive.java │ │ │ ├── WrapperPlayServerKickDisconnect.java │ │ │ ├── WrapperPlayServerLightUpdate.java │ │ │ ├── WrapperPlayServerLogin.java │ │ │ ├── WrapperPlayServerLookAt.java │ │ │ ├── WrapperPlayServerMap.java │ │ │ ├── WrapperPlayServerMapChunk.java │ │ │ ├── WrapperPlayServerMount.java │ │ │ ├── WrapperPlayServerMultiBlockChange.java │ │ │ ├── WrapperPlayServerNamedEntitySpawn.java │ │ │ ├── WrapperPlayServerNamedSoundEffect.java │ │ │ ├── WrapperPlayServerNbtQuery.java │ │ │ ├── WrapperPlayServerOpenBook.java │ │ │ ├── WrapperPlayServerOpenSignEditor.java │ │ │ ├── WrapperPlayServerOpenWindow.java │ │ │ ├── WrapperPlayServerOpenWindowHorse.java │ │ │ ├── WrapperPlayServerOpenWindowMerchant.java │ │ │ ├── WrapperPlayServerPlayerInfo.java │ │ │ ├── WrapperPlayServerPlayerListHeaderFooter.java │ │ │ ├── WrapperPlayServerPosition.java │ │ │ ├── WrapperPlayServerRecipeUpdate.java │ │ │ ├── WrapperPlayServerRecipes.java │ │ │ ├── WrapperPlayServerRelEntityMove.java │ │ │ ├── WrapperPlayServerRelEntityMoveLook.java │ │ │ ├── WrapperPlayServerRemoveEntityEffect.java │ │ │ ├── WrapperPlayServerResourcePackSend.java │ │ │ ├── WrapperPlayServerRespawn.java │ │ │ ├── WrapperPlayServerScoreboardDisplayObjective.java │ │ │ ├── WrapperPlayServerScoreboardObjective.java │ │ │ ├── WrapperPlayServerScoreboardScore.java │ │ │ ├── WrapperPlayServerScoreboardTeam.java │ │ │ ├── WrapperPlayServerSelectAdvancementTab.java │ │ │ ├── WrapperPlayServerServerDifficulty.java │ │ │ ├── WrapperPlayServerSetCooldown.java │ │ │ ├── WrapperPlayServerSetSlot.java │ │ │ ├── WrapperPlayServerSpawnEntity.java │ │ │ ├── WrapperPlayServerSpawnEntityExperienceOrb.java │ │ │ ├── WrapperPlayServerSpawnEntityLiving.java │ │ │ ├── WrapperPlayServerSpawnEntityPainting.java │ │ │ ├── WrapperPlayServerSpawnEntityWeather.java │ │ │ ├── WrapperPlayServerSpawnPosition.java │ │ │ ├── WrapperPlayServerStatistic.java │ │ │ ├── WrapperPlayServerStopSound.java │ │ │ ├── WrapperPlayServerTabComplete.java │ │ │ ├── WrapperPlayServerTags.java │ │ │ ├── WrapperPlayServerTileEntityData.java │ │ │ ├── WrapperPlayServerTitle.java │ │ │ ├── WrapperPlayServerTransaction.java │ │ │ ├── WrapperPlayServerUnloadChunk.java │ │ │ ├── WrapperPlayServerUpdateAttributes.java │ │ │ ├── WrapperPlayServerUpdateHealth.java │ │ │ ├── WrapperPlayServerUpdateTime.java │ │ │ ├── WrapperPlayServerVehicleMove.java │ │ │ ├── WrapperPlayServerViewCentre.java │ │ │ ├── WrapperPlayServerViewDistance.java │ │ │ ├── WrapperPlayServerWindowData.java │ │ │ ├── WrapperPlayServerWindowItems.java │ │ │ ├── WrapperPlayServerWorldBorder.java │ │ │ ├── WrapperPlayServerWorldEvent.java │ │ │ ├── WrapperPlayServerWorldParticles.java │ │ │ ├── WrapperStatusClientPing.java │ │ │ ├── WrapperStatusClientStart.java │ │ │ ├── WrapperStatusServerPong.java │ │ │ ├── WrapperStatusServerServerInfo.java │ │ │ └── util │ │ │ └── Removed.java │ └── resources │ │ └── plugin.yml │ └── test │ └── java │ └── com │ └── comphenix │ └── packetwrapper │ ├── TestWrappers.java │ └── utils │ └── ItemFactoryDelegate.java └── Readme.md /.gitattributes: -------------------------------------------------------------------------------- 1 | *.java eol=crlf 2 | *.yml eol=crlf 3 | *.xml eol=crlf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse stuff 2 | .classpath 3 | .project 4 | .settings/ 5 | 6 | # netbeans 7 | nbproject/ 8 | nbactions.xml 9 | 10 | # we use maven! 11 | build.xml 12 | 13 | # maven 14 | target/ 15 | dependency-reduced-pom.xml 16 | 17 | # vim 18 | .*.sw[a-p] 19 | 20 | # various other potential build files 21 | build/ 22 | bin/ 23 | dist/ 24 | manifest.mf 25 | 26 | # Mac filesystem dust 27 | .DS_Store/ 28 | 29 | # intellij 30 | *.iml 31 | *.ipr 32 | *.iws 33 | .idea/ 34 | 35 | # other files 36 | *.log* 37 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/PacketWrapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import org.bukkit.plugin.java.JavaPlugin; 22 | 23 | public class PacketWrapper extends JavaPlugin { 24 | @Override 25 | public void onEnable() { 26 | // We don't really do much ... 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperLoginClientCustomPayload.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperLoginClientCustomPayload extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Login.Client.CUSTOM_PAYLOAD; 27 | 28 | public WrapperLoginClientCustomPayload() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperLoginClientCustomPayload(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Message ID. 39 | *

40 | * Notes: should match ID from server. 41 | * @return The current Message ID 42 | */ 43 | public int getMessageId() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set Message ID. 49 | * @param value - new value. 50 | */ 51 | public void setMessageId(int value) { 52 | handle.getIntegers().write(0, value); 53 | } 54 | 55 | // Cannot find type for b 56 | // Cannot find type for b 57 | } 58 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperLoginClientEncryptionBegin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperLoginClientEncryptionBegin extends AbstractPacket { 25 | public static final PacketType TYPE = 26 | PacketType.Login.Client.ENCRYPTION_BEGIN; 27 | 28 | public WrapperLoginClientEncryptionBegin() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperLoginClientEncryptionBegin(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Shared Secret. 39 | * 40 | * @return The current Shared Secret 41 | */ 42 | public byte[] getSharedSecret() { 43 | return handle.getByteArrays().read(0); 44 | } 45 | 46 | /** 47 | * Set Shared Secret. 48 | * 49 | * @param value - new value. 50 | */ 51 | public void setSharedSecret(byte[] value) { 52 | handle.getByteArrays().write(0, value); 53 | } 54 | 55 | /** 56 | * Retrieve Verify Token. 57 | * 58 | * @return The current Verify Token 59 | */ 60 | public byte[] getVerifyToken() { 61 | return handle.getByteArrays().read(1); 62 | } 63 | 64 | /** 65 | * Set Verify Token. 66 | * 67 | * @param value - new value. 68 | */ 69 | public void setVerifyToken(byte[] value) { 70 | handle.getByteArrays().write(1, value); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperLoginClientStart.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.WrappedGameProfile; 24 | 25 | public class WrapperLoginClientStart extends AbstractPacket { 26 | public static final PacketType TYPE = PacketType.Login.Client.START; 27 | 28 | public WrapperLoginClientStart() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperLoginClientStart(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Profile. 39 | * 40 | * @return The current Profile 41 | */ 42 | public WrappedGameProfile getProfile() { 43 | return handle.getGameProfiles().read(0); 44 | } 45 | 46 | /** 47 | * Set Name. 48 | * 49 | * @param value - new value. 50 | */ 51 | public void setProfile(WrappedGameProfile value) { 52 | handle.getGameProfiles().write(0, value); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperLoginServerCustomPayload.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperLoginServerCustomPayload extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Login.Server.CUSTOM_PAYLOAD; 27 | 28 | public WrapperLoginServerCustomPayload() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperLoginServerCustomPayload(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Message ID. 39 | *

40 | * Notes: generated by the server - should be unique to the connection. 41 | * @return The current Message ID 42 | */ 43 | public int getMessageId() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set Message ID. 49 | * @param value - new value. 50 | */ 51 | public void setMessageId(int value) { 52 | handle.getIntegers().write(0, value); 53 | } 54 | 55 | // Cannot find type for b 56 | // Cannot find type for b 57 | } 58 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperLoginServerDisconnect.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.WrappedChatComponent; 24 | 25 | public class WrapperLoginServerDisconnect extends AbstractPacket { 26 | public static final PacketType TYPE = PacketType.Login.Server.DISCONNECT; 27 | 28 | public WrapperLoginServerDisconnect() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperLoginServerDisconnect(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve reason. 39 | * 40 | * @return The current reason 41 | */ 42 | public WrappedChatComponent getReason() { 43 | return handle.getChatComponents().read(0); 44 | } 45 | 46 | @Deprecated 47 | public WrappedChatComponent getJsonData() { 48 | return getReason(); 49 | } 50 | 51 | /** 52 | * Set reason. 53 | * 54 | * @param value - new value. 55 | */ 56 | public void setReason(WrappedChatComponent value) { 57 | handle.getChatComponents().write(0, value); 58 | } 59 | 60 | @Deprecated 61 | public void setJsonData(WrappedChatComponent value) { 62 | setReason(value); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperLoginServerEncryptionBegin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import java.security.PublicKey; 22 | 23 | import com.comphenix.protocol.PacketType; 24 | import com.comphenix.protocol.events.PacketContainer; 25 | 26 | public class WrapperLoginServerEncryptionBegin extends AbstractPacket { 27 | public static final PacketType TYPE = 28 | PacketType.Login.Server.ENCRYPTION_BEGIN; 29 | 30 | public WrapperLoginServerEncryptionBegin() { 31 | super(new PacketContainer(TYPE), TYPE); 32 | handle.getModifier().writeDefaults(); 33 | } 34 | 35 | public WrapperLoginServerEncryptionBegin(PacketContainer packet) { 36 | super(packet, TYPE); 37 | } 38 | 39 | /** 40 | * Retrieve Server ID. 41 | *

42 | * Notes: appears to be empty as of 1.7.x 43 | * 44 | * @return The current Server ID 45 | */ 46 | public String getServerId() { 47 | return handle.getStrings().read(0); 48 | } 49 | 50 | /** 51 | * Set Server ID. 52 | * 53 | * @param value - new value. 54 | */ 55 | public void setServerId(String value) { 56 | handle.getStrings().write(0, value); 57 | } 58 | 59 | /** 60 | * Retrieve Public Key. 61 | * 62 | * @return The current Public Key 63 | */ 64 | public PublicKey getPublicKey() { 65 | return handle.getSpecificModifier(PublicKey.class).read(0); 66 | } 67 | 68 | /** 69 | * Set Public Key. 70 | * 71 | * @param value - new value. 72 | */ 73 | public void setPublicKey(PublicKey value) { 74 | handle.getSpecificModifier(PublicKey.class).write(0, value); 75 | } 76 | 77 | /** 78 | * Retrieve Verify Token. 79 | * 80 | * @return The current Verify Token 81 | */ 82 | public byte[] getVerifyToken() { 83 | return handle.getByteArrays().read(0); 84 | } 85 | 86 | /** 87 | * Set Verify Token. 88 | * 89 | * @param value - new value. 90 | */ 91 | public void setVerifyToken(byte[] value) { 92 | handle.getByteArrays().write(0, value); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperLoginServerSetCompression.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperLoginServerSetCompression extends AbstractPacket { 25 | public static final PacketType TYPE = 26 | PacketType.Login.Server.SET_COMPRESSION; 27 | 28 | public WrapperLoginServerSetCompression() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperLoginServerSetCompression(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Threshold. 39 | *

40 | * Notes: threshold is the max size of a packet before its compressed 41 | * 42 | * @return The current Threshold 43 | */ 44 | public int getThreshold() { 45 | return handle.getIntegers().read(0); 46 | } 47 | 48 | /** 49 | * Set Threshold. 50 | * 51 | * @param value - new value. 52 | */ 53 | public void setThreshold(int value) { 54 | handle.getIntegers().write(0, value); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperLoginServerSuccess.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.WrappedGameProfile; 24 | 25 | public class WrapperLoginServerSuccess extends AbstractPacket { 26 | public static final PacketType TYPE = PacketType.Login.Server.SUCCESS; 27 | 28 | public WrapperLoginServerSuccess() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperLoginServerSuccess(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve the UUID and player name of the connected client. 39 | * 40 | * @return The current client profile. 41 | */ 42 | public WrappedGameProfile getProfile() { 43 | return handle.getGameProfiles().read(0); 44 | } 45 | 46 | /** 47 | * Set the UUID and player name of the connected client as a game profile. 48 | * 49 | * @param value - new profile. 50 | */ 51 | public void setProfile(WrappedGameProfile value) { 52 | handle.getGameProfiles().write(0, value); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientAbilities.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientAbilities extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Client.ABILITIES; 26 | 27 | public WrapperPlayClientAbilities() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayClientAbilities(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | public boolean isInvulnerable() { 37 | return handle.getBooleans().read(0); 38 | } 39 | 40 | public void setInvulnerable(boolean value) { 41 | handle.getBooleans().write(0, value); 42 | } 43 | 44 | /**Misspelled. 45 | * @see #isInvulnerable() 46 | */ 47 | @Deprecated 48 | public boolean isInvulnurable() { 49 | return handle.getBooleans().read(0); 50 | } 51 | 52 | /**Misspelled. 53 | * @see #setInvulnerable(boolean) 54 | */ 55 | @Deprecated 56 | public void setInvulnurable(boolean value) { 57 | handle.getBooleans().write(0, value); 58 | } 59 | 60 | public boolean isFlying() { 61 | return handle.getBooleans().read(1); 62 | } 63 | 64 | public void setFlying(boolean value) { 65 | handle.getBooleans().write(1, value); 66 | } 67 | 68 | public boolean canFly() { 69 | return handle.getBooleans().read(2); 70 | } 71 | 72 | public void setCanFly(boolean value) { 73 | handle.getBooleans().write(2, value); 74 | } 75 | 76 | public boolean canInstantlyBuild() { 77 | return handle.getBooleans().read(3); 78 | } 79 | 80 | public void setCanInstantlyBuild(boolean value) { 81 | handle.getBooleans().write(3, value); 82 | } 83 | 84 | public float getFlyingSpeed() { 85 | return handle.getFloat().read(0); 86 | } 87 | 88 | public void setFlyingSpeed(float value) { 89 | handle.getFloat().write(0, value); 90 | } 91 | 92 | public float getWalkingSpeed() { 93 | return handle.getFloat().read(1); 94 | } 95 | 96 | public void setWalkingSpeed(float value) { 97 | handle.getFloat().write(1, value); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientAdvancements.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.MinecraftKey; 24 | 25 | public class WrapperPlayClientAdvancements extends AbstractPacket { 26 | 27 | public static final PacketType TYPE = PacketType.Play.Client.ADVANCEMENTS; 28 | 29 | public WrapperPlayClientAdvancements() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayClientAdvancements(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | /** 39 | * Retrieve Action. 40 | *

41 | * Notes: 0: Opened tab, 1: Closed screen 42 | * @return The current Action 43 | */ 44 | public Status getAction() { 45 | return handle.getEnumModifier(Status.class, 0).readSafely(0); 46 | } 47 | 48 | /** 49 | * Set Action. 50 | * @param value - new value. 51 | */ 52 | public void setAction(Status value) { 53 | handle.getEnumModifier(Status.class, 0).writeSafely(0, value); 54 | } 55 | /** 56 | * Retrieve Tab ID. 57 | *

58 | * Notes: only present if action is Opened tab 59 | * @return The current Tab ID 60 | */ 61 | public MinecraftKey getTabId() { 62 | return handle.getMinecraftKeys().readSafely(0); 63 | } 64 | 65 | /** 66 | * Set Tab ID. 67 | * @param value - new value. 68 | */ 69 | public void setTabId(MinecraftKey value) { 70 | handle.getMinecraftKeys().writeSafely(0, value); 71 | } 72 | 73 | public enum Status { 74 | OPENED_TAB, 75 | CLOSED_SCREEN; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientArmAnimation.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientArmAnimation extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Client.ARM_ANIMATION; 26 | 27 | public WrapperPlayClientArmAnimation() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayClientArmAnimation(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientAutoRecipe.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientAutoRecipe extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Play.Client.AUTO_RECIPE; 27 | 28 | public WrapperPlayClientAutoRecipe() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayClientAutoRecipe(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Window ID. 39 | *

40 | * Notes: the window id. 41 | * @return The current Window ID 42 | */ 43 | public int getWindowId() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set Window ID. 49 | * @param value - new value. 50 | */ 51 | public void setWindowId(int value) { 52 | handle.getIntegers().write(0, value); 53 | } 54 | 55 | // Modifier for recipe can be created upon request 56 | 57 | public boolean isMakeAll() { 58 | return handle.getBooleans().read(0); 59 | } 60 | 61 | public void setMakeAll(boolean value) { 62 | handle.getBooleans().write(0, value); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientBeacon.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientBeacon extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Play.Client.BEACON; 27 | 28 | public WrapperPlayClientBeacon() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayClientBeacon(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Primary Effect. 39 | *

40 | * Notes: a Potion ID. (Was a full Integer for the plugin message) 41 | * @return The current Primary Effect 42 | */ 43 | public int getPrimaryEffect() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set Primary Effect. 49 | * @param value - new value. 50 | */ 51 | public void setPrimaryEffect(int value) { 52 | handle.getIntegers().write(0, value); 53 | } 54 | 55 | /** 56 | * Retrieve Secondary Effect. 57 | *

58 | * Notes: a Potion ID. (Was a full Integer for the plugin message) 59 | * @return The current Secondary Effect 60 | */ 61 | public int getSecondaryEffect() { 62 | return handle.getIntegers().read(1); 63 | } 64 | 65 | /** 66 | * Set Secondary Effect. 67 | * @param value - new value. 68 | */ 69 | public void setSecondaryEffect(int value) { 70 | handle.getIntegers().write(1, value); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientBlockDig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.BlockPosition; 24 | import com.comphenix.protocol.wrappers.EnumWrappers.Direction; 25 | import com.comphenix.protocol.wrappers.EnumWrappers.PlayerDigType; 26 | 27 | public class WrapperPlayClientBlockDig extends AbstractPacket { 28 | public static final PacketType TYPE = PacketType.Play.Client.BLOCK_DIG; 29 | 30 | public WrapperPlayClientBlockDig() { 31 | super(new PacketContainer(TYPE), TYPE); 32 | handle.getModifier().writeDefaults(); 33 | } 34 | 35 | public WrapperPlayClientBlockDig(PacketContainer packet) { 36 | super(packet, TYPE); 37 | } 38 | 39 | /** 40 | * Retrieve Location. 41 | *

42 | * Notes: block position 43 | * 44 | * @return The current Location 45 | */ 46 | public BlockPosition getLocation() { 47 | return handle.getBlockPositionModifier().read(0); 48 | } 49 | 50 | /** 51 | * Set Location. 52 | * 53 | * @param value - new value. 54 | */ 55 | public void setLocation(BlockPosition value) { 56 | handle.getBlockPositionModifier().write(0, value); 57 | } 58 | 59 | public Direction getDirection() { 60 | return handle.getDirections().read(0); 61 | } 62 | 63 | public void setDirection(Direction value) { 64 | handle.getDirections().write(0, value); 65 | } 66 | 67 | /** 68 | * Retrieve Status. 69 | *

70 | * Notes: the action the player is taking against the block (see below) 71 | * 72 | * @return The current Status 73 | */ 74 | public PlayerDigType getStatus() { 75 | return handle.getPlayerDigTypes().read(0); 76 | } 77 | 78 | /** 79 | * Set Status. 80 | * 81 | * @param value - new value. 82 | */ 83 | public void setStatus(PlayerDigType value) { 84 | handle.getPlayerDigTypes().write(0, value); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientBlockPlace.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.EnumWrappers.Hand; 24 | 25 | public class WrapperPlayClientBlockPlace extends AbstractPacket { 26 | public static final PacketType TYPE = PacketType.Play.Client.BLOCK_PLACE; 27 | 28 | public WrapperPlayClientBlockPlace() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayClientBlockPlace(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | public Hand getHand() { 38 | return handle.getHands().read(0); 39 | } 40 | 41 | public void setHand(Hand value) { 42 | handle.getHands().write(0, value); 43 | } 44 | 45 | public long getTimestamp() { 46 | return handle.getLongs().read(0); 47 | } 48 | 49 | public void setTimestamp(long value) { 50 | handle.getLongs().write(0, value); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientBoatMove.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientBoatMove extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Play.Client.BOAT_MOVE; 27 | 28 | public WrapperPlayClientBoatMove() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayClientBoatMove(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | public boolean getLeftOar() { 38 | return handle.getBooleans().read(0); 39 | } 40 | 41 | public void setLeftOar(boolean value) { 42 | handle.getBooleans().write(0, value); 43 | } 44 | 45 | public boolean getRightOar() { 46 | return handle.getBooleans().read(1); 47 | } 48 | 49 | public void setRightOar(boolean value) { 50 | handle.getBooleans().write(1, value); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientBookEdit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | import org.bukkit.inventory.ItemStack; 25 | 26 | public class WrapperPlayClientBookEdit extends AbstractPacket { 27 | 28 | public static final PacketType TYPE = PacketType.Play.Client.B_EDIT; 29 | 30 | public WrapperPlayClientBookEdit() { 31 | super(new PacketContainer(TYPE), TYPE); 32 | handle.getModifier().writeDefaults(); 33 | } 34 | 35 | public WrapperPlayClientBookEdit(PacketContainer packet) { 36 | super(packet, TYPE); 37 | } 38 | 39 | /** 40 | * Retrieve New book. 41 | * @return The current New book 42 | */ 43 | public ItemStack getNewBook() { 44 | return handle.getItemModifier().read(0); 45 | } 46 | 47 | /** 48 | * Set New book. 49 | * @param value - new value. 50 | */ 51 | public void setNewBook(ItemStack value) { 52 | handle.getItemModifier().write(0, value); 53 | } 54 | 55 | /** 56 | * Retrieve Is signing. 57 | *

58 | * Notes: true if the player is signing the book; false if the player is saving a draft. 59 | * @return The current Is signing 60 | */ 61 | public boolean getIsSigning() { 62 | return handle.getBooleans().read(0); 63 | } 64 | 65 | /** 66 | * Set Is signing. 67 | * @param value - new value. 68 | */ 69 | public void setIsSigning(boolean value) { 70 | handle.getBooleans().write(0, value); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientChat.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientChat extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Client.CHAT; 26 | 27 | public WrapperPlayClientChat() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayClientChat(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Message. 38 | * 39 | * @return The current Message 40 | */ 41 | public String getMessage() { 42 | return handle.getStrings().read(0); 43 | } 44 | 45 | /** 46 | * Set Message. 47 | * 48 | * @param value - new value. 49 | */ 50 | public void setMessage(String value) { 51 | handle.getStrings().write(0, value); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientClientCommand.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.EnumWrappers.ClientCommand; 24 | 25 | public class WrapperPlayClientClientCommand extends AbstractPacket { 26 | public static final PacketType TYPE = PacketType.Play.Client.CLIENT_COMMAND; 27 | 28 | public WrapperPlayClientClientCommand() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayClientClientCommand(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Action ID. 39 | *

40 | * Notes: see below 41 | * 42 | * @return The current Action ID 43 | */ 44 | public ClientCommand getAction() { 45 | return handle.getClientCommands().read(0); 46 | } 47 | 48 | /** 49 | * Set Action ID. 50 | * 51 | * @param value - new value. 52 | */ 53 | public void setAction(ClientCommand value) { 54 | handle.getClientCommands().write(0, value); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientCloseWindow.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientCloseWindow extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Client.CLOSE_WINDOW; 26 | 27 | public WrapperPlayClientCloseWindow() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayClientCloseWindow(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Window id. 38 | *

39 | * Notes: this is the id of the window that was closed. 0 for inventory. 40 | * 41 | * @return The current Window id 42 | */ 43 | public int getWindowId() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set Window id. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setWindowId(int value) { 53 | handle.getIntegers().write(0, value); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientDifficultyChange.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.EnumWrappers.Difficulty; 24 | 25 | public class WrapperPlayClientDifficultyChange extends AbstractPacket { 26 | 27 | public static final PacketType TYPE = PacketType.Play.Client.DIFFICULTY_CHANGE; 28 | 29 | public WrapperPlayClientDifficultyChange() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayClientDifficultyChange(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | /** 39 | * Retrieve New difficulty. 40 | *

41 | * Notes: 0: peaceful, 1: easy, 2: normal, 3: hard 42 | * @return The current New difficulty 43 | */ 44 | public Difficulty getNewDifficulty() { 45 | return handle.getDifficulties().read(0); 46 | } 47 | 48 | /** 49 | * Set New difficulty. 50 | * @param value - new value. 51 | */ 52 | public void setNewDifficulty(Difficulty value) { 53 | handle.getDifficulties().write(0, value); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientDifficultyLock.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientDifficultyLock extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Play.Client.DIFFICULTY_LOCK; 27 | 28 | public WrapperPlayClientDifficultyLock() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayClientDifficultyLock(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Locked. 39 | * @return The current Locked 40 | */ 41 | public boolean getLocked() { 42 | return handle.getBooleans().read(0); 43 | } 44 | 45 | /** 46 | * Set Locked. 47 | * @param value - new value. 48 | */ 49 | public void setLocked(boolean value) { 50 | handle.getBooleans().write(0, value); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientEnchantItem.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientEnchantItem extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Client.ENCHANT_ITEM; 26 | 27 | public WrapperPlayClientEnchantItem() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayClientEnchantItem(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Window ID. 38 | *

39 | * Notes: the ID sent by Open Window 40 | * 41 | * @return The current Window ID 42 | */ 43 | public int getWindowId() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set Window ID. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setWindowId(byte value) { 53 | handle.getIntegers().write(0, (int) value); 54 | } 55 | 56 | /** 57 | * Retrieve Enchantment. 58 | *

59 | * Notes: the position of the enchantment on the enchantment table window, 60 | * starting with 0 as the topmost one. 61 | * 62 | * @return The current Enchantment 63 | */ 64 | public int getEnchantment() { 65 | return handle.getIntegers().read(1); 66 | } 67 | 68 | /** 69 | * Set Enchantment. 70 | * 71 | * @param value - new value. 72 | */ 73 | public void setEnchantment(int value) { 74 | handle.getIntegers().write(1, value); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientEntityNbtQuery.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.events.PacketEvent; 24 | 25 | import org.bukkit.World; 26 | import org.bukkit.entity.Entity; 27 | 28 | public class WrapperPlayClientEntityNbtQuery extends AbstractPacket { 29 | 30 | public static final PacketType TYPE = PacketType.Play.Client.ENTITY_NBT_QUERY; 31 | 32 | public WrapperPlayClientEntityNbtQuery() { 33 | super(new PacketContainer(TYPE), TYPE); 34 | handle.getModifier().writeDefaults(); 35 | } 36 | 37 | public WrapperPlayClientEntityNbtQuery(PacketContainer packet) { 38 | super(packet, TYPE); 39 | } 40 | 41 | /** 42 | * Retrieve Transaction ID. 43 | *

44 | * Notes: an incremental ID so that the client can verify that the response matches. 45 | * @return The current Transaction ID 46 | */ 47 | public int getTransactionId() { 48 | return handle.getIntegers().read(0); 49 | } 50 | 51 | /** 52 | * Set Transaction ID. 53 | * @param value - new value. 54 | */ 55 | public void setTransactionId(int value) { 56 | handle.getIntegers().write(0, value); 57 | } 58 | 59 | /** 60 | * Retrieve Entity ID. 61 | *

62 | * Notes: the ID of the entity to query. 63 | * @return The current Entity ID 64 | */ 65 | public int getEntityID() { 66 | return handle.getIntegers().read(1); 67 | } 68 | 69 | /** 70 | * Retrieve the entity involved in this event. 71 | * @param world - the current world of the entity. 72 | * @return The involved entity. 73 | */ 74 | public Entity getEntity(World world) { 75 | return handle.getEntityModifier(world).read(1); 76 | } 77 | 78 | /** 79 | * Retrieve the entity involved in this event. 80 | * @param event - the packet event. 81 | * @return The involved entity. 82 | */ 83 | public Entity getEntity(PacketEvent event) { 84 | return getEntity(event.getPlayer().getWorld()); 85 | } 86 | 87 | /** 88 | * Set Entity ID. 89 | * @param value - new value. 90 | */ 91 | public void setEntityID(int value) { 92 | handle.getIntegers().write(1, value); 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientFlying.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientFlying extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Client.FLYING; 26 | 27 | public WrapperPlayClientFlying() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayClientFlying(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve On Ground. 38 | *

39 | * Notes: true if the client is on the ground, False otherwise 40 | * 41 | * @return The current On Ground 42 | */ 43 | public boolean getOnGround() { 44 | return handle.getBooleans().read(0); 45 | } 46 | 47 | /** 48 | * Set On Ground. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setOnGround(boolean value) { 53 | handle.getBooleans().write(0, value); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientHeldItemSlot.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientHeldItemSlot extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Client.HELD_ITEM_SLOT; 26 | 27 | public WrapperPlayClientHeldItemSlot() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayClientHeldItemSlot(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Slot. 38 | *

39 | * Notes: the slot which the player has selected (0-8) 40 | * 41 | * @return The current Slot 42 | */ 43 | public int getSlot() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set Slot. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setSlot(int value) { 53 | handle.getIntegers().write(0, value); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientItemName.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientItemName extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Play.Client.ITEM_NAME; 27 | 28 | public WrapperPlayClientItemName() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayClientItemName(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Item name. 39 | *

40 | * Notes: the new name of the item 41 | * @return The current Item name 42 | */ 43 | public String getItemName() { 44 | return handle.getStrings().read(0); 45 | } 46 | 47 | /** 48 | * Set Item name. 49 | * @param value - new value. 50 | */ 51 | public void setItemName(String value) { 52 | handle.getStrings().write(0, value); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientKeepAlive.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientKeepAlive extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Client.KEEP_ALIVE; 26 | 27 | public WrapperPlayClientKeepAlive() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayClientKeepAlive(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Keep Alive ID. 38 | * 39 | * @return The current Keep Alive ID 40 | */ 41 | public long getKeepAliveId() { 42 | return handle.getLongs().read(0); 43 | } 44 | 45 | /** 46 | * Set Keep Alive ID. 47 | * 48 | * @param value - new value. 49 | */ 50 | public void setKeepAliveId(long value) { 51 | handle.getLongs().write(0, value); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientLook.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientLook extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Client.LOOK; 26 | 27 | public WrapperPlayClientLook() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayClientLook(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Yaw. 38 | *

39 | * Notes: absolute rotation on the X Axis, in degrees 40 | * 41 | * @return The current Yaw 42 | */ 43 | public float getYaw() { 44 | return handle.getFloat().read(0); 45 | } 46 | 47 | /** 48 | * Set Yaw. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setYaw(float value) { 53 | handle.getFloat().write(0, value); 54 | } 55 | 56 | /** 57 | * Retrieve Pitch. 58 | *

59 | * Notes: absolute rotation on the Y Axis, in degrees 60 | * 61 | * @return The current Pitch 62 | */ 63 | public float getPitch() { 64 | return handle.getFloat().read(1); 65 | } 66 | 67 | /** 68 | * Set Pitch. 69 | * 70 | * @param value - new value. 71 | */ 72 | public void setPitch(float value) { 73 | handle.getFloat().write(1, value); 74 | } 75 | 76 | /** 77 | * Retrieve On Ground. 78 | *

79 | * Notes: true if the client is on the ground, False otherwise 80 | * 81 | * @return The current On Ground 82 | */ 83 | public boolean getOnGround() { 84 | return handle.getBooleans().read(0); 85 | } 86 | 87 | /** 88 | * Set On Ground. 89 | * 90 | * @param value - new value. 91 | */ 92 | public void setOnGround(boolean value) { 93 | handle.getBooleans().write(0, value); 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientPickItem.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientPickItem extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Play.Client.PICK_ITEM; 27 | 28 | public WrapperPlayClientPickItem() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayClientPickItem(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Slot to use. 39 | *

40 | * Notes: see Inventory 41 | * @return The current Slot to use 42 | */ 43 | public int getSlotToUse() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set Slot to use. 49 | * @param value - new value. 50 | */ 51 | public void setSlotToUse(int value) { 52 | handle.getIntegers().write(0, value); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientRecipeDisplayed.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientRecipeDisplayed extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Client.RECIPE_DISPLAYED; 26 | 27 | public WrapperPlayClientRecipeDisplayed() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayClientRecipeDisplayed(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | public Status getStatus() { 37 | return handle.getEnumModifier(Status.class, 0).readSafely(0); 38 | } 39 | 40 | public void setStatus(Status value) { 41 | handle.getEnumModifier(Status.class, 0).writeSafely(0, value); 42 | } 43 | 44 | // Modifier for recipe can be created upon request 45 | 46 | public boolean isBookOpen() { 47 | return handle.getBooleans().read(0); 48 | } 49 | 50 | public void setBookOpen(boolean value) { 51 | handle.getBooleans().write(0, value); 52 | } 53 | 54 | public boolean isFilterActive() { 55 | return handle.getBooleans().read(1); 56 | } 57 | 58 | public void setFilterActive(boolean value) { 59 | handle.getBooleans().write(1, value); 60 | } 61 | 62 | public enum Status { 63 | SHOWN, 64 | SETTINGS; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientResourcePackStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.EnumWrappers.ResourcePackStatus; 24 | 25 | public class WrapperPlayClientResourcePackStatus extends AbstractPacket { 26 | public static final PacketType TYPE = 27 | PacketType.Play.Client.RESOURCE_PACK_STATUS; 28 | 29 | public WrapperPlayClientResourcePackStatus() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayClientResourcePackStatus(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | /** 39 | * Retrieve Result. 40 | *

41 | * Notes: successfully loaded: 0, Declined: 1, Failed download: 2, Accepted: 42 | * 3 43 | * 44 | * @return The current Result 45 | */ 46 | public ResourcePackStatus getResult() { 47 | return handle.getResourcePackStatus().read(0); 48 | } 49 | 50 | /** 51 | * Set Result. 52 | * 53 | * @param value - new value. 54 | */ 55 | public void setResult(ResourcePackStatus value) { 56 | handle.getResourcePackStatus().write(0, value); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientSetCreativeSlot.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import org.bukkit.inventory.ItemStack; 22 | 23 | import com.comphenix.protocol.PacketType; 24 | import com.comphenix.protocol.events.PacketContainer; 25 | 26 | public class WrapperPlayClientSetCreativeSlot extends AbstractPacket { 27 | public static final PacketType TYPE = 28 | PacketType.Play.Client.SET_CREATIVE_SLOT; 29 | 30 | public WrapperPlayClientSetCreativeSlot() { 31 | super(new PacketContainer(TYPE), TYPE); 32 | handle.getModifier().writeDefaults(); 33 | } 34 | 35 | public WrapperPlayClientSetCreativeSlot(PacketContainer packet) { 36 | super(packet, TYPE); 37 | } 38 | 39 | /** 40 | * Retrieve Slot. 41 | *

42 | * Notes: inventory slot 43 | * 44 | * @return The current Slot 45 | */ 46 | public int getSlot() { 47 | return handle.getIntegers().read(0); 48 | } 49 | 50 | /** 51 | * Set Slot. 52 | * 53 | * @param value - new value. 54 | */ 55 | public void setSlot(int value) { 56 | handle.getIntegers().write(0, value); 57 | } 58 | 59 | /** 60 | * Retrieve Clicked item. 61 | * 62 | * @return The current Clicked item 63 | */ 64 | public ItemStack getClickedItem() { 65 | return handle.getItemModifier().read(0); 66 | } 67 | 68 | /** 69 | * Set Clicked item. 70 | * 71 | * @param value - new value. 72 | */ 73 | public void setClickedItem(ItemStack value) { 74 | handle.getItemModifier().write(0, value); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientSpectate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import java.util.UUID; 22 | 23 | import com.comphenix.protocol.PacketType; 24 | import com.comphenix.protocol.events.PacketContainer; 25 | 26 | public class WrapperPlayClientSpectate extends AbstractPacket { 27 | public static final PacketType TYPE = PacketType.Play.Client.SPECTATE; 28 | 29 | public WrapperPlayClientSpectate() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayClientSpectate(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | /** 39 | * Retrieve Target Player. 40 | * 41 | * @return The current Target Player 42 | */ 43 | public UUID getTargetPlayer() { 44 | return handle.getUUIDs().read(0); 45 | } 46 | 47 | /** 48 | * Set Target Player. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setTargetPlayer(UUID value) { 53 | handle.getUUIDs().write(0, value); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientSteerVehicle.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientSteerVehicle extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Client.STEER_VEHICLE; 26 | 27 | public WrapperPlayClientSteerVehicle() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayClientSteerVehicle(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Sideways. 38 | *

39 | * Notes: positive to the left of the player 40 | * 41 | * @return The current Sideways 42 | */ 43 | public float getSideways() { 44 | return handle.getFloat().read(0); 45 | } 46 | 47 | /** 48 | * Set Sideways. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setSideways(float value) { 53 | handle.getFloat().write(0, value); 54 | } 55 | 56 | /** 57 | * Retrieve Forward. 58 | *

59 | * Notes: positive forward 60 | * 61 | * @return The current Forward 62 | */ 63 | public float getForward() { 64 | return handle.getFloat().read(1); 65 | } 66 | 67 | /** 68 | * Set Forward. 69 | * 70 | * @param value - new value. 71 | */ 72 | public void setForward(float value) { 73 | handle.getFloat().write(1, value); 74 | } 75 | 76 | public boolean isJump() { 77 | return handle.getBooleans().read(0); 78 | } 79 | 80 | public void setJump(boolean value) { 81 | handle.getBooleans().write(0, value); 82 | } 83 | 84 | public boolean isUnmount() { 85 | return handle.getBooleans().read(1); 86 | } 87 | 88 | public void setUnmount(boolean value) { 89 | handle.getBooleans().write(1, value); 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientStructureBlock.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.BlockPosition; 24 | 25 | public class WrapperPlayClientStructureBlock extends AbstractPacket { 26 | 27 | public static final PacketType TYPE = PacketType.Play.Client.STRUCT; 28 | 29 | public WrapperPlayClientStructureBlock() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayClientStructureBlock(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | // TODO manually upon request 39 | } 40 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientTabComplete.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.BlockPosition; 24 | import com.mojang.brigadier.suggestion.Suggestions; 25 | 26 | public class WrapperPlayClientTabComplete extends AbstractPacket { 27 | public static final PacketType TYPE = PacketType.Play.Client.TAB_COMPLETE; 28 | 29 | public WrapperPlayClientTabComplete() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayClientTabComplete(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | public int getTransactionId() { 39 | return handle.getIntegers().read(0); 40 | } 41 | 42 | public void setTransactionId(int value) { 43 | handle.getIntegers().write(0, value); 44 | } 45 | 46 | public String getInput() { 47 | return handle.getStrings().read(0); 48 | } 49 | 50 | public void setInput(String value) { 51 | handle.getStrings().write(0, value); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientTeleportAccept.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientTeleportAccept extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = 27 | PacketType.Play.Client.TELEPORT_ACCEPT; 28 | 29 | public WrapperPlayClientTeleportAccept() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayClientTeleportAccept(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | /** 39 | * Retrieve Teleport ID. 40 | *

41 | * Notes: the ID given by the Player Position And Look packet 42 | * 43 | * @return The current Teleport ID 44 | */ 45 | public int getTeleportId() { 46 | return handle.getIntegers().read(0); 47 | } 48 | 49 | /** 50 | * Set Teleport ID. 51 | * 52 | * @param value - new value. 53 | */ 54 | public void setTeleportId(int value) { 55 | handle.getIntegers().write(0, value); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientTileNbtQuery.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.BlockPosition; 24 | 25 | public class WrapperPlayClientTileNbtQuery extends AbstractPacket { 26 | 27 | public static final PacketType TYPE = PacketType.Play.Client.TILE_NBT_QUERY; 28 | 29 | public WrapperPlayClientTileNbtQuery() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayClientTileNbtQuery(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | /** 39 | * Retrieve Transaction ID. 40 | *

41 | * Notes: an incremental ID so that the client can verify that the response matches. 42 | * @return The current Transaction ID 43 | */ 44 | public int getTransactionId() { 45 | return handle.getIntegers().read(0); 46 | } 47 | 48 | /** 49 | * Set Transaction ID. 50 | * @param value - new value. 51 | */ 52 | public void setTransactionId(int value) { 53 | handle.getIntegers().write(0, value); 54 | } 55 | 56 | /** 57 | * Retrieve Location. 58 | *

59 | * Notes: the location of the block to check. 60 | * @return The current Location 61 | */ 62 | public BlockPosition getLocation() { 63 | return handle.getBlockPositionModifier().read(0); 64 | } 65 | 66 | /** 67 | * Set Location. 68 | * @param value - new value. 69 | */ 70 | public void setLocation(BlockPosition value) { 71 | handle.getBlockPositionModifier().write(0, value); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientTradeSelect.java: -------------------------------------------------------------------------------- 1 | package com.comphenix.packetwrapper; 2 | 3 | import com.comphenix.protocol.PacketType; 4 | import com.comphenix.protocol.events.PacketContainer; 5 | 6 | public class WrapperPlayClientTradeSelect extends AbstractPacket { 7 | public static final PacketType TYPE = PacketType.Play.Client.TR_SEL; 8 | 9 | public WrapperPlayClientTradeSelect() { 10 | super(new PacketContainer(TYPE), TYPE); 11 | handle.getModifier().writeDefaults(); 12 | } 13 | 14 | public int getSlot() { 15 | return handle.getIntegers().read(0); 16 | } 17 | 18 | public void setSlot(int value) { 19 | handle.getIntegers().write(0, value); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientTransaction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayClientTransaction extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Client.TRANSACTION; 26 | 27 | public WrapperPlayClientTransaction() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayClientTransaction(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Window ID. 38 | *

39 | * Notes: the id of the window that the action occurred in. 40 | * 41 | * @return The current Window ID 42 | */ 43 | public int getWindowId() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set Window ID. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setWindowId(byte value) { 53 | handle.getIntegers().write(0, (int) value); 54 | } 55 | 56 | /** 57 | * Retrieve Action number. 58 | *

59 | * Notes: every action that is to be accepted has a unique number. This 60 | * field corresponds to that number. 61 | * 62 | * @return The current Action number 63 | */ 64 | public short getActionNumber() { 65 | return handle.getShorts().read(0); 66 | } 67 | 68 | /** 69 | * Set Action number. 70 | * 71 | * @param value - new value. 72 | */ 73 | public void setActionNumber(short value) { 74 | handle.getShorts().write(0, value); 75 | } 76 | 77 | /** 78 | * Retrieve Accepted. 79 | *

80 | * Notes: whether the action was accepted. 81 | * 82 | * @return The current Accepted 83 | */ 84 | public boolean getAccepted() { 85 | return handle.getBooleans().read(0); 86 | } 87 | 88 | /** 89 | * Set Accepted. 90 | * 91 | * @param value - new value. 92 | */ 93 | public void setAccepted(boolean value) { 94 | handle.getBooleans().write(0, value); 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientUpdateSign.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.BlockPosition; 24 | 25 | public class WrapperPlayClientUpdateSign extends AbstractPacket { 26 | public static final PacketType TYPE = PacketType.Play.Client.UPDATE_SIGN; 27 | 28 | public WrapperPlayClientUpdateSign() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayClientUpdateSign(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Location. 39 | *

40 | * Notes: block Coordinates 41 | * 42 | * @return The current Location 43 | */ 44 | public BlockPosition getLocation() { 45 | return handle.getBlockPositionModifier().read(0); 46 | } 47 | 48 | /** 49 | * Set Location. 50 | * 51 | * @param value - new value. 52 | */ 53 | public void setLocation(BlockPosition value) { 54 | handle.getBlockPositionModifier().write(0, value); 55 | } 56 | 57 | /** 58 | * Retrieve this sign's lines of text. 59 | * 60 | * @return The current lines 61 | */ 62 | public String[] getLines() { 63 | return handle.getStringArrays().read(0); 64 | } 65 | 66 | /** 67 | * Set this sign's lines of text. 68 | * 69 | * @param value - Lines, must be 4 elements long 70 | */ 71 | public void setLines(String[] value) { 72 | if (value == null) 73 | throw new IllegalArgumentException("value cannot be null!"); 74 | if (value.length != 4) 75 | throw new IllegalArgumentException("value must have 4 elements!"); 76 | 77 | handle.getStringArrays().write(0, value); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerAbilities.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerAbilities extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Server.ABILITIES; 26 | 27 | public WrapperPlayServerAbilities() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayServerAbilities(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | public boolean isInvulnerable() { 37 | return handle.getBooleans().read(0); 38 | } 39 | 40 | public void setInvulnerable(boolean value) { 41 | handle.getBooleans().write(0, value); 42 | } 43 | 44 | /**Misspelled. 45 | * @see #isInvulnerable() 46 | */ 47 | @Deprecated 48 | public boolean isInvulnurable() { 49 | return handle.getBooleans().read(0); 50 | } 51 | 52 | /**Misspelled. 53 | * @see #setInvulnerable(boolean) 54 | */ 55 | @Deprecated 56 | public void setInvulnurable(boolean value) { 57 | handle.getBooleans().write(0, value); 58 | } 59 | 60 | public boolean isFlying() { 61 | return handle.getBooleans().read(1); 62 | } 63 | 64 | public void setFlying(boolean value) { 65 | handle.getBooleans().write(1, value); 66 | } 67 | 68 | public boolean canFly() { 69 | return handle.getBooleans().read(2); 70 | } 71 | 72 | public void setCanFly(boolean value) { 73 | handle.getBooleans().write(2, value); 74 | } 75 | 76 | public boolean canInstantlyBuild() { 77 | return handle.getBooleans().read(3); 78 | } 79 | 80 | public void setCanInstantlyBuild(boolean value) { 81 | handle.getBooleans().write(3, value); 82 | } 83 | 84 | public float getFlyingSpeed() { 85 | return handle.getFloat().read(0); 86 | } 87 | 88 | public void setFlyingSpeed(float value) { 89 | handle.getFloat().write(0, value); 90 | } 91 | 92 | public float getWalkingSpeed() { 93 | return handle.getFloat().read(1); 94 | } 95 | 96 | public void setWalkingSpeed(float value) { 97 | handle.getFloat().write(1, value); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerAnimation.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import org.bukkit.World; 22 | import org.bukkit.entity.Entity; 23 | 24 | import com.comphenix.protocol.PacketType; 25 | import com.comphenix.protocol.events.PacketContainer; 26 | import com.comphenix.protocol.events.PacketEvent; 27 | 28 | public class WrapperPlayServerAnimation extends AbstractPacket { 29 | public static final PacketType TYPE = PacketType.Play.Server.ANIMATION; 30 | 31 | public WrapperPlayServerAnimation() { 32 | super(new PacketContainer(TYPE), TYPE); 33 | handle.getModifier().writeDefaults(); 34 | } 35 | 36 | public WrapperPlayServerAnimation(PacketContainer packet) { 37 | super(packet, TYPE); 38 | } 39 | 40 | /** 41 | * Retrieve Entity ID. 42 | *

43 | * Notes: entity's ID 44 | * 45 | * @return The current Entity ID 46 | */ 47 | public int getEntityID() { 48 | return handle.getIntegers().read(0); 49 | } 50 | 51 | /** 52 | * Set Entity ID. 53 | * 54 | * @param value - new value. 55 | */ 56 | public void setEntityID(int value) { 57 | handle.getIntegers().write(0, value); 58 | } 59 | 60 | /** 61 | * Retrieve the entity of the painting that will be spawned. 62 | * 63 | * @param world - the current world of the entity. 64 | * @return The spawned entity. 65 | */ 66 | public Entity getEntity(World world) { 67 | return handle.getEntityModifier(world).read(0); 68 | } 69 | 70 | /** 71 | * Retrieve the entity of the painting that will be spawned. 72 | * 73 | * @param event - the packet event. 74 | * @return The spawned entity. 75 | */ 76 | public Entity getEntity(PacketEvent event) { 77 | return getEntity(event.getPlayer().getWorld()); 78 | } 79 | 80 | /** 81 | * Retrieve Animation. 82 | *

83 | * Notes: animation ID 84 | * 85 | * @return The current Animation 86 | */ 87 | public int getAnimation() { 88 | return handle.getIntegers().read(1); 89 | } 90 | 91 | /** 92 | * Set Animation. 93 | * 94 | * @param value - new value. 95 | */ 96 | public void setAnimation(int value) { 97 | handle.getIntegers().write(1, value); 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerAttachEntity.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import org.bukkit.World; 22 | import org.bukkit.entity.Entity; 23 | 24 | import com.comphenix.protocol.PacketType; 25 | import com.comphenix.protocol.events.PacketContainer; 26 | import com.comphenix.protocol.events.PacketEvent; 27 | 28 | public class WrapperPlayServerAttachEntity extends AbstractPacket { 29 | public static final PacketType TYPE = PacketType.Play.Server.ATTACH_ENTITY; 30 | 31 | public WrapperPlayServerAttachEntity() { 32 | super(new PacketContainer(TYPE), TYPE); 33 | handle.getModifier().writeDefaults(); 34 | } 35 | 36 | public WrapperPlayServerAttachEntity(PacketContainer packet) { 37 | super(packet, TYPE); 38 | } 39 | 40 | /** 41 | * Retrieve Entity ID. 42 | *

43 | * Notes: entity's ID 44 | * 45 | * @return The current Entity ID 46 | */ 47 | public int getEntityID() { 48 | return handle.getIntegers().read(0); 49 | } 50 | 51 | /** 52 | * Set Entity ID. 53 | * 54 | * @param value - new value. 55 | */ 56 | public void setEntityID(int value) { 57 | handle.getIntegers().write(0, value); 58 | } 59 | 60 | /** 61 | * Retrieve the entity of the painting that will be spawned. 62 | * 63 | * @param world - the current world of the entity. 64 | * @return The spawned entity. 65 | */ 66 | public Entity getEntity(World world) { 67 | return handle.getEntityModifier(world).read(0); 68 | } 69 | 70 | /** 71 | * Retrieve the entity of the painting that will be spawned. 72 | * 73 | * @param event - the packet event. 74 | * @return The spawned entity. 75 | */ 76 | public Entity getEntity(PacketEvent event) { 77 | return getEntity(event.getPlayer().getWorld()); 78 | } 79 | 80 | /** 81 | * Retrieve Vehicle ID. 82 | *

83 | * Notes: vehicle's Entity ID 84 | * 85 | * @return The current Vehicle ID 86 | */ 87 | public int getVehicleId() { 88 | return handle.getIntegers().read(1); 89 | } 90 | 91 | /** 92 | * Set Vehicle ID. 93 | * 94 | * @param value - new value. 95 | */ 96 | public void setVehicleId(int value) { 97 | handle.getIntegers().write(1, value); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerAutoRecipe.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerAutoRecipe extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Play.Server.AUTO_RECIPE; 27 | 28 | public WrapperPlayServerAutoRecipe() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayServerAutoRecipe(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Window ID. 39 | * @return The current Window ID 40 | */ 41 | public int getWindowId() { 42 | return handle.getIntegers().read(0); 43 | } 44 | 45 | /** 46 | * Set Window ID. 47 | * @param value - new value. 48 | */ 49 | public void setWindowId(int value) { 50 | handle.getIntegers().write(0, value); 51 | } 52 | 53 | // Wrapper for recipe can be created upon request 54 | } 55 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerBlockChange.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import org.bukkit.Location; 22 | import org.bukkit.World; 23 | 24 | import com.comphenix.protocol.PacketType; 25 | import com.comphenix.protocol.events.PacketContainer; 26 | import com.comphenix.protocol.wrappers.BlockPosition; 27 | import com.comphenix.protocol.wrappers.WrappedBlockData; 28 | 29 | public class WrapperPlayServerBlockChange extends AbstractPacket { 30 | public static final PacketType TYPE = PacketType.Play.Server.BLOCK_CHANGE; 31 | 32 | public WrapperPlayServerBlockChange() { 33 | super(new PacketContainer(TYPE), TYPE); 34 | handle.getModifier().writeDefaults(); 35 | } 36 | 37 | public WrapperPlayServerBlockChange(PacketContainer packet) { 38 | super(packet, TYPE); 39 | } 40 | 41 | /** 42 | * Retrieve Location. 43 | *

44 | * Notes: block Coordinates 45 | * 46 | * @return The current Location 47 | */ 48 | public BlockPosition getLocation() { 49 | return handle.getBlockPositionModifier().read(0); 50 | } 51 | 52 | /** 53 | * Set Location. 54 | * 55 | * @param value - new value. 56 | */ 57 | public void setLocation(BlockPosition value) { 58 | handle.getBlockPositionModifier().write(0, value); 59 | } 60 | 61 | /** 62 | * Retrieve the Bukkit Location. 63 | * 64 | * @param world World for the location 65 | * @return Bukkit Location 66 | */ 67 | public Location getBukkitLocation(World world) { 68 | return getLocation().toVector().toLocation(world); 69 | } 70 | 71 | /** 72 | * Retrieve Block Data. 73 | * 74 | * @return The current Block Data 75 | */ 76 | public WrappedBlockData getBlockData() { 77 | return handle.getBlockData().read(0); 78 | } 79 | 80 | /** 81 | * Set Block Data. 82 | * 83 | * @param value - new value. 84 | */ 85 | public void setBlockData(WrappedBlockData value) { 86 | handle.getBlockData().write(0, value); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerCamera.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerCamera extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Server.CAMERA; 26 | 27 | public WrapperPlayServerCamera() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayServerCamera(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Camera ID. 38 | * 39 | * @return The current Camera ID 40 | */ 41 | public int getCameraId() { 42 | return handle.getIntegers().read(0); 43 | } 44 | 45 | /** 46 | * Set Camera ID. 47 | * 48 | * @param value - new value. 49 | */ 50 | public void setCameraId(int value) { 51 | handle.getIntegers().write(0, value); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerCloseWindow.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerCloseWindow extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Server.CLOSE_WINDOW; 26 | 27 | public WrapperPlayServerCloseWindow() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayServerCloseWindow(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Window ID. 38 | *

39 | * Notes: this is the id of the window that was closed. 0 for inventory. 40 | * 41 | * @return The current Window ID 42 | */ 43 | public int getWindowId() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set Window ID. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setWindowId(int value) { 53 | handle.getIntegers().write(0, value); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerCollect.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerCollect extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Server.COLLECT; 26 | 27 | public WrapperPlayServerCollect() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayServerCollect(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Collected Entity ID. 38 | * 39 | * @return The current Collected Entity ID 40 | */ 41 | public int getCollectedEntityId() { 42 | return handle.getIntegers().read(0); 43 | } 44 | 45 | /** 46 | * Set Collected Entity ID. 47 | * 48 | * @param value - new value. 49 | */ 50 | public void setCollectedEntityId(int value) { 51 | handle.getIntegers().write(0, value); 52 | } 53 | 54 | /** 55 | * Retrieve Collector Entity ID. 56 | * 57 | * @return The current Collector Entity ID 58 | */ 59 | public int getCollectorEntityId() { 60 | return handle.getIntegers().read(1); 61 | } 62 | 63 | /** 64 | * Set Collector Entity ID. 65 | * 66 | * @param value - new value. 67 | */ 68 | public void setCollectorEntityId(int value) { 69 | handle.getIntegers().write(1, value); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerCommands.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.mojang.brigadier.tree.RootCommandNode; 24 | 25 | public class WrapperPlayServerCommands extends AbstractPacket { 26 | 27 | public static final PacketType TYPE = PacketType.Play.Server.COMMANDS; 28 | 29 | public WrapperPlayServerCommands() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayServerCommands(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | /** 39 | * Mojang's brigadier library isn't versioned inside craftbukkit, 40 | * so it should be safe to use here. 41 | */ 42 | public RootCommandNode getRoot() { 43 | return (RootCommandNode) handle.getModifier().read(0); 44 | } 45 | 46 | public void setRoot(RootCommandNode node) { 47 | handle.getModifier().write(0, node); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerEntity.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import org.bukkit.World; 22 | import org.bukkit.entity.Entity; 23 | 24 | import com.comphenix.protocol.PacketType; 25 | import com.comphenix.protocol.events.PacketContainer; 26 | import com.comphenix.protocol.events.PacketEvent; 27 | 28 | public class WrapperPlayServerEntity extends AbstractPacket { 29 | public static final PacketType TYPE = PacketType.Play.Server.ENTITY; 30 | 31 | public WrapperPlayServerEntity() { 32 | super(new PacketContainer(TYPE), TYPE); 33 | handle.getModifier().writeDefaults(); 34 | } 35 | 36 | public WrapperPlayServerEntity(PacketContainer packet) { 37 | super(packet, TYPE); 38 | } 39 | 40 | /** 41 | * Retrieve Entity ID. 42 | *

43 | * Notes: entity's ID 44 | * 45 | * @return The current Entity ID 46 | */ 47 | public int getEntityID() { 48 | return handle.getIntegers().read(0); 49 | } 50 | 51 | /** 52 | * Set Entity ID. 53 | * 54 | * @param value - new value. 55 | */ 56 | public void setEntityID(int value) { 57 | handle.getIntegers().write(0, value); 58 | } 59 | 60 | /** 61 | * Retrieve the entity of the painting that will be spawned. 62 | * 63 | * @param world - the current world of the entity. 64 | * @return The spawned entity. 65 | */ 66 | public Entity getEntity(World world) { 67 | return handle.getEntityModifier(world).read(0); 68 | } 69 | 70 | /** 71 | * Retrieve the entity of the painting that will be spawned. 72 | * 73 | * @param event - the packet event. 74 | * @return The spawned entity. 75 | */ 76 | public Entity getEntity(PacketEvent event) { 77 | return getEntity(event.getPlayer().getWorld()); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerEntityDestroy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerEntityDestroy extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Server.ENTITY_DESTROY; 26 | 27 | public WrapperPlayServerEntityDestroy() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayServerEntityDestroy(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Count. 38 | *

39 | * Notes: length of following array 40 | * 41 | * @return The current Count 42 | */ 43 | public int getCount() { 44 | return handle.getIntegerArrays().read(0).length; 45 | } 46 | 47 | /** 48 | * Retrieve Entity IDs. 49 | *

50 | * Notes: the list of entities of destroy 51 | * 52 | * @return The current Entity IDs 53 | */ 54 | public int[] getEntityIDs() { 55 | return handle.getIntegerArrays().read(0); 56 | } 57 | 58 | /** 59 | * Set Entity IDs. 60 | * 61 | * @param value - new value. 62 | */ 63 | public void setEntityIds(int[] value) { 64 | handle.getIntegerArrays().write(0, value); 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerEntityHeadRotation.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import org.bukkit.World; 22 | import org.bukkit.entity.Entity; 23 | 24 | import com.comphenix.protocol.PacketType; 25 | import com.comphenix.protocol.events.PacketContainer; 26 | import com.comphenix.protocol.events.PacketEvent; 27 | 28 | public class WrapperPlayServerEntityHeadRotation extends AbstractPacket { 29 | public static final PacketType TYPE = 30 | PacketType.Play.Server.ENTITY_HEAD_ROTATION; 31 | 32 | public WrapperPlayServerEntityHeadRotation() { 33 | super(new PacketContainer(TYPE), TYPE); 34 | handle.getModifier().writeDefaults(); 35 | } 36 | 37 | public WrapperPlayServerEntityHeadRotation(PacketContainer packet) { 38 | super(packet, TYPE); 39 | } 40 | 41 | /** 42 | * Retrieve Entity ID. 43 | *

44 | * Notes: entity's ID 45 | * 46 | * @return The current Entity ID 47 | */ 48 | public int getEntityID() { 49 | return handle.getIntegers().read(0); 50 | } 51 | 52 | /** 53 | * Set Entity ID. 54 | * 55 | * @param value - new value. 56 | */ 57 | public void setEntityID(int value) { 58 | handle.getIntegers().write(0, value); 59 | } 60 | 61 | /** 62 | * Retrieve the entity of the painting that will be spawned. 63 | * 64 | * @param world - the current world of the entity. 65 | * @return The spawned entity. 66 | */ 67 | public Entity getEntity(World world) { 68 | return handle.getEntityModifier(world).read(0); 69 | } 70 | 71 | /** 72 | * Retrieve the entity of the painting that will be spawned. 73 | * 74 | * @param event - the packet event. 75 | * @return The spawned entity. 76 | */ 77 | public Entity getEntity(PacketEvent event) { 78 | return getEntity(event.getPlayer().getWorld()); 79 | } 80 | 81 | /** 82 | * Retrieve Head Yaw. 83 | *

84 | * Notes: head yaw in steps of 2p/256 85 | * 86 | * @return The current Head Yaw 87 | */ 88 | public byte getHeadYaw() { 89 | return handle.getBytes().read(0); 90 | } 91 | 92 | /** 93 | * Set Head Yaw. 94 | * 95 | * @param value - new value. 96 | */ 97 | public void setHeadYaw(byte value) { 98 | handle.getBytes().write(0, value); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerEntityStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import org.bukkit.World; 22 | import org.bukkit.entity.Entity; 23 | 24 | import com.comphenix.protocol.PacketType; 25 | import com.comphenix.protocol.events.PacketContainer; 26 | import com.comphenix.protocol.events.PacketEvent; 27 | 28 | public class WrapperPlayServerEntityStatus extends AbstractPacket { 29 | public static final PacketType TYPE = PacketType.Play.Server.ENTITY_STATUS; 30 | 31 | public WrapperPlayServerEntityStatus() { 32 | super(new PacketContainer(TYPE), TYPE); 33 | handle.getModifier().writeDefaults(); 34 | } 35 | 36 | public WrapperPlayServerEntityStatus(PacketContainer packet) { 37 | super(packet, TYPE); 38 | } 39 | 40 | /** 41 | * Retrieve Entity ID. 42 | *

43 | * Notes: entity's ID 44 | * 45 | * @return The current Entity ID 46 | */ 47 | public int getEntityID() { 48 | return handle.getIntegers().read(0); 49 | } 50 | 51 | /** 52 | * Set Entity ID. 53 | * 54 | * @param value - new value. 55 | */ 56 | public void setEntityID(int value) { 57 | handle.getIntegers().write(0, value); 58 | } 59 | 60 | /** 61 | * Retrieve the entity of the painting that will be spawned. 62 | * 63 | * @param world - the current world of the entity. 64 | * @return The spawned entity. 65 | */ 66 | public Entity getEntity(World world) { 67 | return handle.getEntityModifier(world).read(0); 68 | } 69 | 70 | /** 71 | * Retrieve the entity of the painting that will be spawned. 72 | * 73 | * @param event - the packet event. 74 | * @return The spawned entity. 75 | */ 76 | public Entity getEntity(PacketEvent event) { 77 | return getEntity(event.getPlayer().getWorld()); 78 | } 79 | 80 | /** 81 | * Retrieve Entity Status. 82 | *

83 | * Notes: see below 84 | * 85 | * @return The current Entity Status 86 | */ 87 | public byte getEntityStatus() { 88 | return handle.getBytes().read(0); 89 | } 90 | 91 | /** 92 | * Set Entity Status. 93 | * 94 | * @param value - new value. 95 | */ 96 | public void setEntityStatus(byte value) { 97 | handle.getBytes().write(0, value); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerExperience.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerExperience extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Server.EXPERIENCE; 26 | 27 | public WrapperPlayServerExperience() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayServerExperience(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Experience bar. 38 | *

39 | * Notes: between 0 and 1 40 | * 41 | * @return The current Experience bar 42 | */ 43 | public float getExperienceBar() { 44 | return handle.getFloat().read(0); 45 | } 46 | 47 | /** 48 | * Set Experience bar. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setExperienceBar(float value) { 53 | handle.getFloat().write(0, value); 54 | } 55 | 56 | /** 57 | * Retrieve Level. 58 | * 59 | * @return The current Level 60 | */ 61 | public int getLevel() { 62 | return handle.getIntegers().read(1); 63 | } 64 | 65 | /** 66 | * Set Level. 67 | * 68 | * @param value - new value. 69 | */ 70 | public void setLevel(int value) { 71 | handle.getIntegers().write(1, value); 72 | } 73 | 74 | /** 75 | * Retrieve Total Experience. 76 | * 77 | * @return The current Total Experience 78 | */ 79 | public int getTotalExperience() { 80 | return handle.getIntegers().read(0); 81 | } 82 | 83 | /** 84 | * Set Total Experience. 85 | * 86 | * @param value - new value. 87 | */ 88 | public void setTotalExperience(int value) { 89 | handle.getIntegers().write(0, value); 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerGameStateChange.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerGameStateChange extends AbstractPacket { 25 | public static final PacketType TYPE = 26 | PacketType.Play.Server.GAME_STATE_CHANGE; 27 | 28 | public WrapperPlayServerGameStateChange() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayServerGameStateChange(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Reason. 39 | * 40 | * @return The current Reason 41 | */ 42 | public int getReason() { 43 | return handle.getIntegers().read(0); 44 | } 45 | 46 | /** 47 | * Set Reason. 48 | * 49 | * @param value - new value. 50 | */ 51 | public void setReason(int value) { 52 | handle.getIntegers().write(0, value); 53 | } 54 | 55 | /** 56 | * Retrieve Value. 57 | *

58 | * Notes: depends on reason 59 | * 60 | * @return The current Value 61 | */ 62 | public float getValue() { 63 | return handle.getFloat().read(0); 64 | } 65 | 66 | /** 67 | * Set Value. 68 | * 69 | * @param value - new value. 70 | */ 71 | public void setValue(float value) { 72 | handle.getFloat().write(0, value); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerHeldItemSlot.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerHeldItemSlot extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Server.HELD_ITEM_SLOT; 26 | 27 | public WrapperPlayServerHeldItemSlot() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayServerHeldItemSlot(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Slot. 38 | *

39 | * Notes: the slot which the player has selected (0-8) 40 | * 41 | * @return The current Slot 42 | */ 43 | public int getSlot() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set Slot. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setSlot(int value) { 53 | handle.getIntegers().write(0, value); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerKeepAlive.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerKeepAlive extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Server.KEEP_ALIVE; 26 | 27 | public WrapperPlayServerKeepAlive() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayServerKeepAlive(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Keep Alive ID. 38 | * 39 | * @return The current Keep Alive ID 40 | */ 41 | public long getKeepAliveId() { 42 | return handle.getLongs().read(0); 43 | } 44 | 45 | /** 46 | * Set Keep Alive ID. 47 | * 48 | * @param value - new value. 49 | */ 50 | public void setKeepAliveId(long value) { 51 | handle.getLongs().write(0, value); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerKickDisconnect.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.WrappedChatComponent; 24 | 25 | public class WrapperPlayServerKickDisconnect extends AbstractPacket { 26 | public static final PacketType TYPE = 27 | PacketType.Play.Server.KICK_DISCONNECT; 28 | 29 | public WrapperPlayServerKickDisconnect() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayServerKickDisconnect(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | /** 39 | * Retrieve Reason. 40 | *

41 | * Notes: displayed to the client when the connection terminates. Must be 42 | * valid JSON. 43 | * 44 | * @return The current Reason 45 | */ 46 | public WrappedChatComponent getReason() { 47 | return handle.getChatComponents().read(0); 48 | } 49 | 50 | /** 51 | * Set Reason. 52 | * 53 | * @param value - new value. 54 | */ 55 | public void setReason(WrappedChatComponent value) { 56 | handle.getChatComponents().write(0, value); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerMultiBlockChange.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.ChunkCoordIntPair; 24 | import com.comphenix.protocol.wrappers.MultiBlockChangeInfo; 25 | 26 | public class WrapperPlayServerMultiBlockChange extends AbstractPacket { 27 | public static final PacketType TYPE = 28 | PacketType.Play.Server.MULTI_BLOCK_CHANGE; 29 | 30 | public WrapperPlayServerMultiBlockChange() { 31 | super(new PacketContainer(TYPE), TYPE); 32 | handle.getModifier().writeDefaults(); 33 | } 34 | 35 | public WrapperPlayServerMultiBlockChange(PacketContainer packet) { 36 | super(packet, TYPE); 37 | } 38 | 39 | /** 40 | * Retrieve the chunk that has been altered. 41 | * 42 | * @return The current chunk 43 | */ 44 | public ChunkCoordIntPair getChunk() { 45 | return handle.getChunkCoordIntPairs().read(0); 46 | } 47 | 48 | /** 49 | * Set the chunk that has been altered. 50 | * 51 | * @param value - new value 52 | */ 53 | public void setChunk(ChunkCoordIntPair value) { 54 | handle.getChunkCoordIntPairs().write(0, value); 55 | } 56 | 57 | /** 58 | * Retrieve a copy of the record data as a block change array. 59 | * 60 | * @return The copied block change array. 61 | */ 62 | public MultiBlockChangeInfo[] getRecords() { 63 | return handle.getMultiBlockChangeInfoArrays().read(0); 64 | } 65 | 66 | /** 67 | * Set the record data using the given helper array. 68 | * 69 | * @param value - new value 70 | */ 71 | public void setRecords(MultiBlockChangeInfo[] value) { 72 | handle.getMultiBlockChangeInfoArrays().write(0, value); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerNbtQuery.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.nbt.NbtBase; 24 | 25 | public class WrapperPlayServerNbtQuery extends AbstractPacket { 26 | 27 | public static final PacketType TYPE = PacketType.Play.Server.NBT_QUERY; 28 | 29 | public WrapperPlayServerNbtQuery() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayServerNbtQuery(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | /** 39 | * Retrieve Transaction ID. 40 | *

41 | * Notes: can be compared to the one sent in the original query packet. 42 | * @return The current Transaction ID 43 | */ 44 | public int getTransactionId() { 45 | return handle.getIntegers().read(0); 46 | } 47 | 48 | /** 49 | * Set Transaction ID. 50 | * @param value - new value. 51 | */ 52 | public void setTransactionId(int value) { 53 | handle.getIntegers().write(0, value); 54 | } 55 | 56 | /** 57 | * Retrieve NBT. 58 | *

59 | * Notes: the NBT of the block or entity. May be a TAG_END (0) in which case no NBT is present. 60 | * @return The current NBT 61 | */ 62 | public NbtBase getNbt() { 63 | return handle.getNbtModifier().read(0); 64 | } 65 | 66 | /** 67 | * Set NBT. 68 | * @param value - new value. 69 | */ 70 | public void setNbt(NbtBase value) { 71 | handle.getNbtModifier().write(0, value); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerOpenBook.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.EnumWrappers.Hand; 24 | 25 | public class WrapperPlayServerOpenBook extends AbstractPacket { 26 | 27 | public static final PacketType TYPE = PacketType.Play.Server.OPEN_BOOK; 28 | 29 | public WrapperPlayServerOpenBook() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayServerOpenBook(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | /** 39 | * Retrieve Hand. 40 | *

41 | * Notes: 0: Main hand, 1: Off hand 42 | * @return The current Hand 43 | */ 44 | public Hand getHand() { 45 | return handle.getHands().read(0); 46 | } 47 | 48 | /** 49 | * Set Hand. 50 | * @param value - new value. 51 | */ 52 | public void setHand(Hand value) { 53 | handle.getHands().write(0, value); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerOpenSignEditor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.BlockPosition; 24 | 25 | public class WrapperPlayServerOpenSignEditor extends AbstractPacket { 26 | 27 | public static final PacketType TYPE = 28 | PacketType.Play.Server.OPEN_SIGN_EDITOR; 29 | 30 | public WrapperPlayServerOpenSignEditor() { 31 | super(new PacketContainer(TYPE), TYPE); 32 | handle.getModifier().writeDefaults(); 33 | } 34 | 35 | public WrapperPlayServerOpenSignEditor(PacketContainer packet) { 36 | super(packet, TYPE); 37 | } 38 | 39 | /** 40 | * Retrieve Location. 41 | * 42 | * @return The current Location 43 | */ 44 | public BlockPosition getLocation() { 45 | return handle.getBlockPositionModifier().read(0); 46 | } 47 | 48 | /** 49 | * Set Location. 50 | * 51 | * @param value - new value. 52 | */ 53 | public void setLocation(BlockPosition value) { 54 | handle.getBlockPositionModifier().write(0, value); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerOpenWindowMerchant.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerOpenWindowMerchant extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Play.Server.OPEN_WINDOW_MERCHANT; 27 | 28 | public WrapperPlayServerOpenWindowMerchant() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayServerOpenWindowMerchant(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | // Cannot generate getter a 38 | // Cannot generate setter a 39 | // Cannot find type for b 40 | // Cannot find type for b 41 | // Cannot find type for b 42 | // Cannot find type for b 43 | // Cannot find type for b 44 | // Cannot find type for b 45 | // Cannot find type for b 46 | // Cannot find type for b 47 | // Cannot find type for b 48 | // Cannot find type for b 49 | // Cannot find type for b 50 | // Cannot find type for b 51 | // Cannot find type for b 52 | // Cannot find type for b 53 | // Cannot find type for b 54 | // Cannot find type for b 55 | // Cannot find type for b 56 | } 57 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerPlayerInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import java.util.List; 22 | 23 | import com.comphenix.protocol.PacketType; 24 | import com.comphenix.protocol.events.PacketContainer; 25 | import com.comphenix.protocol.wrappers.EnumWrappers.PlayerInfoAction; 26 | import com.comphenix.protocol.wrappers.PlayerInfoData; 27 | 28 | public class WrapperPlayServerPlayerInfo extends AbstractPacket { 29 | public static final PacketType TYPE = PacketType.Play.Server.PLAYER_INFO; 30 | 31 | public WrapperPlayServerPlayerInfo() { 32 | super(new PacketContainer(TYPE), TYPE); 33 | handle.getModifier().writeDefaults(); 34 | } 35 | 36 | public WrapperPlayServerPlayerInfo(PacketContainer packet) { 37 | super(packet, TYPE); 38 | } 39 | 40 | public PlayerInfoAction getAction() { 41 | return handle.getPlayerInfoAction().read(0); 42 | } 43 | 44 | public void setAction(PlayerInfoAction value) { 45 | handle.getPlayerInfoAction().write(0, value); 46 | } 47 | 48 | public List getData() { 49 | return handle.getPlayerInfoDataLists().read(0); 50 | } 51 | 52 | public void setData(List value) { 53 | handle.getPlayerInfoDataLists().write(0, value); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerPlayerListHeaderFooter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.WrappedChatComponent; 24 | 25 | public class WrapperPlayServerPlayerListHeaderFooter extends AbstractPacket { 26 | public static final PacketType TYPE = 27 | PacketType.Play.Server.PLAYER_LIST_HEADER_FOOTER; 28 | 29 | public WrapperPlayServerPlayerListHeaderFooter() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayServerPlayerListHeaderFooter(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | /** 39 | * Retrieve Header. 40 | * 41 | * @return The current Header 42 | */ 43 | public WrappedChatComponent getHeader() { 44 | return handle.getChatComponents().read(0); 45 | } 46 | 47 | /** 48 | * Set Header. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setHeader(WrappedChatComponent value) { 53 | handle.getChatComponents().write(0, value); 54 | } 55 | 56 | /** 57 | * Retrieve Footer. 58 | * 59 | * @return The current Footer 60 | */ 61 | public WrappedChatComponent getFooter() { 62 | return handle.getChatComponents().read(1); 63 | } 64 | 65 | /** 66 | * Set Footer. 67 | * 68 | * @param value - new value. 69 | */ 70 | public void setFooter(WrappedChatComponent value) { 71 | handle.getChatComponents().write(1, value); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerRecipeUpdate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerRecipeUpdate extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Play.Server.RECIPE_UPDATE; 27 | 28 | public WrapperPlayServerRecipeUpdate() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayServerRecipeUpdate(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | // TODO manually upon request 38 | } 39 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerRemoveEntityEffect.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import org.bukkit.World; 22 | import org.bukkit.entity.Entity; 23 | import org.bukkit.potion.PotionEffectType; 24 | 25 | import com.comphenix.protocol.PacketType; 26 | import com.comphenix.protocol.events.PacketContainer; 27 | import com.comphenix.protocol.events.PacketEvent; 28 | 29 | public class WrapperPlayServerRemoveEntityEffect extends AbstractPacket { 30 | public static final PacketType TYPE = 31 | PacketType.Play.Server.REMOVE_ENTITY_EFFECT; 32 | 33 | public WrapperPlayServerRemoveEntityEffect() { 34 | super(new PacketContainer(TYPE), TYPE); 35 | handle.getModifier().writeDefaults(); 36 | } 37 | 38 | public WrapperPlayServerRemoveEntityEffect(PacketContainer packet) { 39 | super(packet, TYPE); 40 | } 41 | 42 | /** 43 | * Retrieve Entity ID. 44 | *

45 | * Notes: entity's ID 46 | * 47 | * @return The current Entity ID 48 | */ 49 | public int getEntityID() { 50 | return handle.getIntegers().read(0); 51 | } 52 | 53 | /** 54 | * Set Entity ID. 55 | * 56 | * @param value - new value. 57 | */ 58 | public void setEntityID(int value) { 59 | handle.getIntegers().write(0, value); 60 | } 61 | 62 | /** 63 | * Retrieve the entity of the painting that will be spawned. 64 | * 65 | * @param world - the current world of the entity. 66 | * @return The spawned entity. 67 | */ 68 | public Entity getEntity(World world) { 69 | return handle.getEntityModifier(world).read(0); 70 | } 71 | 72 | /** 73 | * Retrieve the entity of the painting that will be spawned. 74 | * 75 | * @param event - the packet event. 76 | * @return The spawned entity. 77 | */ 78 | public Entity getEntity(PacketEvent event) { 79 | return getEntity(event.getPlayer().getWorld()); 80 | } 81 | 82 | public PotionEffectType getEffect() { 83 | return handle.getEffectTypes().read(0); 84 | } 85 | 86 | public void setEffect(PotionEffectType value) { 87 | handle.getEffectTypes().write(0, value); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerResourcePackSend.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerResourcePackSend extends AbstractPacket { 25 | public static final PacketType TYPE = 26 | PacketType.Play.Server.RESOURCE_PACK_SEND; 27 | 28 | public WrapperPlayServerResourcePackSend() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayServerResourcePackSend(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve URL. 39 | *

40 | * Notes: the URL to the resource pack. 41 | * 42 | * @return The current URL 43 | */ 44 | public String getUrl() { 45 | return handle.getStrings().read(0); 46 | } 47 | 48 | /** 49 | * Set URL. 50 | * 51 | * @param value - new value. 52 | */ 53 | public void setUrl(String value) { 54 | handle.getStrings().write(0, value); 55 | } 56 | 57 | /** 58 | * Retrieve Hash. 59 | *

60 | * Notes: a 40 character hexadecimal and lower-case SHA-1 hash of the 61 | * resource pack file. (must be lower case in order to work) If it's not a 62 | * 40 character hexadecimal string, the client will not use it for hash 63 | * verification and likely waste bandwidth - but it will still treat it as a 64 | * unique id 65 | * 66 | * @return The current Hash 67 | */ 68 | public String getHash() { 69 | return handle.getStrings().read(1); 70 | } 71 | 72 | /** 73 | * Set Hash. 74 | * 75 | * @param value - new value. 76 | */ 77 | public void setHash(String value) { 78 | handle.getStrings().write(1, value); 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerScoreboardDisplayObjective.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerScoreboardDisplayObjective extends AbstractPacket { 25 | public static final PacketType TYPE = 26 | PacketType.Play.Server.SCOREBOARD_DISPLAY_OBJECTIVE; 27 | 28 | public WrapperPlayServerScoreboardDisplayObjective() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayServerScoreboardDisplayObjective(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Position. 39 | *

40 | * Notes: the position of the scoreboard. 0 = list, 1 = sidebar, 2 = 41 | * belowName. 42 | * 43 | * @return The current Position 44 | */ 45 | public int getPosition() { 46 | return handle.getIntegers().read(0); 47 | } 48 | 49 | /** 50 | * Set Position. 51 | * 52 | * @param value - new value. 53 | */ 54 | public void setPosition(int value) { 55 | handle.getIntegers().write(0, value); 56 | } 57 | 58 | /** 59 | * Retrieve Score Name. 60 | *

61 | * Notes: the unique name for the scoreboard to be displayed. 62 | * 63 | * @return The current Score Name 64 | */ 65 | public String getScoreName() { 66 | return handle.getStrings().read(0); 67 | } 68 | 69 | /** 70 | * Set Score Name. 71 | * 72 | * @param value - new value. 73 | */ 74 | public void setScoreName(String value) { 75 | handle.getStrings().write(0, value); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerSelectAdvancementTab.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.MinecraftKey; 24 | 25 | public class WrapperPlayServerSelectAdvancementTab extends AbstractPacket { 26 | 27 | public static final PacketType TYPE = PacketType.Play.Server.SELECT_ADVANCEMENT_TAB; 28 | 29 | public WrapperPlayServerSelectAdvancementTab() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayServerSelectAdvancementTab(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | public MinecraftKey getKey() { 39 | return handle.getMinecraftKeys().readSafely(0); 40 | } 41 | 42 | public void setKey(MinecraftKey key) { 43 | handle.getMinecraftKeys().writeSafely(0, key); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerServerDifficulty.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.EnumWrappers.Difficulty; 24 | 25 | public class WrapperPlayServerServerDifficulty extends AbstractPacket { 26 | public static final PacketType TYPE = 27 | PacketType.Play.Server.SERVER_DIFFICULTY; 28 | 29 | public WrapperPlayServerServerDifficulty() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayServerServerDifficulty(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | /** 39 | * Retrieve Difficulty. 40 | *

41 | * Notes: 0:PEACEFUL, 1:EASY, 2:NORMAL, 3: HARD 42 | * 43 | * @return The current Difficulty 44 | */ 45 | public Difficulty getDifficulty() { 46 | return handle.getDifficulties().read(0); 47 | } 48 | 49 | /** 50 | * Set Difficulty. 51 | * 52 | * @param value - new value. 53 | */ 54 | public void setDifficulty(Difficulty value) { 55 | handle.getDifficulties().write(0, value); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerSetSlot.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import org.bukkit.inventory.ItemStack; 22 | 23 | import com.comphenix.protocol.PacketType; 24 | import com.comphenix.protocol.events.PacketContainer; 25 | 26 | public class WrapperPlayServerSetSlot extends AbstractPacket { 27 | public static final PacketType TYPE = PacketType.Play.Server.SET_SLOT; 28 | 29 | public WrapperPlayServerSetSlot() { 30 | super(new PacketContainer(TYPE), TYPE); 31 | handle.getModifier().writeDefaults(); 32 | } 33 | 34 | public WrapperPlayServerSetSlot(PacketContainer packet) { 35 | super(packet, TYPE); 36 | } 37 | 38 | /** 39 | * Retrieve Window ID. 40 | *

41 | * Notes: the window which is being updated. 0 for player inventory. Note 42 | * that all known window types include the player inventory. This packet 43 | * will only be sent for the currently opened window while the player is 44 | * performing actions, even if it affects the player inventory. After the 45 | * window is closed, a number of these packets are sent to update the 46 | * player's inventory window (0). 47 | * 48 | * @return The current Window ID 49 | */ 50 | public int getWindowId() { 51 | return handle.getIntegers().read(0); 52 | } 53 | 54 | /** 55 | * Set Window ID. 56 | * 57 | * @param value - new value. 58 | */ 59 | public void setWindowId(int value) { 60 | handle.getIntegers().write(0, value); 61 | } 62 | 63 | /** 64 | * Retrieve Slot. 65 | *

66 | * Notes: the slot that should be updated 67 | * 68 | * @return The current Slot 69 | */ 70 | public int getSlot() { 71 | return handle.getIntegers().read(1); 72 | } 73 | 74 | /** 75 | * Set Slot. 76 | * 77 | * @param value - new value. 78 | */ 79 | public void setSlot(int value) { 80 | handle.getIntegers().write(1, value); 81 | } 82 | 83 | /** 84 | * Retrieve Slot data. 85 | * 86 | * @return The current Slot data 87 | */ 88 | public ItemStack getSlotData() { 89 | return handle.getItemModifier().read(0); 90 | } 91 | 92 | /** 93 | * Set Slot data. 94 | * 95 | * @param value - new value. 96 | */ 97 | public void setSlotData(ItemStack value) { 98 | handle.getItemModifier().write(0, value); 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerSpawnPosition.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.BlockPosition; 24 | 25 | public class WrapperPlayServerSpawnPosition extends AbstractPacket { 26 | public static final PacketType TYPE = PacketType.Play.Server.SPAWN_POSITION; 27 | 28 | public WrapperPlayServerSpawnPosition() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayServerSpawnPosition(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Location. 39 | *

40 | * Notes: spawn location 41 | * 42 | * @return The current Location 43 | */ 44 | public BlockPosition getLocation() { 45 | return handle.getBlockPositionModifier().read(0); 46 | } 47 | 48 | /** 49 | * Set Location. 50 | * 51 | * @param value - new value. 52 | */ 53 | public void setLocation(BlockPosition value) { 54 | handle.getBlockPositionModifier().write(0, value); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerStatistic.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerStatistic extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Server.STATISTIC; 26 | 27 | public WrapperPlayServerStatistic() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayServerStatistic(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | // TODO fix upon request 37 | } 38 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerStopSound.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.EnumWrappers; 24 | import com.comphenix.protocol.wrappers.MinecraftKey; 25 | 26 | public class WrapperPlayServerStopSound extends AbstractPacket { 27 | 28 | public static final PacketType TYPE = PacketType.Play.Server.STOP_SOUND; 29 | 30 | public WrapperPlayServerStopSound() { 31 | super(new PacketContainer(TYPE), TYPE); 32 | handle.getModifier().writeDefaults(); 33 | } 34 | 35 | public WrapperPlayServerStopSound(PacketContainer packet) { 36 | super(packet, TYPE); 37 | } 38 | 39 | public MinecraftKey getSoundEffect() { 40 | return handle.getMinecraftKeys().readSafely(0); 41 | } 42 | 43 | public void setSoundEffect(MinecraftKey value) { 44 | handle.getMinecraftKeys().writeSafely(0, value); 45 | } 46 | 47 | public EnumWrappers.SoundCategory getCategory() { 48 | return handle.getSoundCategories().readSafely(0); 49 | } 50 | 51 | public void setCategory(EnumWrappers.SoundCategory value) { 52 | handle.getSoundCategories().writeSafely(0, value); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerTabComplete.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.mojang.brigadier.suggestion.Suggestions; 24 | 25 | public class WrapperPlayServerTabComplete extends AbstractPacket { 26 | public static final PacketType TYPE = PacketType.Play.Server.TAB_COMPLETE; 27 | 28 | public WrapperPlayServerTabComplete() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayServerTabComplete(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | public int getTransactionId() { 38 | return handle.getIntegers().read(0); 39 | } 40 | 41 | public void setTransactionId(int value) { 42 | handle.getIntegers().write(0, value); 43 | } 44 | 45 | public Suggestions getSuggestions() { 46 | return handle.getSpecificModifier(Suggestions.class).read(0); 47 | } 48 | 49 | public void setSuggestions(Suggestions value) { 50 | handle.getSpecificModifier(Suggestions.class).write(0, value); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerTags.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerTags extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Play.Server.TAGS; 27 | 28 | public WrapperPlayServerTags() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayServerTags(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | // Cannot find type for a 38 | // Cannot find type for a 39 | // Cannot find type for a 40 | } 41 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerTileEntityData.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.BlockPosition; 24 | import com.comphenix.protocol.wrappers.nbt.NbtBase; 25 | 26 | public class WrapperPlayServerTileEntityData extends AbstractPacket { 27 | public static final PacketType TYPE = 28 | PacketType.Play.Server.TILE_ENTITY_DATA; 29 | 30 | public WrapperPlayServerTileEntityData() { 31 | super(new PacketContainer(TYPE), TYPE); 32 | handle.getModifier().writeDefaults(); 33 | } 34 | 35 | public WrapperPlayServerTileEntityData(PacketContainer packet) { 36 | super(packet, TYPE); 37 | } 38 | 39 | /** 40 | * Retrieve Location. 41 | * 42 | * @return The current Location 43 | */ 44 | public BlockPosition getLocation() { 45 | return handle.getBlockPositionModifier().read(0); 46 | } 47 | 48 | /** 49 | * Set Location. 50 | * 51 | * @param value - new value. 52 | */ 53 | public void setLocation(BlockPosition value) { 54 | handle.getBlockPositionModifier().write(0, value); 55 | } 56 | 57 | /** 58 | * Retrieve Action. 59 | *

60 | * Notes: the type of update to perform 61 | * 62 | * @return The current Action 63 | */ 64 | public int getAction() { 65 | return handle.getIntegers().read(0); 66 | } 67 | 68 | /** 69 | * Set Action. 70 | * 71 | * @param value - new value. 72 | */ 73 | public void setAction(int value) { 74 | handle.getIntegers().write(0, value); 75 | } 76 | 77 | /** 78 | * Retrieve NBT Data. 79 | *

80 | * Notes: if not present then its TAG_END (0) 81 | * 82 | * @return The current NBT Data 83 | */ 84 | public NbtBase getNbtData() { 85 | return handle.getNbtModifier().read(0); 86 | } 87 | 88 | /** 89 | * Set NBT Data. 90 | * 91 | * @param value - new value. 92 | */ 93 | public void setNbtData(NbtBase value) { 94 | handle.getNbtModifier().write(0, value); 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerTransaction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerTransaction extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Server.TRANSACTION; 26 | 27 | public WrapperPlayServerTransaction() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayServerTransaction(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Window ID. 38 | *

39 | * Notes: the id of the window that the action occurred in. 40 | * 41 | * @return The current Window ID 42 | */ 43 | public int getWindowId() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set Window ID. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setWindowId(int value) { 53 | handle.getIntegers().write(0, value); 54 | } 55 | 56 | /** 57 | * Retrieve Action number. 58 | *

59 | * Notes: every action that is to be accepted has a unique number. This 60 | * field corresponds to that number. 61 | * 62 | * @return The current Action number 63 | */ 64 | public short getActionNumber() { 65 | return handle.getShorts().read(0); 66 | } 67 | 68 | /** 69 | * Set Action number. 70 | * 71 | * @param value - new value. 72 | */ 73 | public void setActionNumber(short value) { 74 | handle.getShorts().write(0, value); 75 | } 76 | 77 | /** 78 | * Retrieve Accepted. 79 | *

80 | * Notes: whether the action was accepted. 81 | * 82 | * @return The current Accepted 83 | */ 84 | public boolean getAccepted() { 85 | return handle.getBooleans().read(0); 86 | } 87 | 88 | /** 89 | * Set Accepted. 90 | * 91 | * @param value - new value. 92 | */ 93 | public void setAccepted(boolean value) { 94 | handle.getBooleans().write(0, value); 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerUnloadChunk.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerUnloadChunk extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Play.Server.UNLOAD_CHUNK; 27 | 28 | public WrapperPlayServerUnloadChunk() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayServerUnloadChunk(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Chunk X. 39 | *

40 | * Notes: block coordinate divided by 16, rounded down 41 | * 42 | * @return The current Chunk X 43 | */ 44 | public int getChunkX() { 45 | return handle.getIntegers().read(0); 46 | } 47 | 48 | /** 49 | * Set Chunk X. 50 | * 51 | * @param value - new value. 52 | */ 53 | public void setChunkX(int value) { 54 | handle.getIntegers().write(0, value); 55 | } 56 | 57 | /** 58 | * Retrieve Chunk Z. 59 | *

60 | * Notes: block coordinate divided by 16, rounded down 61 | * 62 | * @return The current Chunk Z 63 | */ 64 | public int getChunkZ() { 65 | return handle.getIntegers().read(1); 66 | } 67 | 68 | /** 69 | * Set Chunk Z. 70 | * 71 | * @param value - new value. 72 | */ 73 | public void setChunkZ(int value) { 74 | handle.getIntegers().write(1, value); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerUpdateHealth.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerUpdateHealth extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Server.UPDATE_HEALTH; 26 | 27 | public WrapperPlayServerUpdateHealth() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayServerUpdateHealth(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Health. 38 | *

39 | * Notes: 0 or less = dead, 20 = full HP 40 | * 41 | * @return The current Health 42 | */ 43 | public float getHealth() { 44 | return handle.getFloat().read(0); 45 | } 46 | 47 | /** 48 | * Set Health. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setHealth(float value) { 53 | handle.getFloat().write(0, value); 54 | } 55 | 56 | /** 57 | * Retrieve Food. 58 | *

59 | * Notes: 0 - 20 60 | * 61 | * @return The current Food 62 | */ 63 | public int getFood() { 64 | return handle.getIntegers().read(0); 65 | } 66 | 67 | /** 68 | * Set Food. 69 | * 70 | * @param value - new value. 71 | */ 72 | public void setFood(int value) { 73 | handle.getIntegers().write(0, value); 74 | } 75 | 76 | /** 77 | * Retrieve Food Saturation. 78 | *

79 | * Notes: seems to vary from 0.0 to 5.0 in integer increments 80 | * 81 | * @return The current Food Saturation 82 | */ 83 | public float getFoodSaturation() { 84 | return handle.getFloat().read(1); 85 | } 86 | 87 | /** 88 | * Set Food Saturation. 89 | * 90 | * @param value - new value. 91 | */ 92 | public void setFoodSaturation(float value) { 93 | handle.getFloat().write(1, value); 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerUpdateTime.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerUpdateTime extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Server.UPDATE_TIME; 26 | 27 | public WrapperPlayServerUpdateTime() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayServerUpdateTime(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Age of the world. 38 | *

39 | * Notes: in ticks; not changed by server commands 40 | * 41 | * @return The current Age of the world 42 | */ 43 | public long getAgeOfTheWorld() { 44 | return handle.getLongs().read(0); 45 | } 46 | 47 | /** 48 | * Set Age of the world. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setAgeOfTheWorld(long value) { 53 | handle.getLongs().write(0, value); 54 | } 55 | 56 | /** 57 | * Retrieve Time of day. 58 | *

59 | * Notes: the world (or region) time, in ticks. If negative the sun will 60 | * stop moving at the Math.abs of the time 61 | * 62 | * @return The current Time of day 63 | */ 64 | public long getTimeOfDay() { 65 | return handle.getLongs().read(1); 66 | } 67 | 68 | /** 69 | * Set Time of day. 70 | * 71 | * @param value - new value. 72 | */ 73 | public void setTimeOfDay(long value) { 74 | handle.getLongs().write(1, value); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerViewCentre.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerViewCentre extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Play.Server.VIEW_CENTRE; 27 | 28 | public WrapperPlayServerViewCentre() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayServerViewCentre(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve Chunk X. 39 | *

40 | * Notes: chunk X coordinate of the player's position 41 | * @return The current Chunk X 42 | */ 43 | public int getChunkX() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set Chunk X. 49 | * @param value - new value. 50 | */ 51 | public void setChunkX(int value) { 52 | handle.getIntegers().write(0, value); 53 | } 54 | 55 | /** 56 | * Retrieve Chunk Z. 57 | *

58 | * Notes: chunk Z coordinate of the player's position 59 | * @return The current Chunk Z 60 | */ 61 | public int getChunkZ() { 62 | return handle.getIntegers().read(1); 63 | } 64 | 65 | /** 66 | * Set Chunk Z. 67 | * @param value - new value. 68 | */ 69 | public void setChunkZ(int value) { 70 | handle.getIntegers().write(1, value); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerViewDistance.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of PacketWrapper. 3 | * Copyright (C) 2012-2015 Kristian S. Strangeland 4 | * Copyright (C) 2015 dmulloy2 5 | * 6 | * PacketWrapper is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PacketWrapper is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with PacketWrapper. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerViewDistance extends AbstractPacket { 25 | 26 | public static final PacketType TYPE = PacketType.Play.Server.VIEW_DISTANCE; 27 | 28 | public WrapperPlayServerViewDistance() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperPlayServerViewDistance(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve View Distance. 39 | *

40 | * Notes: render distance (2-32) 41 | * @return The current View Distance 42 | */ 43 | public int getViewDistance() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set View Distance. 49 | * @param value - new value. 50 | */ 51 | public void setViewDistance(int value) { 52 | handle.getIntegers().write(0, value); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerWindowData.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperPlayServerWindowData extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Play.Server.WINDOW_DATA; 26 | 27 | public WrapperPlayServerWindowData() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperPlayServerWindowData(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Window ID. 38 | *

39 | * Notes: the id of the window. 40 | * 41 | * @return The current Window ID 42 | */ 43 | public int getWindowId() { 44 | return handle.getIntegers().read(0); 45 | } 46 | 47 | /** 48 | * Set Window ID. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setWindowId(int value) { 53 | handle.getIntegers().write(0, value); 54 | } 55 | 56 | /** 57 | * Retrieve Property. 58 | *

59 | * Notes: which property should be updated. 60 | * 61 | * @return The current Property 62 | */ 63 | public int getProperty() { 64 | return handle.getIntegers().read(1); 65 | } 66 | 67 | /** 68 | * Set Property. 69 | * 70 | * @param value - new value. 71 | */ 72 | public void setProperty(int value) { 73 | handle.getIntegers().write(1, value); 74 | } 75 | 76 | /** 77 | * Retrieve Value. 78 | *

79 | * Notes: the new value for the property. 80 | * 81 | * @return The current Value 82 | */ 83 | public int getValue() { 84 | return handle.getIntegers().read(2); 85 | } 86 | 87 | /** 88 | * Set Value. 89 | * 90 | * @param value - new value. 91 | */ 92 | public void setValue(int value) { 93 | handle.getIntegers().write(2, value); 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerWindowItems.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import java.util.List; 22 | 23 | import org.bukkit.inventory.ItemStack; 24 | 25 | import com.comphenix.protocol.PacketType; 26 | import com.comphenix.protocol.events.PacketContainer; 27 | 28 | public class WrapperPlayServerWindowItems extends AbstractPacket { 29 | public static final PacketType TYPE = PacketType.Play.Server.WINDOW_ITEMS; 30 | 31 | public WrapperPlayServerWindowItems() { 32 | super(new PacketContainer(TYPE), TYPE); 33 | handle.getModifier().writeDefaults(); 34 | } 35 | 36 | public WrapperPlayServerWindowItems(PacketContainer packet) { 37 | super(packet, TYPE); 38 | } 39 | 40 | /** 41 | * Retrieve Window ID. 42 | *

43 | * Notes: the id of window which items are being sent for. 0 for player 44 | * inventory. 45 | * 46 | * @return The current Window ID 47 | */ 48 | public int getWindowId() { 49 | return handle.getIntegers().read(0); 50 | } 51 | 52 | /** 53 | * Set Window ID. 54 | * 55 | * @param value - new value. 56 | */ 57 | public void setWindowId(int value) { 58 | handle.getIntegers().write(0, value); 59 | } 60 | 61 | /** 62 | * Retrieve Slot data. 63 | * 64 | * @return The current Slot data 65 | */ 66 | public List getSlotData() { 67 | return handle.getItemListModifier().read(0); 68 | } 69 | 70 | /** 71 | * Set Slot data. 72 | * 73 | * @param value - new value. 74 | */ 75 | public void setSlotData(List value) { 76 | handle.getItemListModifier().write(0, value); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperStatusClientPing.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperStatusClientPing extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Status.Client.PING; 26 | 27 | public WrapperStatusClientPing() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperStatusClientPing(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Time. 38 | * 39 | * @return The current Time 40 | */ 41 | public long getTime() { 42 | return handle.getLongs().read(0); 43 | } 44 | 45 | /** 46 | * Set Time. 47 | * 48 | * @param value - new value. 49 | */ 50 | public void setTime(long value) { 51 | handle.getLongs().write(0, value); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperStatusClientStart.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperStatusClientStart extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Status.Client.START; 26 | 27 | public WrapperStatusClientStart() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperStatusClientStart(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperStatusServerPong.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | 24 | public class WrapperStatusServerPong extends AbstractPacket { 25 | public static final PacketType TYPE = PacketType.Status.Server.PONG; 26 | 27 | public WrapperStatusServerPong() { 28 | super(new PacketContainer(TYPE), TYPE); 29 | handle.getModifier().writeDefaults(); 30 | } 31 | 32 | public WrapperStatusServerPong(PacketContainer packet) { 33 | super(packet, TYPE); 34 | } 35 | 36 | /** 37 | * Retrieve Time. 38 | *

39 | * Notes: should be the same as sent by the client 40 | * 41 | * @return The current Time 42 | */ 43 | public long getTime() { 44 | return handle.getLongs().read(0); 45 | } 46 | 47 | /** 48 | * Set Time. 49 | * 50 | * @param value - new value. 51 | */ 52 | public void setTime(long value) { 53 | handle.getLongs().write(0, value); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperStatusServerServerInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PacketWrapper - ProtocolLib wrappers for Minecraft packets 3 | * Copyright (C) dmulloy2 4 | * Copyright (C) Kristian S. Strangeland 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | package com.comphenix.packetwrapper; 20 | 21 | import com.comphenix.protocol.PacketType; 22 | import com.comphenix.protocol.events.PacketContainer; 23 | import com.comphenix.protocol.wrappers.WrappedServerPing; 24 | 25 | public class WrapperStatusServerServerInfo extends AbstractPacket { 26 | public static final PacketType TYPE = PacketType.Status.Server.SERVER_INFO; 27 | 28 | public WrapperStatusServerServerInfo() { 29 | super(new PacketContainer(TYPE), TYPE); 30 | handle.getModifier().writeDefaults(); 31 | } 32 | 33 | public WrapperStatusServerServerInfo(PacketContainer packet) { 34 | super(packet, TYPE); 35 | } 36 | 37 | /** 38 | * Retrieve JSON Response. 39 | *

40 | * Notes: https://gist.github.com/thinkofdeath/6927216 41 | * 42 | * @return The current JSON Response 43 | */ 44 | public WrappedServerPing getJsonResponse() { 45 | return handle.getServerPings().read(0); 46 | } 47 | 48 | /** 49 | * Set JSON Response. 50 | * 51 | * @param value - new value. 52 | */ 53 | public void setJsonResponse(WrappedServerPing value) { 54 | handle.getServerPings().write(0, value); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/java/com/comphenix/packetwrapper/util/Removed.java: -------------------------------------------------------------------------------- 1 | package com.comphenix.packetwrapper.util; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target(ElementType.METHOD) 10 | public @interface Removed { 11 | } 12 | -------------------------------------------------------------------------------- /PacketWrapper/src/main/resources/plugin.yml: -------------------------------------------------------------------------------- 1 | name: PacketWrapper 2 | main: com.comphenix.packetwrapper.PacketWrapper 3 | 4 | description: Contains wrappers for each packet in Minecraft. 5 | authors: [dmulloy2, Comphenix] 6 | version: ${project.version} 7 | 8 | depend: [ProtocolLib] 9 | -------------------------------------------------------------------------------- /PacketWrapper/src/test/java/com/comphenix/packetwrapper/utils/ItemFactoryDelegate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) dmulloy2 3 | * Copyright (C) Kristian S. Strangeland 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | */ 23 | package com.comphenix.packetwrapper.utils; 24 | 25 | import org.bukkit.Color; 26 | import org.bukkit.Material; 27 | import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemFactory; 28 | import org.bukkit.inventory.ItemFactory; 29 | import org.bukkit.inventory.ItemStack; 30 | import org.bukkit.inventory.meta.ItemMeta; 31 | 32 | /** 33 | * @author dmulloy2 34 | */ 35 | 36 | public class ItemFactoryDelegate implements ItemFactory { 37 | private final CraftItemFactory factory; 38 | private final ItemMeta mocked; 39 | 40 | public ItemFactoryDelegate(ItemMeta mocked) { 41 | this.factory = CraftItemFactory.instance(); 42 | this.mocked = mocked; 43 | } 44 | 45 | @Override 46 | public ItemMeta asMetaFor(ItemMeta meta, ItemStack stack) throws IllegalArgumentException { 47 | return factory.asMetaFor(meta, stack); 48 | } 49 | 50 | @Override 51 | public ItemMeta asMetaFor(ItemMeta meta, Material material) throws IllegalArgumentException { 52 | return factory.asMetaFor(meta, material); 53 | } 54 | 55 | @Override 56 | public boolean equals(ItemMeta meta1, ItemMeta meta2) throws IllegalArgumentException { 57 | return factory.equals(meta1, meta2); 58 | } 59 | 60 | @Override 61 | public Color getDefaultLeatherColor() { 62 | return factory.getDefaultLeatherColor(); 63 | } 64 | 65 | @Override 66 | public Material updateMaterial(ItemMeta itemMeta, Material material) throws IllegalArgumentException { 67 | return factory.updateMaterial(itemMeta, material); 68 | } 69 | 70 | @Override 71 | public ItemMeta getItemMeta(Material arg0) { 72 | return mocked; 73 | } 74 | 75 | @Override 76 | public boolean isApplicable(ItemMeta meta, ItemStack itemstack) throws IllegalArgumentException { 77 | return factory.isApplicable(meta, itemstack); 78 | } 79 | 80 | @Override 81 | public boolean isApplicable(ItemMeta meta, Material material) throws IllegalArgumentException { 82 | return factory.isApplicable(meta, material); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # PacketWrapper 2 | 3 | This is the official continuation of PacketWrapper by dmulloy2. The original version can be found [here](https://github.com/aadnk/PacketWrapper). 4 | 5 | When reading and writing packets in [ProtocolLib](http://www.spigotmc.org/resources/protocollib.1997/), it is necessary to know the order in which the fields are stored in memory. This requires you to decompile the Minecraft source code with [JD-GUI](http://jd.benow.ca/) or find it in the Spigot work directory (/work/decompile/), while decoding the meaning of a field by looking up an online [wiki](http://www.wiki.vg/Protocol) resource ([tutorial](http://forums.bukkit.org/threads/lib-1-4-6-protocollib-2-0-0-safely-and-easily-modify-sent-and-recieved-packets.101035/page-2#post-1366140)). It would be much easier if these packets could be accessed as any other normal Java bean. 6 | 7 | Enter PacketWrapper. It contains wrapper classes for all known packets in 1.8, providing you with access to the fields by name, along with automatic conversion to existing Bukkit enumerations and classes. It also includes a number of custom enumerations when appropriate. 8 | 9 | You can use PacketWrapper as a dependency if you wish, although it is **highly recommended** that plugin authors simply copy and paste the classes they need into their project. This helps guard against future changes in PacketWrapper and makes it easier on the end user. 10 | 11 | ### Resources 12 | * [Downloads](http://ci.dmulloy2.net/job/PacketWrapper/) 13 | * [ProtocolLib](http://www.spigotmc.org/resources/protocollib.1997/) 14 | 15 | ### Building 16 | You can compile this project yourself by using the latest version of Maven. 17 | 18 | 19 | ### Remarks 20 | This project was mostly generated by a [script](https://github.com/aadnk/Wrappit). 21 | --------------------------------------------------------------------------------