staff -> admins

* rename everything containing staff back to admin (as requested by ryan i've renamed commands like slconfig to saconfig but left "slconfig" as an alias)
* format almost every file correctly
* a few other improvements
This commit is contained in:
speed
2020-12-03 19:28:53 -05:00
parent aae1f524ea
commit 293ea04c56
205 changed files with 1667 additions and 1696 deletions

View File

@ -15,7 +15,7 @@ import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerMoveEvent;
public final class StaffWorld extends CustomWorld
public final class AdminWorld extends CustomWorld
{
private static final long CACHE_CLEAR_FREQUENCY = 30L * 1000L; //30 seconds, milliseconds
@ -27,9 +27,9 @@ public final class StaffWorld extends CustomWorld
private WorldWeather weather = WorldWeather.OFF;
private WorldTime time = WorldTime.INHERIT;
public StaffWorld()
public AdminWorld()
{
super("staffworld");
super("adminworld");
}
@Override
@ -59,7 +59,7 @@ public final class StaffWorld extends CustomWorld
org.bukkit.material.Sign signData = (org.bukkit.material.Sign)welcomeSign.getData();
signData.setFacingDirection(BlockFace.NORTH);
welcomeSign.setLine(0, ChatColor.GREEN + "StaffWorld");
welcomeSign.setLine(0, ChatColor.GREEN + "AdminWorld");
welcomeSign.setLine(1, ChatColor.DARK_GRAY + "---");
welcomeSign.setLine(2, ChatColor.YELLOW + "Spawn Point");
welcomeSign.setLine(3, ChatColor.DARK_GRAY + "---");
@ -94,7 +94,7 @@ public final class StaffWorld extends CustomWorld
if (lastTP == null || lastTP + TP_COOLDOWN_TIME <= currentTimeMillis)
{
teleportCooldown.put(player, currentTimeMillis);
FLog.info(player.getName() + " attempted to access the StaffWorld.");
FLog.info(player.getName() + " attempted to access the AdminWorld.");
event.setTo(Bukkit.getWorlds().get(0).getSpawnLocation());
}
return false;
@ -135,5 +135,4 @@ public final class StaffWorld extends CustomWorld
{
}
}
}
}

View File

@ -142,9 +142,8 @@ public class CleanroomChunkGenerator extends ChunkGenerator
for (int y = 0; y < materials.length; y++)
{
result.setRegion(0, y, 0, 16, y+1, 16, materials[y]);
result.setRegion(0, y, 0, 16, y + 1, 16, materials[y]);
}
return result;
}
@ -164,4 +163,4 @@ public class CleanroomChunkGenerator extends ChunkGenerator
return new Location(world, 0, world.getHighestBlockYAt(0, 0), 0);
}
}
}

View File

@ -18,14 +18,14 @@ public class WorldManager extends FreedomService
{
public Flatlands flatlands;
public StaffWorld staffworld;
public AdminWorld adminworld;
public MasterBuilderWorld masterBuilderWorld;
public HubWorld hubworld;
public WorldManager()
{
this.flatlands = new Flatlands();
this.staffworld = new StaffWorld();
this.adminworld = new AdminWorld();
this.masterBuilderWorld = new MasterBuilderWorld();
this.hubworld = new HubWorld();
}
@ -34,7 +34,7 @@ public class WorldManager extends FreedomService
public void onStart()
{
flatlands.getWorld();
staffworld.getWorld();
adminworld.getWorld();
masterBuilderWorld.getWorld();
hubworld.getWorld();
@ -55,7 +55,7 @@ public class WorldManager extends FreedomService
public void onStop()
{
flatlands.getWorld().save();
staffworld.getWorld().save();
adminworld.getWorld().save();
masterBuilderWorld.getWorld().save();
hubworld.getWorld().save();
}
@ -65,7 +65,7 @@ public class WorldManager extends FreedomService
{
try
{
if (event.getWorld().equals(staffworld.getWorld()) && staffworld.getWeatherMode() != WorldWeather.OFF)
if (event.getWorld().equals(adminworld.getWorld()) && adminworld.getWeatherMode() != WorldWeather.OFF)
{
return;
}
@ -93,7 +93,7 @@ public class WorldManager extends FreedomService
{
try
{
if (event.getWorld().equals(staffworld.getWorld()) && staffworld.getWeatherMode() != WorldWeather.OFF)
if (event.getWorld().equals(adminworld.getWorld()) && adminworld.getWeatherMode() != WorldWeather.OFF)
{
return;
}
@ -144,4 +144,4 @@ public class WorldManager extends FreedomService
playerMsg(player, "World " + targetWorld + " not found.", ChatColor.GRAY);
}
}
}

View File

@ -61,7 +61,7 @@ public class WorldRestrictions extends FreedomService
}
}
return !plugin.sl.isStaff(player) && player.getWorld().equals(plugin.wm.staffworld.getWorld());
return !plugin.al.isAdmin(player) && player.getWorld().equals(plugin.wm.adminworld.getWorld());
}
@EventHandler(priority = EventPriority.NORMAL)
@ -132,7 +132,7 @@ public class WorldRestrictions extends FreedomService
{
/* This is a very poor way of blocking WorldEdit commands, all the methods I know of
for obtaining a list of a plugin's commands are returning null for world edit. */
String allowed = player.getWorld().equals(plugin.wm.staffworld.getWorld()) ? "Staff" : "Master Builders";
String allowed = player.getWorld().equals(plugin.wm.adminworld.getWorld()) ? "Admin" : "Master Builders";
if (command.startsWith("/") || BLOCKED_WORLDEDIT_COMMANDS.contains(command))
{

View File

@ -17,13 +17,13 @@ public enum WorldTime
private final int timeTicks;
private final List<String> aliases;
private WorldTime()
WorldTime()
{
this.timeTicks = 0;
this.aliases = null;
}
private WorldTime(String aliases, int timeTicks)
WorldTime(String aliases, int timeTicks)
{
this.timeTicks = timeTicks;
this.aliases = Arrays.asList(StringUtils.split(aliases, ","));
@ -53,4 +53,4 @@ public enum WorldTime
}
return null;
}
}
}

View File

@ -14,7 +14,7 @@ public enum WorldWeather
//
private final List<String> aliases;
private WorldWeather(String aliases)
WorldWeather(String aliases)
{
this.aliases = Arrays.asList(StringUtils.split(aliases, ","));
}