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
31 changed files
with
1,829 additions
and
78 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
56 changes: 56 additions & 0 deletions
56
...tWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientDifficultyChange.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,56 @@ | ||
/** | ||
* 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.EnumWrappers.Difficulty; | ||
|
||
public class WrapperPlayClientDifficultyChange extends AbstractPacket { | ||
|
||
public static final PacketType TYPE = PacketType.Play.Client.DIFFICULTY_CHANGE; | ||
|
||
public WrapperPlayClientDifficultyChange() { | ||
super(new PacketContainer(TYPE), TYPE); | ||
handle.getModifier().writeDefaults(); | ||
} | ||
|
||
public WrapperPlayClientDifficultyChange(PacketContainer packet) { | ||
super(packet, TYPE); | ||
} | ||
|
||
/** | ||
* Retrieve New difficulty. | ||
* <p> | ||
* Notes: 0: peaceful, 1: easy, 2: normal, 3: hard | ||
* @return The current New difficulty | ||
*/ | ||
public Difficulty getNewDifficulty() { | ||
return handle.getDifficulties().read(0); | ||
} | ||
|
||
/** | ||
* Set New difficulty. | ||
* @param value - new value. | ||
*/ | ||
public void setNewDifficulty(Difficulty value) { | ||
handle.getDifficulties().write(0, value); | ||
} | ||
|
||
} |
53 changes: 53 additions & 0 deletions
53
PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientDifficultyLock.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,53 @@ | ||
/** | ||
* 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 WrapperPlayClientDifficultyLock extends AbstractPacket { | ||
|
||
public static final PacketType TYPE = PacketType.Play.Client.DIFFICULTY_LOCK; | ||
|
||
public WrapperPlayClientDifficultyLock() { | ||
super(new PacketContainer(TYPE), TYPE); | ||
handle.getModifier().writeDefaults(); | ||
} | ||
|
||
public WrapperPlayClientDifficultyLock(PacketContainer packet) { | ||
super(packet, TYPE); | ||
} | ||
|
||
/** | ||
* Retrieve Locked. | ||
* @return The current Locked | ||
*/ | ||
public boolean getLocked() { | ||
return handle.getBooleans().read(0); | ||
} | ||
|
||
/** | ||
* Set Locked. | ||
* @param value - new value. | ||
*/ | ||
public void setLocked(boolean value) { | ||
handle.getBooleans().write(0, value); | ||
} | ||
|
||
} |
107 changes: 107 additions & 0 deletions
107
PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientSetJigsaw.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,107 @@ | ||
/** | ||
* 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; | ||
import com.comphenix.protocol.wrappers.MinecraftKey; | ||
|
||
public class WrapperPlayClientSetJigsaw extends AbstractPacket { | ||
|
||
public static final PacketType TYPE = PacketType.Play.Client.SET_JIGSAW; | ||
|
||
public WrapperPlayClientSetJigsaw() { | ||
super(new PacketContainer(TYPE), TYPE); | ||
handle.getModifier().writeDefaults(); | ||
} | ||
|
||
public WrapperPlayClientSetJigsaw(PacketContainer packet) { | ||
super(packet, TYPE); | ||
} | ||
|
||
/** | ||
* Retrieve Location. | ||
* <p> | ||
* Notes: block entity location | ||
* @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); | ||
} | ||
|
||
/** | ||
* Retrieve Attachment type. | ||
* @return The current Attachment type | ||
*/ | ||
public MinecraftKey getAttachmentType() { | ||
return handle.getMinecraftKeys().read(0); | ||
} | ||
|
||
/** | ||
* Set Attachment type. | ||
* @param value - new value. | ||
*/ | ||
public void setAttachmentType(MinecraftKey value) { | ||
handle.getMinecraftKeys().write(0, value); | ||
} | ||
|
||
/** | ||
* Retrieve Target pool. | ||
* @return The current Target pool | ||
*/ | ||
public MinecraftKey getTargetPool() { | ||
return handle.getMinecraftKeys().read(1); | ||
} | ||
|
||
/** | ||
* Set Target pool. | ||
* @param value - new value. | ||
*/ | ||
public void setTargetPool(MinecraftKey value) { | ||
handle.getMinecraftKeys().write(1, value); | ||
} | ||
|
||
/** | ||
* Retrieve Final state. | ||
* <p> | ||
* Notes: "Turns into" on the GUI, final_state in NBT | ||
* @return The current Final state | ||
*/ | ||
public String getFinalState() { | ||
return handle.getStrings().read(0); | ||
} | ||
|
||
/** | ||
* Set Final state. | ||
* @param value - new value. | ||
*/ | ||
public void setFinalState(String value) { | ||
handle.getStrings().write(0, value); | ||
} | ||
|
||
} |
Oops, something went wrong.