SteamWar/FightSystem
Archiviert
13
1

Make April Great Again #241

Manuell gemergt
YoyoNow hat 2 Commits von adding_billo_april nach master 2021-03-31 23:56:45 +02:00 zusammengeführt
Nur Änderungen aus Commit 4856fe2380 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -23,6 +23,7 @@ import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketContainer;
import de.steamwar.fightsystem.ArenaMode; import de.steamwar.fightsystem.ArenaMode;
import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.FightState;
import de.steamwar.fightsystem.states.StateDependentListener; import de.steamwar.fightsystem.states.StateDependentListener;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
@ -95,17 +96,19 @@ public class DenyWorldInteraction implements Listener {
@EventHandler() @EventHandler()
public void onPlayerJoin(PlayerJoinEvent event) { public void onPlayerJoin(PlayerJoinEvent event) {
PacketContainer demo = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.GAME_STATE_CHANGE); if(FightSystem.ISAPRIL) {
demo.getBytes().write(0, (byte) 5); PacketContainer demo = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.GAME_STATE_CHANGE);
demo.getFloat().write(0, 0F); demo.getBytes().write(0, (byte) 5);
PacketContainer rain = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.GAME_STATE_CHANGE); demo.getFloat().write(0, 0F);
rain.getBytes().write(0, (byte) 7); PacketContainer rain = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.GAME_STATE_CHANGE);
rain.getFloat().write(0, 5F); rain.getBytes().write(0, (byte) 7);
try { rain.getFloat().write(0, 5F);
ProtocolLibrary.getProtocolManager().sendServerPacket(event.getPlayer(), demo); try {
ProtocolLibrary.getProtocolManager().sendServerPacket(event.getPlayer(), rain); ProtocolLibrary.getProtocolManager().sendServerPacket(event.getPlayer(), demo);
} catch (InvocationTargetException e) { ProtocolLibrary.getProtocolManager().sendServerPacket(event.getPlayer(), rain);
throw new SecurityException("Screw this", e); } catch (InvocationTargetException e) {
throw new SecurityException("Screw this", e);
}
} }
} }
} }