forked from aadnk/PacketWrapper
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
831 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientBoatMove.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* This file is part of PacketWrapper. | ||
* Copyright (C) 2012-2015 Kristian S. Strangeland | ||
* Copyright (C) 2015 dmulloy2 | ||
* | ||
* PacketWrapper is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PacketWrapper 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 Lesser General Public License | ||
* along with PacketWrapper. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.comphenix.packetwrapper; | ||
|
||
import com.comphenix.protocol.PacketType; | ||
import com.comphenix.protocol.events.PacketContainer; | ||
|
||
public class WrapperPlayClientBoatMove extends AbstractPacket { | ||
|
||
public static final PacketType TYPE = PacketType.Play.Client.BOAT_MOVE; | ||
|
||
public WrapperPlayClientBoatMove() { | ||
super(new PacketContainer(TYPE), TYPE); | ||
handle.getModifier().writeDefaults(); | ||
} | ||
|
||
public WrapperPlayClientBoatMove(PacketContainer packet) { | ||
super(packet, TYPE); | ||
} | ||
|
||
// TODO Figure out what these fields mean | ||
|
||
public boolean getFlag() { | ||
return handle.getBooleans().read(0); | ||
} | ||
|
||
public void setFlag(boolean value) { | ||
handle.getBooleans().write(0, value); | ||
} | ||
|
||
public boolean getFlag1() { | ||
return handle.getBooleans().read(1); | ||
} | ||
|
||
public void setFlag1(boolean value) { | ||
handle.getBooleans().write(1, value); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientUseItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/** | ||
* This file is part of PacketWrapper. | ||
* Copyright (C) 2012-2015 Kristian S. Strangeland | ||
* Copyright (C) 2015 dmulloy2 | ||
* | ||
* PacketWrapper is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PacketWrapper 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 Lesser General Public License | ||
* along with PacketWrapper. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.comphenix.packetwrapper; | ||
|
||
import com.comphenix.protocol.PacketType; | ||
import com.comphenix.protocol.events.PacketContainer; | ||
import com.comphenix.protocol.wrappers.BlockPosition; | ||
|
||
public class WrapperPlayClientUseItem extends AbstractPacket { | ||
|
||
public static final PacketType TYPE = PacketType.Play.Client.USE_ITEM; | ||
|
||
public WrapperPlayClientUseItem() { | ||
super(new PacketContainer(TYPE), TYPE); | ||
handle.getModifier().writeDefaults(); | ||
} | ||
|
||
public WrapperPlayClientUseItem(PacketContainer packet) { | ||
super(packet, TYPE); | ||
} | ||
|
||
/** | ||
* Retrieve Location. | ||
* <p> | ||
* Notes: block position | ||
* @return The current Location | ||
*/ | ||
public BlockPosition getLocation() { | ||
return handle.getBlockPositionModifier().read(0); | ||
} | ||
|
||
/** | ||
* Set Location. | ||
* @param value - new value. | ||
*/ | ||
public void setLocation(BlockPosition value) { | ||
handle.getBlockPositionModifier().write(0, value); | ||
} | ||
|
||
// TODO EnumDirection -> face | ||
|
||
// TODO EnumHand -> hand | ||
|
||
/** | ||
* Retrieve Cursor Position X. | ||
* <p> | ||
* Notes: the position of the crosshair on the block, from 0 to 15 increasing from west to east | ||
* @return The current Cursor Position X | ||
*/ | ||
public float getCursorPositionX() { | ||
return handle.getFloat().read(0); | ||
} | ||
|
||
/** | ||
* Set Cursor Position X. | ||
* @param value - new value. | ||
*/ | ||
public void setCursorPositionX(float value) { | ||
handle.getFloat().write(0, value); | ||
} | ||
|
||
/** | ||
* Retrieve Cursor Position Y. | ||
* <p> | ||
* Notes: the position of the crosshair on the block, from 0 to 15 increasing from bottom to top | ||
* @return The current Cursor Position Y | ||
*/ | ||
public float getCursorPositionY() { | ||
return handle.getFloat().read(1); | ||
} | ||
|
||
/** | ||
* Set Cursor Position Y. | ||
* @param value - new value. | ||
*/ | ||
public void setCursorPositionY(float value) { | ||
handle.getFloat().write(1, value); | ||
} | ||
|
||
/** | ||
* Retrieve Cursor Position Z. | ||
* <p> | ||
* Notes: the position of the crosshair on the block, from 0 to 15 increasing from north to south | ||
* @return The current Cursor Position Z | ||
*/ | ||
public float getCursorPositionZ() { | ||
return handle.getFloat().read(2); | ||
} | ||
|
||
/** | ||
* Set Cursor Position Z. | ||
* @param value - new value. | ||
*/ | ||
public void setCursorPositionZ(float value) { | ||
handle.getFloat().write(2, value); | ||
} | ||
|
||
} |
Oops, something went wrong.