diff --git a/src/com/dre/dungeonsxl/DGSign.java b/src/com/dre/dungeonsxl/DGSign.java index 871f1140..6444e72c 100644 --- a/src/com/dre/dungeonsxl/DGSign.java +++ b/src/com/dre/dungeonsxl/DGSign.java @@ -12,15 +12,15 @@ import org.bukkit.entity.Player; import com.dre.dungeonsxl.game.GameWorld; -public class DGSign { +public class DGSign { public static CopyOnWriteArrayList dgsigns=new CopyOnWriteArrayList(); - + //Sign Labels public static String strIsPlaying=ChatColor.DARK_RED + "Is Playing"; public static String strFull=ChatColor.DARK_RED + "Full"; public static String strJoinGrp=ChatColor.DARK_GREEN + "Join Group"; public static String strNewGrp=ChatColor.DARK_GREEN + "New Group"; - + //Variables public DGroup[] dgroups; public String dungeonName; @@ -28,32 +28,32 @@ public class DGSign { public Block startSign; public int directionX=0,directionZ=0; public int verticalSigns; - + public DGSign(Block startSign,String dungeonName, int maxGroups, int maxPlayersPerGroup){ dgsigns.add(this); - + this.startSign=startSign; this.dungeonName=dungeonName; this.dgroups=new DGroup[maxGroups]; this.maxPlayersPerGroup=maxPlayersPerGroup; this.verticalSigns=(int)Math.ceil((float)(1+maxPlayersPerGroup)/4); - + int[] direction=getDirection(this.startSign.getData()); this.directionX=direction[0]; this.directionZ=direction[1]; - + this.update(); } - + public void update(){ int i = 0; for(DGroup dgroup:this.dgroups){ if((this.startSign.getRelative(i*directionX, 0, i*directionZ).getState() instanceof Sign)){ Sign sign = (Sign) this.startSign.getRelative(i*directionX, 0, i*directionZ).getState(); - + //Reset Signs sign.setLine(0, "");sign.setLine(1, "");sign.setLine(2, "");sign.setLine(3, ""); - + int yy=-1; while(sign.getBlock().getRelative(0, yy, 0).getState() instanceof Sign){ Sign subsign=(Sign)sign.getBlock().getRelative(0, yy, 0).getState(); @@ -61,7 +61,7 @@ public class DGSign { subsign.update(); yy--; } - + //Set Signs if(dgroup!=null){ if(dgroup.isPlaying){ @@ -92,19 +92,19 @@ public class DGSign { i++; } } - - + + //Static - + public static DGSign tryToCreate(Block startSign,String dungeonName, int maxGroups, int maxPlayersPerGroup){ World world=startSign.getWorld(); int direction=startSign.getData(); int x=startSign.getX(),y=startSign.getY(),z=startSign.getZ(); - + int verticalSigns=(int)Math.ceil((float)(1+maxPlayersPerGroup)/4); - + CopyOnWriteArrayList changeBlocks=new CopyOnWriteArrayList(); - + int xx,yy,zz; switch(direction){ case 2: @@ -126,7 +126,7 @@ public class DGSign { zz=z; for(yy=y;yy>y-verticalSigns;yy--){ for(xx=x;xxsx2){if(xsx1) continue;}else if(sx1sx2 || xsy2){if(ysy1) continue;}else{if(y!=sy1) continue;} if(sz1>sz2){if(zsz1) continue;}else if(sz1sz2 || z