Skip to content

Commit

Permalink
Create SetHealthPacket.java
Browse files Browse the repository at this point in the history
  • Loading branch information
NycuRO authored Sep 6, 2016
1 parent eff0656 commit 1a305f2
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.itxtech.synapseapi.network.protocol.mcpe;

import cn.nukkit.network.protocol.DataPacket;
import cn.nukkit.network.protocol.ProtocolInfo;

public class SetHealthPacket extends DataPacket {
public static final byte NETWORK_ID = ProtocolInfo.SET_HEALTH_PACKET;

public int health;

@Override
public byte pid() {
return NETWORK_ID;
}

@Override
public void decode() {
this.health = this.getInt();
}

@Override
public void encode() {
this.reset();
this.putInt(this.health);
}

}

0 comments on commit 1a305f2

Please sign in to comment.