PlayerAbilities
This commit is contained in:
@@ -80,6 +80,14 @@ public class PacketHandler extends SimpleChannelInboundHandler<CSPacket> {
|
||||
spawnPkt.setLocation(spawnLoc);
|
||||
channel.write(spawnPkt);
|
||||
|
||||
// send Player abilities
|
||||
PlayerAbilitiesPacket abilitiesPkt = new PlayerAbilitiesPacket();
|
||||
abilitiesPkt.setCanFly(true);
|
||||
abilitiesPkt.setFlying(true);
|
||||
abilitiesPkt.setGodMode(true);
|
||||
abilitiesPkt.setInstantDestroyBlocks(true);
|
||||
channel.write(abilitiesPkt);
|
||||
|
||||
PositionAndLookPacket pkt = new PositionAndLookPacket();
|
||||
pkt.setLocation(new Location(0, 0, 0));
|
||||
pkt.setStance(0);
|
||||
|
||||
@@ -16,6 +16,7 @@ public class PacketManager {
|
||||
.put(0x02, HandshakePacket.class)
|
||||
.put(0x06, SpawnPositionPacket.class)
|
||||
.put(0x0D, PositionAndLookPacket.class)
|
||||
.put(0xCA, PlayerAbilitiesPacket.class)
|
||||
.put(0xFE, PingPacket.class)
|
||||
.put(0xFF, KickPacket.class)
|
||||
.build();
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* DmitriyMX <dimon550@gmail.com>
|
||||
* 2018-04-19
|
||||
*/
|
||||
package mc.core.network.proto_125.packets;
|
||||
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import mc.core.network.SCPacket;
|
||||
|
||||
@Setter
|
||||
@ToString
|
||||
public class PlayerAbilitiesPacket implements SCPacket {
|
||||
private boolean godMode = false;
|
||||
private boolean flying = false;
|
||||
private boolean canFly = false;
|
||||
private boolean instantDestroyBlocks = false;
|
||||
|
||||
@Override
|
||||
public byte[] toByteArray() {
|
||||
return new byte[0];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user