SteamWar/FightSystem
Archiviert
13
1

Rank-System für die neuen WS und WG #155

Manuell gemergt
Lixfel hat 3 Commits von ranks nach master 2020-05-31 17:15:35 +02:00 zusammengeführt
3 geänderte Dateien mit 28 neuen und 14 gelöschten Zeilen
Nur Änderungen aus Commit c1bb646579 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -58,6 +58,7 @@ public class Config {
public static final int ArenaMinZ; public static final int ArenaMinZ;
public static final int ArenaMaxX; public static final int ArenaMaxX;
public static final int ArenaMaxZ; public static final int ArenaMaxZ;
public static final boolean GroundWalkable;
//schematic parameter //schematic parameter
public static final boolean OnlyPublicSchematics; public static final boolean OnlyPublicSchematics;
@ -154,6 +155,10 @@ public class Config {
BorderFromSchematic = worldconfig.getInt("Arena.BorderFromSchematic"); BorderFromSchematic = worldconfig.getInt("Arena.BorderFromSchematic");
AlignWater = worldconfig.getBoolean("Arena.AlignWater"); AlignWater = worldconfig.getBoolean("Arena.AlignWater");
WaterDepth = worldconfig.getInt("Arena.WaterDepth"); WaterDepth = worldconfig.getInt("Arena.WaterDepth");
GroundWalkable = config.getBoolean("Arena.GroundWalkable");
double teamBlueSpawnOffsetX = worldconfig.getDouble("Arena.SpawnOffset.x");
double teamBlueSpawnOffsetY = worldconfig.getDouble("Arena.SpawnOffset.y");
double teamBlueSpawnOffsetZ = worldconfig.getDouble("Arena.SpawnOffset.z");
SchematicType = de.steamwar.sql.SchematicType.fromDB(config.getString("Schematic.SchematicType")); SchematicType = de.steamwar.sql.SchematicType.fromDB(config.getString("Schematic.SchematicType"));
IgnorePublicOnly = config.getBoolean("Schematic.IgnorePublicOnly"); IgnorePublicOnly = config.getBoolean("Schematic.IgnorePublicOnly");
@ -243,8 +248,14 @@ public class Config {
TeamRedPasteZ = TeamBluePasteZ + TeamBluetoReddistanceZ; TeamRedPasteZ = TeamBluePasteZ + TeamBluetoReddistanceZ;
World world = Bukkit.getWorlds().get(0); World world = Bukkit.getWorlds().get(0);
TeamBlueSpawn = new Location(world, TeamBluePasteX + 0.5, TeamBlueCornerY + (double)SchemsizeY + 0.5, TeamBluePasteZ + 0.5); TeamBlueSpawn = new Location(world,
TeamRedSpawn = new Location(world, TeamRedPasteX + 0.5, TeamRedCornerY + (double)SchemsizeY + 0.5, TeamRedPasteZ + 0.5); TeamBluePasteX + 0.5 + teamBlueSpawnOffsetX,
TeamBlueCornerY + 0.5 + teamBlueSpawnOffsetY,
TeamBluePasteZ + 0.5 + teamBlueSpawnOffsetZ);
TeamRedSpawn = new Location(world,
TeamRedPasteX + 0.5 - teamBlueSpawnOffsetX,
TeamRedCornerY + 0.5 + teamBlueSpawnOffsetY,
TeamRedPasteZ + 0.5 - teamBlueSpawnOffsetZ);
SpecSpawn = new Location(world, SpecSpawn = new Location(world,
TeamBluePasteX + TeamBluetoReddistanceX/2.0, TeamBluePasteX + TeamBluetoReddistanceX/2.0,
TeamBlueCornerY + TeamBluetoReddistanceY/2.0 + SchemsizeY/2.0, TeamBlueCornerY + TeamBluetoReddistanceY/2.0 + SchemsizeY/2.0,

Datei anzeigen

@ -40,13 +40,18 @@ public class PlayerMoveListener extends BasicListener {
boolean inBlueArea = inArenaY && Region.isIn2DRange(to, Config.TeamBlueCornerX, Config.TeamBlueCornerZ, Config.SchemsizeX, Config.SchemsizeZ, Config.BorderFromSchematic); boolean inBlueArea = inArenaY && Region.isIn2DRange(to, Config.TeamBlueCornerX, Config.TeamBlueCornerZ, Config.SchemsizeX, Config.SchemsizeZ, Config.BorderFromSchematic);
boolean inRedArea = inArenaY && Region.isIn2DRange(to, Config.TeamRedCornerX, Config.TeamRedCornerZ, Config.SchemsizeX, Config.SchemsizeZ, Config.BorderFromSchematic); boolean inRedArea = inArenaY && Region.isIn2DRange(to, Config.TeamRedCornerX, Config.TeamRedCornerZ, Config.SchemsizeX, Config.SchemsizeZ, Config.BorderFromSchematic);
if(inBlueArea || inRedArea) { if(inBlueArea){
if(fightTeam == null) if(fightTeam == null)
reset(event, DENY_TEAM); reset(event, DENY_TEAM);
}else if(fightTeam != null && ( else if(fightTeam == Fight.getRedTeam() && player.getGameMode() == GameMode.SPECTATOR)
FightSystem.getFightState() != FightState.ENTERN || player.getGameMode() == GameMode.SPECTATOR)){ reset(event, DENY_ENTERN);
}else if(inRedArea){
if(fightTeam == null)
reset(event, DENY_TEAM);
else if(fightTeam == Fight.getBlueTeam() && player.getGameMode() == GameMode.SPECTATOR)
reset(event, DENY_ENTERN);
}else if(fightTeam != null && FightSystem.getFightState() != FightState.ENTERN && player.getGameMode() != GameMode.SPECTATOR)
reset(event, DENY_ENTERN); reset(event, DENY_ENTERN);
}
} }
@EventHandler @EventHandler
@ -65,14 +70,12 @@ public class PlayerMoveListener extends BasicListener {
boolean inArenaY = to.getY() + 1.8 <= Config.upperArenaBorder; boolean inArenaY = to.getY() + 1.8 <= Config.upperArenaBorder;
if(to.getY() <= Config.underArenaBorder) { if(to.getY() <= Config.underArenaBorder) {
if(player.getGameMode() == GameMode.SPECTATOR){ if(player.getGameMode() == GameMode.SPECTATOR || team == null)
reset(event, DENY_ARENA); reset(event, DENY_ARENA);
}else if(FightSystem.getFightState() == FightState.RUNNING || FightSystem.getFightState() == FightState.ENTERN) else if(FightSystem.getFightState().infight())
player.damage(2); player.damage(2);
else if(team != null){ else if(!Config.GroundWalkable)
player.teleport(team.getSpawn()); player.teleport(team.getSpawn());
}else
reset(event, DENY_ARENA);
}else if(team != null && !inArenaY){ }else if(team != null && !inArenaY){
reset(event, DENY_ARENA); reset(event, DENY_ARENA);
} }

Datei anzeigen

@ -9,7 +9,6 @@ import de.steamwar.fightsystem.states.FightState;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.permissions.PermissionAttachment;
import java.util.EnumSet; import java.util.EnumSet;
@ -37,7 +36,8 @@ public class TestListener extends BasicListener {
countdown = null; countdown = null;
} }
PermissionAttachment attachment = player.addAttachment(FightSystem.getPlugin()); player.setOp(true);
/*PermissionAttachment attachment = player.addAttachment(FightSystem.getPlugin());
attachment.setPermission("fawe.permpack.basic", true); attachment.setPermission("fawe.permpack.basic", true);
attachment.setPermission("minecraft.command.gamemode", true); attachment.setPermission("minecraft.command.gamemode", true);
attachment.setPermission("minecraft.command.tp", true); attachment.setPermission("minecraft.command.tp", true);
@ -169,6 +169,6 @@ public class TestListener extends BasicListener {
attachment.setPermission("worldedit.green", true); attachment.setPermission("worldedit.green", true);
attachment.setPermission("worldedit.extinguish", true); attachment.setPermission("worldedit.extinguish", true);
attachment.setPermission("worldedit.calc", true); attachment.setPermission("worldedit.calc", true);
attachment.setPermission("worldedit.fill", true); attachment.setPermission("worldedit.fill", true);*/
} }
} }