General cleanup (Removed unneeded code)

This commit is contained in:
TimWolla 2011-07-10 14:51:04 +02:00
parent 15d4497c5e
commit 6c0212d405
7 changed files with 319 additions and 358 deletions

View File

@ -26,20 +26,9 @@ import org.bukkit.plugin.java.JavaPlugin;
import com.nijiko.permissions.PermissionHandler; import com.nijiko.permissions.PermissionHandler;
import com.nijikokun.bukkit.Permissions.Permissions; import com.nijikokun.bukkit.Permissions.Permissions;
import com.tommytony.war.Monument; import com.tommytony.war.*;
import com.tommytony.war.Team; import com.tommytony.war.mappers.*;
import com.tommytony.war.TeamKind; import com.tommytony.war.utils.*;
import com.tommytony.war.TeamKinds;
import com.tommytony.war.TeamSpawnStyles;
import com.tommytony.war.WarHub;
import com.tommytony.war.Warzone;
import com.tommytony.war.ZoneLobby;
import com.tommytony.war.ZoneSetter;
import com.tommytony.war.mappers.VolumeMapper;
import com.tommytony.war.mappers.WarMapper;
import com.tommytony.war.mappers.WarzoneMapper;
import com.tommytony.war.utils.ChatFixUtil;
import com.tommytony.war.utils.InventoryStash;
/** /**
* *
@ -1441,7 +1430,6 @@ public class War extends JavaPlugin {
} }
} }
@SuppressWarnings("static-access")
public boolean isZoneMaker(Player player) { public boolean isZoneMaker(Player player) {
boolean isPlayerImpersonator = false; boolean isPlayerImpersonator = false;
for(String disguised : zoneMakersImpersonatingPlayers) { for(String disguised : zoneMakersImpersonatingPlayers) {
@ -1546,9 +1534,9 @@ public class War extends JavaPlugin {
public void setupPermissions() { public void setupPermissions() {
Plugin permissionsPlugin = this.getServer().getPluginManager().getPlugin("Permissions"); Plugin permissionsPlugin = this.getServer().getPluginManager().getPlugin("Permissions");
if(this.permissionHandler == null) { if(War.permissionHandler == null) {
if(permissionsPlugin != null) { if(permissionsPlugin != null) {
this.permissionHandler = ((Permissions) permissionsPlugin).getHandler(); War.permissionHandler = ((Permissions) permissionsPlugin).getHandler();
} else { } else {
logInfo("Permissions system not enabled. Defaulting to regular War config."); logInfo("Permissions system not enabled. Defaulting to regular War config.");
} }
@ -1630,5 +1618,4 @@ public class War extends JavaPlugin {
public boolean isLoaded() { public boolean isLoaded() {
return loaded; return loaded;
} }
} }

View File

@ -266,7 +266,7 @@ public class WarPlayerListener extends PlayerListener {
noOfPlayers += t.getPlayers().size(); noOfPlayers += t.getPlayers().size();
} }
if(noOfPlayers < zone.getTeams().size() * zone.getTeamCap()) { if(noOfPlayers < zone.getTeams().size() * zone.getTeamCap()) {
Team team = zone.autoAssign(player); zone.autoAssign(player);
if(war.getWarHub() != null) { if(war.getWarHub() != null) {
war.getWarHub().resetZoneSign(zone); war.getWarHub().resetZoneSign(zone);

View File

@ -7,12 +7,8 @@ import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.block.Dispenser;
import org.bukkit.block.Sign; import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import com.tommytony.war.Warzone;
import com.tommytony.war.utils.DeferredBlockReset; import com.tommytony.war.utils.DeferredBlockReset;
public class DeferredBlockResetsJob implements Runnable { public class DeferredBlockResetsJob implements Runnable {

View File

@ -3,12 +3,9 @@ package com.tommytony.war.mappers;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.BufferedWriter; import java.io.BufferedWriter;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader; import java.io.FileReader;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -26,7 +23,6 @@ import org.bukkit.material.MaterialData;
import bukkit.tommytony.war.War; import bukkit.tommytony.war.War;
import com.tommytony.war.jobs.DeferredBlockResetsJob; import com.tommytony.war.jobs.DeferredBlockResetsJob;
import com.tommytony.war.jobs.ZoneVolumeSaveJob;
import com.tommytony.war.utils.DeferredBlockReset; import com.tommytony.war.utils.DeferredBlockReset;
import com.tommytony.war.volumes.Volume; import com.tommytony.war.volumes.Volume;
import com.tommytony.war.volumes.ZoneVolume; import com.tommytony.war.volumes.ZoneVolume;

View File

@ -16,9 +16,7 @@ import org.bukkit.material.MaterialData;
import bukkit.tommytony.war.War; import bukkit.tommytony.war.War;
import com.tommytony.war.Warzone;
import com.tommytony.war.volumes.Volume; import com.tommytony.war.volumes.Volume;
import com.tommytony.war.volumes.ZoneVolume;
/** /**
* *

View File

@ -1,9 +1,5 @@
package com.tommytony.war.utils; package com.tommytony.war.utils;
import java.util.List;
import org.bukkit.inventory.ItemStack;
public class DeferredBlockReset { public class DeferredBlockReset {
private final int x; private final int x;
@ -12,7 +8,6 @@ public class DeferredBlockReset {
private final int blockType; private final int blockType;
private final byte blockData; private final byte blockData;
private String[] lines; private String[] lines;
private List<ItemStack> items;
public DeferredBlockReset(int x, int y, int z, int blockType, byte blockData) { public DeferredBlockReset(int x, int y, int z, int blockType, byte blockData) {
this.x = x; this.x = x;
@ -55,7 +50,4 @@ public class DeferredBlockReset {
public String[] getLines() { public String[] getLines() {
return lines; return lines;
} }
} }

View File

@ -1,7 +1,6 @@
package com.tommytony.war.spec.volumes; package com.tommytony.war.spec.volumes;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -12,15 +11,8 @@ import static org.mockito.Mockito.*;
import bukkit.tommytony.war.War; import bukkit.tommytony.war.War;
import com.tommytony.war.Monument; import com.tommytony.war.*;
import com.tommytony.war.Team; import com.tommytony.war.volumes.*;
import com.tommytony.war.Warzone;
import com.tommytony.war.volumes.BlockInfo;
import com.tommytony.war.volumes.NotNorthwestException;
import com.tommytony.war.volumes.NotSoutheastException;
import com.tommytony.war.volumes.TooBigException;
import com.tommytony.war.volumes.TooSmallException;
import com.tommytony.war.volumes.ZoneVolume;
public class ZoneVolumeSpecTest { public class ZoneVolumeSpecTest {