diff --git a/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerDeathCombatEvent.java b/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerDeathCombatEvent.java new file mode 100644 index 00000000..fd77d2cc --- /dev/null +++ b/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerDeathCombatEvent.java @@ -0,0 +1,91 @@ +/** + * PacketWrapper - ProtocolLib wrappers for Minecraft packets + * Copyright (C) dmulloy2 + * Copyright (C) Kristian S. Strangeland + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.comphenix.packetwrapper; + +import com.comphenix.protocol.PacketType; +import com.comphenix.protocol.events.PacketContainer; +import com.comphenix.protocol.wrappers.EnumWrappers.CombatEventType; +import com.comphenix.protocol.wrappers.WrappedChatComponent; + +public class WrapperPlayServerDeathCombatEvent extends AbstractPacket { + public static final PacketType TYPE = PacketType.Play.Server.PLAYER_COMBAT_KILL; + + public WrapperPlayServerDeathCombatEvent() { + super(new PacketContainer(TYPE), TYPE); + handle.getModifier().writeDefaults(); + } + + public WrapperPlayServerDeathCombatEvent(PacketContainer packet) { + super(packet, TYPE); + } + + /** + * Retrieve Player ID. + * + * @return The current Player ID + */ + public int getPlayerID() { + return handle.getIntegers().read(0); + } + + /** + * Set Player ID. + * + * @param value - the player's id to send the death screen to (should match client's id) + */ + public void setPlayerId(int value) { + handle.getIntegers().write(0, value); + } + + /** + * Retrieve Entity ID. + * + * @return The current Entity ID + */ + public int getEntityID() { + return handle.getIntegers().read(1); + } + + /** + * Set Entity ID. + * + * @param value - the killer's entity id (-1 if no obvious killer) + */ + public void setEntityId(int value) { + handle.getIntegers().write(1, value); + } + + /** + * Retrieve Message. + * + * @return The current Message + */ + public WrappedChatComponent getMessage() { + return handle.getChatComponents().read(0); + } + + /** + * Set Message. + * + * @param value - the message shown on the death screen + */ + public void setMessage(WrappedChatComponent value) { + handle.getChatComponents().write(0, value); + } +} \ No newline at end of file diff --git a/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerSetTitleSubtitle.java b/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerSetTitleSubtitle.java new file mode 100644 index 00000000..855b9102 --- /dev/null +++ b/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerSetTitleSubtitle.java @@ -0,0 +1,55 @@ +/** + * PacketWrapper - ProtocolLib wrappers for Minecraft packets + * Copyright (C) dmulloy2 + * Copyright (C) Kristian S. Strangeland + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.comphenix.packetwrapper; + +import com.comphenix.protocol.PacketType; +import com.comphenix.protocol.events.PacketContainer; +import com.comphenix.protocol.wrappers.EnumWrappers.TitleAction; +import com.comphenix.protocol.wrappers.WrappedChatComponent; + +public class WrapperPlayServerSetTitleSubtitle extends AbstractPacket { + public static final PacketType TYPE = PacketType.Play.Server.SET_SUBTITLE_TEXT; + + public WrapperPlayServerSetTitleSubtitle() { + super(new PacketContainer(TYPE), TYPE); + handle.getModifier().writeDefaults(); + } + + public WrapperPlayServerSetTitleSubtitle(PacketContainer packet) { + super(packet, TYPE); + } + + /** + * Retrieve Subtitle Text. + * + * @return The current Subtitle Text + */ + public WrappedChatComponent getSubtitle() { + return handle.getChatComponents().read(0); + } + + /** + * Set Subtitle Text. + * + * @param value - new value + */ + public void setSubtitle(WrappedChatComponent value) { + handle.getChatComponents().write(0, value); + } +} diff --git a/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerSetTitleText.java b/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerSetTitleText.java new file mode 100644 index 00000000..c06d1cd6 --- /dev/null +++ b/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerSetTitleText.java @@ -0,0 +1,57 @@ +/** + * PacketWrapper - ProtocolLib wrappers for Minecraft packets + * Copyright (C) dmulloy2 + * Copyright (C) Kristian S. Strangeland + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.comphenix.packetwrapper; + +import com.comphenix.protocol.PacketType; +import com.comphenix.protocol.events.PacketContainer; +import com.comphenix.protocol.wrappers.EnumWrappers.TitleAction; +import com.comphenix.protocol.wrappers.WrappedChatComponent; + +public class WrapperPlayServerSetTitleText extends AbstractPacket { + public static final PacketType TYPE = PacketType.Play.Server.SET_TITLE_TEXT; + + public WrapperPlayServerSetTitleText() { + super(new PacketContainer(TYPE), TYPE); + handle.getModifier().writeDefaults(); + } + + public WrapperPlayServerSetTitleText(PacketContainer packet) { + super(packet, TYPE); + } + + /** + * Retrieve Title Text. + *

+ * Notes: chat + * + * @return The current Title Text + */ + public WrappedChatComponent getTitle() { + return handle.getChatComponents().read(0); + } + + /** + * Set Title Text + * + * @param value - new value. + */ + public void setTitle(WrappedChatComponent value) { + handle.getChatComponents().write(0, value); + } +} diff --git a/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerSetTitleTimes.java b/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerSetTitleTimes.java new file mode 100644 index 00000000..b221286c --- /dev/null +++ b/PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerSetTitleTimes.java @@ -0,0 +1,91 @@ +/** + * PacketWrapper - ProtocolLib wrappers for Minecraft packets + * Copyright (C) dmulloy2 + * Copyright (C) Kristian S. Strangeland + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.comphenix.packetwrapper; + +import com.comphenix.protocol.PacketType; +import com.comphenix.protocol.events.PacketContainer; +import com.comphenix.protocol.wrappers.EnumWrappers.TitleAction; +import com.comphenix.protocol.wrappers.WrappedChatComponent; + +public class WrapperPlayServerSetTitleTimes extends AbstractPacket { + public static final PacketType TYPE = PacketType.Play.Server.SET_TITLES_ANIMATION; + + public WrapperPlayServerSetTitleTimes() { + super(new PacketContainer(TYPE), TYPE); + handle.getModifier().writeDefaults(); + } + + public WrapperPlayServerSetTitleTimes(PacketContainer packet) { + super(packet, TYPE); + } + + /** + * Retrieve Fade In. + * + * @return The current Fade In + */ + public int getFadeIn() { + return handle.getIntegers().read(0); + } + + /** + * Set Fade In. + * + * @param value - new value. + */ + public void setFadeIn(int value) { + handle.getIntegers().write(0, value); + } + + /** + * Retrieve Stay. + * + * @return The current Stay + */ + public int getStay() { + return handle.getIntegers().read(1); + } + + /** + * Set Stay. + * + * @param value - new value. + */ + public void setStay(int value) { + handle.getIntegers().write(1, value); + } + + /** + * Retrieve Fade Out. + * + * @return The current Fade Out + */ + public int getFadeOut() { + return handle.getIntegers().read(2); + } + + /** + * Set Fade Out. + * + * @param value - new value. + */ + public void setFadeOut(int value) { + handle.getIntegers().write(2, value); + } +}