Dieser Commit ist enthalten in:
Commit
3c4a6decca
@ -19,10 +19,8 @@
|
||||
|
||||
package de.steamwar.fightsystem.utils;
|
||||
|
||||
import de.steamwar.core.events.ChunkListener;
|
||||
import de.steamwar.fightsystem.fight.FightWorld;
|
||||
import net.minecraft.server.v1_10_R1.Chunk;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_10_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity;
|
||||
@ -50,9 +48,6 @@ public class CraftbukkitWrapper10 implements CraftbukkitWrapper.ICraftbukkitWrap
|
||||
}
|
||||
chunk.tileEntities.clear();
|
||||
chunk.tileEntities.putAll(backupChunk.tileEntities);
|
||||
for(Player p : Bukkit.getOnlinePlayers()){
|
||||
ChunkListener.sendChunk(p, x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,10 +19,8 @@
|
||||
|
||||
package de.steamwar.fightsystem.utils;
|
||||
|
||||
import de.steamwar.core.events.ChunkListener;
|
||||
import de.steamwar.fightsystem.fight.FightWorld;
|
||||
import net.minecraft.server.v1_12_R1.Chunk;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity;
|
||||
@ -50,9 +48,6 @@ public class CraftbukkitWrapper12 implements CraftbukkitWrapper.ICraftbukkitWrap
|
||||
}
|
||||
chunk.tileEntities.clear();
|
||||
chunk.tileEntities.putAll(backupChunk.tileEntities);
|
||||
for(Player p : Bukkit.getOnlinePlayers()){
|
||||
ChunkListener.sendChunk(p, x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,10 +19,8 @@
|
||||
|
||||
package de.steamwar.fightsystem.utils;
|
||||
|
||||
import de.steamwar.core.events.ChunkListener;
|
||||
import de.steamwar.fightsystem.fight.FightWorld;
|
||||
import net.minecraft.server.v1_14_R1.Chunk;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_14_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
|
||||
@ -51,9 +49,6 @@ public class CraftbukkitWrapper14 implements CraftbukkitWrapper.ICraftbukkitWrap
|
||||
chunk.tileEntities.putAll(backupChunk.tileEntities);
|
||||
chunk.heightMap.clear();
|
||||
chunk.heightMap.putAll(backupChunk.heightMap);
|
||||
for(Player p : Bukkit.getOnlinePlayers()){
|
||||
ChunkListener.sendChunk(p, x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,10 +19,8 @@
|
||||
|
||||
package de.steamwar.fightsystem.utils;
|
||||
|
||||
import de.steamwar.core.events.ChunkListener;
|
||||
import de.steamwar.fightsystem.fight.FightWorld;
|
||||
import net.minecraft.server.v1_15_R1.Chunk;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
|
||||
@ -51,9 +49,6 @@ public class CraftbukkitWrapper15 implements CraftbukkitWrapper.ICraftbukkitWrap
|
||||
chunk.tileEntities.putAll(backupChunk.tileEntities);
|
||||
chunk.heightMap.clear();
|
||||
chunk.heightMap.putAll(backupChunk.heightMap);
|
||||
for(Player p : Bukkit.getOnlinePlayers()){
|
||||
ChunkListener.sendChunk(p, x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,9 +19,7 @@
|
||||
|
||||
package de.steamwar.fightsystem.utils;
|
||||
|
||||
import de.steamwar.core.events.ChunkListener;
|
||||
import net.minecraft.server.v1_8_R3.Chunk;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
@ -47,9 +45,6 @@ public class CraftbukkitWrapper8 implements CraftbukkitWrapper.ICraftbukkitWrapp
|
||||
w.tileEntityList.removeAll(chunk.tileEntities.values());
|
||||
chunk.tileEntities.clear();
|
||||
chunk.tileEntities.putAll(backupChunk.tileEntities);
|
||||
for(Player p : Bukkit.getOnlinePlayers()){
|
||||
ChunkListener.sendChunk(p, x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,10 +19,8 @@
|
||||
|
||||
package de.steamwar.fightsystem.utils;
|
||||
|
||||
import de.steamwar.core.events.ChunkListener;
|
||||
import de.steamwar.fightsystem.fight.FightWorld;
|
||||
import net.minecraft.server.v1_9_R2.Chunk;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_9_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_9_R2.entity.CraftEntity;
|
||||
@ -50,9 +48,6 @@ public class CraftbukkitWrapper9 implements CraftbukkitWrapper.ICraftbukkitWrapp
|
||||
}
|
||||
chunk.tileEntities.clear();
|
||||
chunk.tileEntities.putAll(backupChunk.tileEntities);
|
||||
for(Player p : Bukkit.getOnlinePlayers()){
|
||||
ChunkListener.sendChunk(p, x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -48,7 +48,7 @@ public enum ArenaMode {
|
||||
public static final Set<ArenaMode> AntiPrepare = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(PREPARE)));
|
||||
public static final Set<ArenaMode> VariableTeams = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(RANKED, EVENT, REPLAY)));
|
||||
public static final Set<ArenaMode> RankedEvent = Collections.unmodifiableSet(EnumSet.of(RANKED, EVENT, REPLAY));
|
||||
public static final Set<ArenaMode> Restartable = Collections.unmodifiableSet(EnumSet.of(NORMAL, RANKED, REPLAY));
|
||||
public static final Set<ArenaMode> Restartable = Collections.unmodifiableSet(EnumSet.of(NORMAL, RANKED));
|
||||
public static final Set<ArenaMode> NotRestartable = Collections.unmodifiableSet(EnumSet.of(EVENT, REPLAY));
|
||||
public static final Set<ArenaMode> SoloLeader = Collections.unmodifiableSet(EnumSet.of(TEST, CHECK, PREPARE));
|
||||
public static final Set<ArenaMode> NotOnBau = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(TEST, CHECK, PREPARE, REPLAY)));
|
||||
|
@ -123,6 +123,8 @@ public class FightSystem extends JavaPlugin {
|
||||
new KitCommand();
|
||||
new RemoveCommand();
|
||||
new AcceptCommand();
|
||||
new WGCommand();
|
||||
new TBCommand();
|
||||
new DeclineCommand();
|
||||
new GamemodeCommand();
|
||||
new InviteCommand();
|
||||
|
45
FightSystem_Core/src/de/steamwar/fightsystem/commands/TBCommand.java
Normale Datei
45
FightSystem_Core/src/de/steamwar/fightsystem/commands/TBCommand.java
Normale Datei
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2020 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.fightsystem.commands;
|
||||
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentCommand;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class TBCommand implements CommandExecutor {
|
||||
|
||||
public TBCommand() {
|
||||
new StateDependentCommand(ArenaMode.Check, FightState.All, "resettb", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if(!(sender instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
Fight.getRedTeam().pasteSchem();
|
||||
return false;
|
||||
}
|
||||
}
|
45
FightSystem_Core/src/de/steamwar/fightsystem/commands/WGCommand.java
Normale Datei
45
FightSystem_Core/src/de/steamwar/fightsystem/commands/WGCommand.java
Normale Datei
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2020 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.fightsystem.commands;
|
||||
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentCommand;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class WGCommand implements CommandExecutor {
|
||||
|
||||
public WGCommand() {
|
||||
new StateDependentCommand(ArenaMode.Check, FightState.All, "resetwg", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if(!(sender instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
Fight.getBlueTeam().pasteSchem();
|
||||
return false;
|
||||
}
|
||||
}
|
@ -31,7 +31,7 @@ public class SpectateOverCountdown extends Countdown {
|
||||
|
||||
public SpectateOverCountdown() {
|
||||
super(Config.SpectatorDuration, new Message("SPECTATE_COUNTDOWN"), SWSound.BLOCK_NOTE_PLING, false);
|
||||
new StateDependentCountdown(ArenaMode.Restartable, FightState.Spectate, this);
|
||||
new StateDependentCountdown(ArenaMode.Restartable.contains(Config.mode) || Config.replayserver(), FightState.Spectate, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -321,6 +321,10 @@ public class FightTeam {
|
||||
return ready;
|
||||
}
|
||||
|
||||
public void pasteSchem() {
|
||||
testPasteAction();
|
||||
}
|
||||
|
||||
public void pasteSchem(SchematicNode schematic){
|
||||
setSchem(schematic);
|
||||
testPasteAction();
|
||||
|
@ -30,6 +30,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class FightWorld extends StateDependent {
|
||||
|
||||
@ -41,7 +42,7 @@ public class FightWorld extends StateDependent {
|
||||
}
|
||||
|
||||
public FightWorld() {
|
||||
super(ArenaMode.Restartable, FightState.Schem);
|
||||
super(ArenaMode.Restartable.contains(Config.mode) || Config.replayserver(), FightState.Schem);
|
||||
register();
|
||||
}
|
||||
|
||||
@ -72,7 +73,12 @@ public class FightWorld extends StateDependent {
|
||||
|
||||
World backup = new WorldCreator(world.getName() + "/backup").createWorld();
|
||||
assert backup != null;
|
||||
Config.ArenaRegion.forEachChunk((x, z) -> CraftbukkitWrapper.impl.resetChunk(world, backup, x, z));
|
||||
Config.ArenaRegion.forEachChunk((x, z) -> {
|
||||
CraftbukkitWrapper.impl.resetChunk(world, backup, x, z);
|
||||
for(Player p : Bukkit.getOnlinePlayers()) {
|
||||
de.steamwar.core.CraftbukkitWrapper.impl.sendChunk(p, x, z);
|
||||
}
|
||||
});
|
||||
Bukkit.unloadWorld(backup, false);
|
||||
}
|
||||
}
|
@ -21,11 +21,9 @@ package de.steamwar.fightsystem.record;
|
||||
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import de.steamwar.core.Core;
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
import de.steamwar.fightsystem.countdown.Countdown;
|
||||
import de.steamwar.fightsystem.countdown.EventSpectateCountdown;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.fight.FightTeam;
|
||||
import de.steamwar.fightsystem.fight.FreezeWorld;
|
||||
@ -463,17 +461,13 @@ public class PacketProcessor {
|
||||
p.resetTitle();
|
||||
WorldOfColorWrapper.impl.sendTitle(p, title, subtitle, 5, 40, 5);
|
||||
});
|
||||
if(Config.replayserver() || ArenaMode.AntiReplay.contains(Config.mode)) {
|
||||
FightState.setFightState(FightState.SPECTATE);
|
||||
}else{
|
||||
new EventSpectateCountdown().enable();
|
||||
}
|
||||
}
|
||||
|
||||
private void endReplay() {
|
||||
REntity.dieAll();
|
||||
freezer.disable();
|
||||
FightSystem.getMessage().broadcast("REPLAY_ENDS");
|
||||
FightState.setFightState(FightState.SPECTATE);
|
||||
replaying = false;
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@ import com.comphenix.tinyprotocol.Reflection;
|
||||
import com.comphenix.tinyprotocol.TinyProtocol;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import de.steamwar.core.Core;
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.listener.FightScoreboard;
|
||||
import de.steamwar.fightsystem.utils.BlockIdWrapper;
|
||||
@ -39,6 +40,7 @@ import org.bukkit.scoreboard.NameTagVisibility;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class REntity {
|
||||
|
||||
@ -133,7 +135,14 @@ public class REntity {
|
||||
this.entityType = EntityType.PLAYER;
|
||||
this.entityId = entityCount--;
|
||||
|
||||
SteamwarUser user = SteamwarUser.get(userId);
|
||||
SteamwarUser user;
|
||||
try {
|
||||
user = SteamwarUser.get(userId);
|
||||
} catch (SecurityException e) {
|
||||
FightSystem.getPlugin().getLogger().log(Level.SEVERE, "Could not load user " + userId);
|
||||
throw e;
|
||||
}
|
||||
|
||||
this.uuid = user.getUUID();
|
||||
this.name = user.getUserName();
|
||||
entities.put(internalId, this);
|
||||
|
@ -22,8 +22,8 @@ package de.steamwar.fightsystem.utils;
|
||||
import com.comphenix.tinyprotocol.Reflection;
|
||||
import com.google.common.primitives.Bytes;
|
||||
import de.steamwar.core.Core;
|
||||
import de.steamwar.core.CraftbukkitWrapper;
|
||||
import de.steamwar.core.VersionDependent;
|
||||
import de.steamwar.core.events.ChunkListener;
|
||||
import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
@ -234,7 +234,7 @@ public class TechHider extends StateDependent {
|
||||
Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> {
|
||||
for(ChunkPos chunk : chunksToReload){
|
||||
if(bypass(p, chunk.x(), chunk.z()) != hide)
|
||||
ChunkListener.sendChunk(p, chunk.x(), chunk.z());
|
||||
CraftbukkitWrapper.impl.sendChunk(p, chunk.x(), chunk.z());
|
||||
}
|
||||
}, 40);
|
||||
}
|
||||
|
@ -21,4 +21,6 @@ commands:
|
||||
lockreplay:
|
||||
state:
|
||||
skip:
|
||||
win:
|
||||
win:
|
||||
resetwg:
|
||||
resettb:
|
In neuem Issue referenzieren
Einen Benutzer sperren