Change Game State
This commit is contained in:
@@ -85,6 +85,7 @@ public enum State {
|
||||
.put(BossBarPacket.class, 0x0C)
|
||||
.put(ChatMessageServerPacket.class, 0x0F)
|
||||
.put(PluginMessagePacket.class, 0x18)
|
||||
.put(ChangeGameState.class, 0x1E)
|
||||
.put(KeepAlivePacket.class, 0x1F)
|
||||
.put(JoinGamePacket.class, 0x23)
|
||||
.put(PlayerAbilitiesPacket.class, 0x2C)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* DmitriyMX <dimon550@gmail.com>
|
||||
* 2018-07-27
|
||||
*/
|
||||
package mc.core.network.proto_1_12_2.packets;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import mc.core.network.NetOutputStream;
|
||||
import mc.core.network.SCPacket;
|
||||
|
||||
@Setter
|
||||
public class ChangeGameState implements SCPacket {
|
||||
@RequiredArgsConstructor
|
||||
public enum Reason {
|
||||
INVALID_BED(0), // Would be used to switch between messages, but the only used message is 0 for invalid bed (wat?)
|
||||
RAINING_END(1),
|
||||
RAINING_BEGIN(2),
|
||||
CHANGE_GAMEMODE(3), // 0: Survival, 1: Creative, 2: Adventure, 3: Spectator
|
||||
ARROW_HITTING_PLAYER(6), // Appears to be played when an arrow strikes another player in Multiplayer
|
||||
FADE_VALUE(7), // The current darkness value. 1 = Dark, 0 = Bright, Setting the value higher causes the game to change color and freeze
|
||||
FADE_TIME(8), // Time in ticks for the sky to fade
|
||||
GUARDIAN_APPEARANCE(10); // Play elder guardian mob appearance (effect and sound)
|
||||
|
||||
private final int id;
|
||||
}
|
||||
|
||||
private Reason reason;
|
||||
private float value;
|
||||
|
||||
@Override
|
||||
public void writeSelf(NetOutputStream netStream) {
|
||||
netStream.writeUnsignedByte(reason.id);
|
||||
netStream.writeFloat(value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user