Archived
0

PlayerAbilities

This commit is contained in:
2018-04-19 08:24:59 +03:00
parent f839be6079
commit 8381eef8ca
3 changed files with 32 additions and 0 deletions

View File

@@ -80,6 +80,14 @@ public class PacketHandler extends SimpleChannelInboundHandler<CSPacket> {
spawnPkt.setLocation(spawnLoc); spawnPkt.setLocation(spawnLoc);
channel.write(spawnPkt); 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(); PositionAndLookPacket pkt = new PositionAndLookPacket();
pkt.setLocation(new Location(0, 0, 0)); pkt.setLocation(new Location(0, 0, 0));
pkt.setStance(0); pkt.setStance(0);

View File

@@ -16,6 +16,7 @@ public class PacketManager {
.put(0x02, HandshakePacket.class) .put(0x02, HandshakePacket.class)
.put(0x06, SpawnPositionPacket.class) .put(0x06, SpawnPositionPacket.class)
.put(0x0D, PositionAndLookPacket.class) .put(0x0D, PositionAndLookPacket.class)
.put(0xCA, PlayerAbilitiesPacket.class)
.put(0xFE, PingPacket.class) .put(0xFE, PingPacket.class)
.put(0xFF, KickPacket.class) .put(0xFF, KickPacket.class)
.build(); .build();

View File

@@ -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];
}
}