Direction d = this.getDirection(player);
if(d==null)
{
player.sendMessage(ChatColor.RED+Residence.getLanguage().getPhrase("InvalidDirection"));
}
CuboidArea area = new CuboidArea (playerLoc1.get(player.getName()),playerLoc2.get(player.getName()));
if(d == Direction.UP)
{
int oldy = area.getHighLoc().getBlockY();
oldy = oldy + amount;
if(oldy>MAX_HEIGHT)
{
player.sendMessage(ChatColor.RED+Residence.getLanguage().getPhrase("SelectTooHigh"));
oldy = MAX_HEIGHT;
}
area.getHighLoc().setY(oldy);
if(shift)
{
int oldy2 = area.getLowLoc().getBlockY();
oldy2 = oldy2 + amount;
area.getLowLoc().setY(oldy2);
player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Shifting.Up")+"...");
}
else
player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Expanding.Up")+"...");
}
if(d == Direction.DOWN)
{
int oldy = area.getLowLoc().getBlockY();
oldy = oldy - amount;
if(oldy<MIN_HEIGHT)
{
player.sendMessage(ChatColor.RED + Residence.getLanguage().getPhrase("SelectTooLow"));
oldy = MIN_HEIGHT;
}
area.getLowLoc().setY(oldy);
if(shift)
{
int oldy2 = area.getHighLoc().getBlockY();
oldy2 = oldy2 - amount;
area.getHighLoc().setY(oldy2);
player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Shifting.Down")+"...");
}
else
player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Expanding.Down")+"...");
}
if(d == Direction.MINUSX)
{
int oldx = area.getLowLoc().getBlockX();
oldx = oldx - amount;
area.getLowLoc().setX(oldx);
if(shift)
{
int oldx2 = area.getHighLoc().getBlockX();
oldx2 = oldx2 - amount;
area.getHighLoc().setX(oldx2);
player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Shifting")+" -X...");
}
else
player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Expanding")+" -X...");
}
if(d == Direction.PLUSX)
{
int oldx = area.getHighLoc().getBlockX();
oldx = oldx + amount;
area.getHighLoc().setX(oldx);
if(shift)
{
int oldx2 = area.getLowLoc().getBlockX();
oldx2 = oldx2 + amount;
area.getLowLoc().setX(oldx2);
player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Shifting")+" +X...");
}
else
player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Expanding")+" +X...");
}
if(d == Direction.MINUSZ)
{
int oldz = area.getLowLoc().getBlockZ();
oldz = oldz - amount;
area.getLowLoc().setZ(oldz);
if(shift)
{
int oldz2 = area.getHighLoc().getBlockZ();
oldz2 = oldz2 - amount;
area.getHighLoc().setZ(oldz2);
player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Shifting")+" -Z...");
}
else
player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Expanding")+" -Z...");
}
if(d == Direction.PLUSZ)
{
int oldz = area.getHighLoc().getBlockZ();
oldz = oldz + amount;
area.getHighLoc().setZ(oldz);
if(shift)
{
int oldz2 = area.getLowLoc().getBlockZ();
oldz2 = oldz2 + amount;
area.getLowLoc().setZ(oldz2);
player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Shifting")+" +Z...");
}
else
player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Expanding")+" +Z...");
}
playerLoc1.put(player.getName(), area.getHighLoc());
playerLoc2.put(player.getName(), area.getLowLoc());
}