diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2022-07-30 18:49:18 -0400 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2022-07-30 18:49:18 -0400 |
commit | a353e29246f2d86ccd771734791f525420c1cf34 (patch) | |
tree | bddea92785b30e7e57a0d332e8029a04be4bbcab /src/main/java/net/tylermurphy/hideAndSeek/util/packet/BlockChangePacket.java | |
parent | better hitboxes for blockhunt (diff) | |
download | kenshinshideandseek-a353e29246f2d86ccd771734791f525420c1cf34.tar.gz kenshinshideandseek-a353e29246f2d86ccd771734791f525420c1cf34.tar.bz2 kenshinshideandseek-a353e29246f2d86ccd771734791f525420c1cf34.zip |
refactoring and blockhunt disguise bug fixes
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/util/packet/BlockChangePacket.java')
-rw-r--r-- | src/main/java/net/tylermurphy/hideAndSeek/util/packet/BlockChangePacket.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/util/packet/BlockChangePacket.java b/src/main/java/net/tylermurphy/hideAndSeek/util/packet/BlockChangePacket.java new file mode 100644 index 0000000..53f3f9c --- /dev/null +++ b/src/main/java/net/tylermurphy/hideAndSeek/util/packet/BlockChangePacket.java @@ -0,0 +1,24 @@ +package net.tylermurphy.hideAndSeek.util.packet; + +import com.comphenix.protocol.PacketType; +import com.comphenix.protocol.wrappers.BlockPosition; +import com.comphenix.protocol.wrappers.WrappedBlockData; +import org.bukkit.Location; +import org.bukkit.Material; +import org.jetbrains.annotations.NotNull; + +public class BlockChangePacket extends AbstractPacket { + + public BlockChangePacket(){ + super(PacketType.Play.Server.BLOCK_CHANGE); + } + + public void setBlockPosition(@NotNull Location location){ + super.packet.getBlockPositionModifier().write(0, new BlockPosition(location.toVector())); + } + + public void setMaterial(Material material){ + super.packet.getBlockData().write(0, WrappedBlockData.createData(material)); + } + +} |