Merge pull request 'Remove the april fools joke' (#246) from removeApril into master
Reviewed-on: #246 Reviewed-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Commit
b63c51811f
@ -42,14 +42,12 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public class FightSystem extends JavaPlugin {
|
public class FightSystem extends JavaPlugin {
|
||||||
|
|
||||||
public static final String PREFIX = "§eArena§8» ";
|
public static final String PREFIX = "§eArena§8» ";
|
||||||
private static FightSystem plugin;
|
private static FightSystem plugin;
|
||||||
public static boolean ISAPRIL = false;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
@ -145,9 +143,6 @@ public class FightSystem extends JavaPlugin {
|
|||||||
}else if(Config.mode == ArenaMode.PREPARE) {
|
}else if(Config.mode == ArenaMode.PREPARE) {
|
||||||
Fight.getBlueTeam().setSchem(Schematic.getSchemFromDB(Config.PrepareSchemID));
|
Fight.getBlueTeam().setSchem(Schematic.getSchemFromDB(Config.PrepareSchemID));
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalDate date = LocalDate.now();
|
|
||||||
ISAPRIL = date.getDayOfMonth() == 1 && date.getMonthValue() == 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -19,11 +19,7 @@
|
|||||||
|
|
||||||
package de.steamwar.fightsystem.listener;
|
package de.steamwar.fightsystem.listener;
|
||||||
|
|
||||||
import com.comphenix.protocol.PacketType;
|
|
||||||
import com.comphenix.protocol.ProtocolLibrary;
|
|
||||||
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;
|
||||||
@ -36,11 +32,8 @@ import org.bukkit.event.entity.EntityExplodeEvent;
|
|||||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.inventory.InventoryDragEvent;
|
import org.bukkit.event.inventory.InventoryDragEvent;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
|
||||||
import org.bukkit.event.player.PlayerKickEvent;
|
import org.bukkit.event.player.PlayerKickEvent;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
|
|
||||||
public class DenyWorldInteraction implements Listener {
|
public class DenyWorldInteraction implements Listener {
|
||||||
|
|
||||||
public DenyWorldInteraction() {
|
public DenyWorldInteraction() {
|
||||||
@ -93,22 +86,4 @@ public class DenyWorldInteraction implements Listener {
|
|||||||
BasicListener.toActionbar(player, TextComponent.fromLegacyText("§cDu darfst den Bogen erst nach Kampfbeginn nutzen!"));
|
BasicListener.toActionbar(player, TextComponent.fromLegacyText("§cDu darfst den Bogen erst nach Kampfbeginn nutzen!"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
|
||||||
if(FightSystem.ISAPRIL) {
|
|
||||||
PacketContainer demo = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.GAME_STATE_CHANGE);
|
|
||||||
demo.getIntegers().write(0, 5);
|
|
||||||
demo.getFloat().write(0, 0F);
|
|
||||||
PacketContainer rain = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.GAME_STATE_CHANGE);
|
|
||||||
rain.getIntegers().write(0, 7);
|
|
||||||
rain.getFloat().write(0, 5F);
|
|
||||||
try {
|
|
||||||
ProtocolLibrary.getProtocolManager().sendServerPacket(event.getPlayer(), demo);
|
|
||||||
ProtocolLibrary.getProtocolManager().sendServerPacket(event.getPlayer(), rain);
|
|
||||||
} catch (InvocationTargetException e) {
|
|
||||||
throw new SecurityException("Screw this", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren