package protocolsupport.protocol.packet.middle.clientbound.play;

import io.netty.buffer.ByteBuf;
import protocolsupport.protocol.packet.middle.ClientBoundMiddlePacket;
import protocolsupport.protocol.serializer.MiscSerializer;
import protocolsupport.protocol.storage.netcache.ClientCache;
import protocolsupport.protocol.utils.EnumConstantLookups.EnumConstantLookup;

public abstract class MiddleGameStateChange extends ClientBoundMiddlePacket {

	protected final ClientCache clientCache = cache.getClientCache();

	public MiddleGameStateChange(MiddlePacketInit init) {
		super(init);
	}

	protected Action action;
	protected float value;

	@Override
	protected void decode(ByteBuf serverdata) {
		action = MiscSerializer.readByteEnum(serverdata, Action.CONSTANT_LOOKUP);
		value = serverdata.readFloat();
	}

	@Override
	protected void handle() {
		clientCache.setRespawnScreenEnabled(value == 0);
	}

	protected static enum Action {
		SHOW_MESSAGE_INVALID_BED,
		RAIN_END,
		RAIN_START,
		SET_GAMEMODE,
		PERFORM_EXIT_END,
		SHOW_MESSAGE_DEMO,
		PLAY_SOUND_ARROW_HIT,
		SET_THUNDER_FADE_VALUE,
		SET_THUNDER_FADE_TIME,
		PLAY_SOUND_PUFFERFISH_STING,
		PLAY_EFFECT_ELDERGUARDIAN,
		SET_RESPAWN_SCREEN_ENABLED;

		public static final EnumConstantLookup<Action> CONSTANT_LOOKUP = new EnumConstantLookup<>(Action.class);
	}

}

@@ -842,16 +842,70 @@
 dle() %7B%0A
+%09%09if (action == Action.SET_RESPAWN_SCREEN_ENABLED) %7B%0A%09
 %09%09client
@@ -947,16 +947,20 @@
  == 0);%0A
+%09%09%7D%0A
 %09%7D%0A%0A%09pro

Fix handling respawn screen enabled state