Skip to content

Commit

Permalink
credit screen cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed May 15, 2024
1 parent fa21665 commit 8ce9996
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
7 changes: 0 additions & 7 deletions src/main/java/org/cloudanarchy/queueplugin/EventCanceler.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,6 @@ public void onPacketSending(PacketEvent ev) {
return;
}

// this is for fun
if (ev.getPacketType() == PacketType.Play.Server.GAME_STATE_CHANGE) {
PacketGameState packet = new PacketGameState(ev.getPacket());
// allow credit screen
if (packet.getReason() == 4 && packet.getValue() == 1) return;
}

ev.setCancelled(true);
}

Expand Down
10 changes: 0 additions & 10 deletions src/main/java/org/cloudanarchy/queueplugin/QueuePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.cloudanarchy.queueplugin.packetwrapper.PacketGameState;
import org.jetbrains.annotations.NotNull;

public final class QueuePlugin extends JavaPlugin implements Listener {

private static final PacketGameState creditScreenPacket = PacketGameState.creditScreenPacket();

private void process(@NotNull Player player) {
player.teleport(new Location(getServer().getWorlds().get(0), 0, 140, 0));
player.setAllowFlight(true);
Expand All @@ -33,13 +30,6 @@ private void process(@NotNull Player player) {
player.hidePlayer(this, p);
p.hidePlayer(this, player);
}
// win blockgame while some other players are in queue
if (getServer().getOnlinePlayers().size() < 4) return;
try {
creditScreenPacket.sendPacket(player);
} catch (RuntimeException ex) {
getLogger().warning("Unable to send fake packet: " + ex.getMessage());
}
}

@Override
Expand Down

0 comments on commit 8ce9996

Please sign in to comment.