Print the server's /version if people don't update CB
https://www.spigotmc.org/threads/how-do-i-do-this.187026/#post-1964612
This commit is contained in:
parent
807f6f5899
commit
2f186bdf88
|
|
@ -44,6 +44,7 @@ import org.bukkit.World.Environment;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.ConsoleCommandSender;
|
||||||
import org.bukkit.entity.Animals;
|
import org.bukkit.entity.Animals;
|
||||||
import org.bukkit.entity.Creature;
|
import org.bukkit.entity.Creature;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
|
@ -770,9 +771,9 @@ class PlayerEventHandler implements Listener
|
||||||
}
|
}
|
||||||
catch (NoSuchMethodError e)
|
catch (NoSuchMethodError e)
|
||||||
{
|
{
|
||||||
instance.getLogger().severe("Please update your server mod (Craftbukkit/Spigot/Paper/etc.), as mentioned in the update notes.");
|
|
||||||
instance.getLogger().severe("Nether portal trap rescues will not function and you will receive a nice stack trace every time a player uses a nether portal.");
|
instance.getLogger().severe("Nether portal trap rescues will not function and you will receive a nice stack trace every time a player uses a nether portal.");
|
||||||
instance.getLogger().severe("So yea, read the bold update notes and update Craftbukkit/Spigot/Paper, thanks.");
|
instance.getLogger().severe("Please update your server mod (Craftbukkit/Spigot/Paper), as mentioned in the update notes.");
|
||||||
|
instance.getServer().dispatchCommand(instance.getServer().getConsoleSender(), "version");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1634,7 +1635,7 @@ class PlayerEventHandler implements Listener
|
||||||
if(claim != null)
|
if(claim != null)
|
||||||
{
|
{
|
||||||
playerData.lastClaim = claim;
|
playerData.lastClaim = claim;
|
||||||
|
|
||||||
String noAccessReason = claim.allowAccess(player);
|
String noAccessReason = claim.allowAccess(player);
|
||||||
if(noAccessReason != null)
|
if(noAccessReason != null)
|
||||||
{
|
{
|
||||||
|
|
@ -1642,7 +1643,7 @@ class PlayerEventHandler implements Listener
|
||||||
instance.sendMessage(player, TextMode.Err, noAccessReason);
|
instance.sendMessage(player, TextMode.Err, noAccessReason);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//otherwise apply rules for buttons and switches
|
//otherwise apply rules for buttons and switches
|
||||||
|
|
@ -1804,42 +1805,42 @@ class PlayerEventHandler implements Listener
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if he's investigating a claim
|
//if he's investigating a claim
|
||||||
else if(materialInHand == instance.config_claims_investigationTool && hand == EquipmentSlot.HAND)
|
else if(materialInHand == instance.config_claims_investigationTool && hand == EquipmentSlot.HAND)
|
||||||
{
|
{
|
||||||
//if claims are disabled in this world, do nothing
|
//if claims are disabled in this world, do nothing
|
||||||
if(!instance.claimsEnabledForWorld(player.getWorld())) return;
|
if(!instance.claimsEnabledForWorld(player.getWorld())) return;
|
||||||
|
|
||||||
//if holding shift (sneaking), show all claims in area
|
//if holding shift (sneaking), show all claims in area
|
||||||
if(player.isSneaking() && player.hasPermission("griefprevention.visualizenearbyclaims"))
|
if(player.isSneaking() && player.hasPermission("griefprevention.visualizenearbyclaims"))
|
||||||
{
|
{
|
||||||
//find nearby claims
|
//find nearby claims
|
||||||
Set<Claim> claims = this.dataStore.getNearbyClaims(player.getLocation());
|
Set<Claim> claims = this.dataStore.getNearbyClaims(player.getLocation());
|
||||||
|
|
||||||
//visualize boundaries
|
//visualize boundaries
|
||||||
Visualization visualization = Visualization.fromClaims(claims, player.getEyeLocation().getBlockY(), VisualizationType.Claim, player.getLocation());
|
Visualization visualization = Visualization.fromClaims(claims, player.getEyeLocation().getBlockY(), VisualizationType.Claim, player.getLocation());
|
||||||
Visualization.Apply(player, visualization);
|
Visualization.Apply(player, visualization);
|
||||||
|
|
||||||
instance.sendMessage(player, TextMode.Info, Messages.ShowNearbyClaims, String.valueOf(claims.size()));
|
instance.sendMessage(player, TextMode.Info, Messages.ShowNearbyClaims, String.valueOf(claims.size()));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//FEATURE: shovel and stick can be used from a distance away
|
//FEATURE: shovel and stick can be used from a distance away
|
||||||
if(action == Action.RIGHT_CLICK_AIR)
|
if(action == Action.RIGHT_CLICK_AIR)
|
||||||
{
|
{
|
||||||
//try to find a far away non-air block along line of sight
|
//try to find a far away non-air block along line of sight
|
||||||
clickedBlock = getTargetBlock(player, 100);
|
clickedBlock = getTargetBlock(player, 100);
|
||||||
clickedBlockType = clickedBlock.getType();
|
clickedBlockType = clickedBlock.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
//if no block, stop here
|
//if no block, stop here
|
||||||
if(clickedBlock == null)
|
if(clickedBlock == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//air indicates too far away
|
//air indicates too far away
|
||||||
if(clickedBlockType == Material.AIR)
|
if(clickedBlockType == Material.AIR)
|
||||||
{
|
{
|
||||||
|
|
@ -1847,33 +1848,33 @@ class PlayerEventHandler implements Listener
|
||||||
Visualization.Revert(player);
|
Visualization.Revert(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(playerData == null) playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
if(playerData == null) playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
||||||
Claim claim = this.dataStore.getClaimAt(clickedBlock.getLocation(), false /*ignore height*/, playerData.lastClaim);
|
Claim claim = this.dataStore.getClaimAt(clickedBlock.getLocation(), false /*ignore height*/, playerData.lastClaim);
|
||||||
|
|
||||||
//no claim case
|
//no claim case
|
||||||
if(claim == null)
|
if(claim == null)
|
||||||
{
|
{
|
||||||
instance.sendMessage(player, TextMode.Info, Messages.BlockNotClaimed);
|
instance.sendMessage(player, TextMode.Info, Messages.BlockNotClaimed);
|
||||||
Visualization.Revert(player);
|
Visualization.Revert(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
//claim case
|
//claim case
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
playerData.lastClaim = claim;
|
playerData.lastClaim = claim;
|
||||||
instance.sendMessage(player, TextMode.Info, Messages.BlockClaimed, claim.getOwnerName());
|
instance.sendMessage(player, TextMode.Info, Messages.BlockClaimed, claim.getOwnerName());
|
||||||
|
|
||||||
//visualize boundary
|
//visualize boundary
|
||||||
Visualization visualization = Visualization.FromClaim(claim, player.getEyeLocation().getBlockY(), VisualizationType.Claim, player.getLocation());
|
Visualization visualization = Visualization.FromClaim(claim, player.getEyeLocation().getBlockY(), VisualizationType.Claim, player.getLocation());
|
||||||
Visualization.Apply(player, visualization);
|
Visualization.Apply(player, visualization);
|
||||||
|
|
||||||
//if can resize this claim, tell about the boundaries
|
//if can resize this claim, tell about the boundaries
|
||||||
if(claim.allowEdit(player) == null)
|
if(claim.allowEdit(player) == null)
|
||||||
{
|
{
|
||||||
instance.sendMessage(player, TextMode.Info, " " + claim.getWidth() + "x" + claim.getHeight() + "=" + claim.getArea());
|
instance.sendMessage(player, TextMode.Info, " " + claim.getWidth() + "x" + claim.getHeight() + "=" + claim.getArea());
|
||||||
}
|
}
|
||||||
|
|
||||||
//if permission, tell about the player's offline time
|
//if permission, tell about the player's offline time
|
||||||
if(!claim.isAdminClaim() && (player.hasPermission("griefprevention.deleteclaims") || player.hasPermission("griefprevention.seeinactivity")))
|
if(!claim.isAdminClaim() && (player.hasPermission("griefprevention.deleteclaims") || player.hasPermission("griefprevention.seeinactivity")))
|
||||||
{
|
{
|
||||||
|
|
@ -1883,19 +1884,19 @@ class PlayerEventHandler implements Listener
|
||||||
}
|
}
|
||||||
Date lastLogin = new Date(Bukkit.getOfflinePlayer(claim.ownerID).getLastPlayed());
|
Date lastLogin = new Date(Bukkit.getOfflinePlayer(claim.ownerID).getLastPlayed());
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
long daysElapsed = (now.getTime() - lastLogin.getTime()) / (1000 * 60 * 60 * 24);
|
long daysElapsed = (now.getTime() - lastLogin.getTime()) / (1000 * 60 * 60 * 24);
|
||||||
|
|
||||||
instance.sendMessage(player, TextMode.Info, Messages.PlayerOfflineTime, String.valueOf(daysElapsed));
|
instance.sendMessage(player, TextMode.Info, Messages.PlayerOfflineTime, String.valueOf(daysElapsed));
|
||||||
|
|
||||||
//drop the data we just loaded, if the player isn't online
|
//drop the data we just loaded, if the player isn't online
|
||||||
if(instance.getServer().getPlayer(claim.ownerID) == null)
|
if(instance.getServer().getPlayer(claim.ownerID) == null)
|
||||||
this.dataStore.clearCachedPlayerData(claim.ownerID);
|
this.dataStore.clearCachedPlayerData(claim.ownerID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if holding a non-vanilla item
|
//if holding a non-vanilla item
|
||||||
else if(Material.getMaterial(itemInHand.getTypeId()) == null)
|
else if(Material.getMaterial(itemInHand.getTypeId()) == null)
|
||||||
{
|
{
|
||||||
|
|
@ -1905,7 +1906,7 @@ class PlayerEventHandler implements Listener
|
||||||
//try to find a far away non-air block along line of sight
|
//try to find a far away non-air block along line of sight
|
||||||
clickedBlock = getTargetBlock(player, 100);
|
clickedBlock = getTargetBlock(player, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
//if target is claimed, require build trust permission
|
//if target is claimed, require build trust permission
|
||||||
if(playerData == null) playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
if(playerData == null) playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
||||||
Claim claim = this.dataStore.getClaimAt(clickedBlock.getLocation(), false, playerData.lastClaim);
|
Claim claim = this.dataStore.getClaimAt(clickedBlock.getLocation(), false, playerData.lastClaim);
|
||||||
|
|
@ -1919,15 +1920,15 @@ class PlayerEventHandler implements Listener
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if it's a golden shovel
|
//if it's a golden shovel
|
||||||
else if(materialInHand != instance.config_claims_modificationTool || hand != EquipmentSlot.HAND) return;
|
else if(materialInHand != instance.config_claims_modificationTool || hand != EquipmentSlot.HAND) return;
|
||||||
|
|
||||||
event.setCancelled(true); //GriefPrevention exclusively reserves this tool (e.g. no grass path creation for golden shovel)
|
event.setCancelled(true); //GriefPrevention exclusively reserves this tool (e.g. no grass path creation for golden shovel)
|
||||||
|
|
||||||
//disable golden shovel while under siege
|
//disable golden shovel while under siege
|
||||||
if(playerData == null) playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
if(playerData == null) playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
||||||
if(playerData.siegeData != null)
|
if(playerData.siegeData != null)
|
||||||
|
|
@ -1936,28 +1937,28 @@ class PlayerEventHandler implements Listener
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//FEATURE: shovel and stick can be used from a distance away
|
//FEATURE: shovel and stick can be used from a distance away
|
||||||
if(action == Action.RIGHT_CLICK_AIR)
|
if(action == Action.RIGHT_CLICK_AIR)
|
||||||
{
|
{
|
||||||
//try to find a far away non-air block along line of sight
|
//try to find a far away non-air block along line of sight
|
||||||
clickedBlock = getTargetBlock(player, 100);
|
clickedBlock = getTargetBlock(player, 100);
|
||||||
clickedBlockType = clickedBlock.getType();
|
clickedBlockType = clickedBlock.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
//if no block, stop here
|
//if no block, stop here
|
||||||
if(clickedBlock == null)
|
if(clickedBlock == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//can't use the shovel from too far away
|
//can't use the shovel from too far away
|
||||||
if(clickedBlockType == Material.AIR)
|
if(clickedBlockType == Material.AIR)
|
||||||
{
|
{
|
||||||
instance.sendMessage(player, TextMode.Err, Messages.TooFarAway);
|
instance.sendMessage(player, TextMode.Err, Messages.TooFarAway);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if the player is in restore nature mode, do only that
|
//if the player is in restore nature mode, do only that
|
||||||
UUID playerID = player.getUniqueId();
|
UUID playerID = player.getUniqueId();
|
||||||
playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
||||||
|
|
@ -1970,18 +1971,18 @@ class PlayerEventHandler implements Listener
|
||||||
instance.sendMessage(player, TextMode.Err, Messages.BlockClaimed, claim.getOwnerName());
|
instance.sendMessage(player, TextMode.Err, Messages.BlockClaimed, claim.getOwnerName());
|
||||||
Visualization visualization = Visualization.FromClaim(claim, clickedBlock.getY(), VisualizationType.ErrorClaim, player.getLocation());
|
Visualization visualization = Visualization.FromClaim(claim, clickedBlock.getY(), VisualizationType.ErrorClaim, player.getLocation());
|
||||||
Visualization.Apply(player, visualization);
|
Visualization.Apply(player, visualization);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//figure out which chunk to repair
|
//figure out which chunk to repair
|
||||||
Chunk chunk = player.getWorld().getChunkAt(clickedBlock.getLocation());
|
Chunk chunk = player.getWorld().getChunkAt(clickedBlock.getLocation());
|
||||||
|
|
||||||
//start the repair process
|
//start the repair process
|
||||||
|
|
||||||
//set boundaries for processing
|
//set boundaries for processing
|
||||||
int miny = clickedBlock.getY();
|
int miny = clickedBlock.getY();
|
||||||
|
|
||||||
//if not in aggressive mode, extend the selection down to a little below sea level
|
//if not in aggressive mode, extend the selection down to a little below sea level
|
||||||
if(!(playerData.shovelMode == ShovelMode.RestoreNatureAggressive))
|
if(!(playerData.shovelMode == ShovelMode.RestoreNatureAggressive))
|
||||||
{
|
{
|
||||||
|
|
@ -1990,16 +1991,16 @@ class PlayerEventHandler implements Listener
|
||||||
miny = instance.getSeaLevel(chunk.getWorld()) - 10;
|
miny = instance.getSeaLevel(chunk.getWorld()) - 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
instance.restoreChunk(chunk, miny, playerData.shovelMode == ShovelMode.RestoreNatureAggressive, 0, player);
|
instance.restoreChunk(chunk, miny, playerData.shovelMode == ShovelMode.RestoreNatureAggressive, 0, player);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if in restore nature fill mode
|
//if in restore nature fill mode
|
||||||
if(playerData.shovelMode == ShovelMode.RestoreNatureFill)
|
if(playerData.shovelMode == ShovelMode.RestoreNatureFill)
|
||||||
{
|
{
|
||||||
ArrayList<Material> allowedFillBlocks = new ArrayList<Material>();
|
ArrayList<Material> allowedFillBlocks = new ArrayList<Material>();
|
||||||
Environment environment = clickedBlock.getWorld().getEnvironment();
|
Environment environment = clickedBlock.getWorld().getEnvironment();
|
||||||
if(environment == Environment.NETHER)
|
if(environment == Environment.NETHER)
|
||||||
{
|
{
|
||||||
|
|
@ -2008,7 +2009,7 @@ class PlayerEventHandler implements Listener
|
||||||
else if(environment == Environment.THE_END)
|
else if(environment == Environment.THE_END)
|
||||||
{
|
{
|
||||||
allowedFillBlocks.add(Material.ENDER_STONE);
|
allowedFillBlocks.add(Material.ENDER_STONE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
allowedFillBlocks.add(Material.GRASS);
|
allowedFillBlocks.add(Material.GRASS);
|
||||||
|
|
@ -2018,17 +2019,17 @@ class PlayerEventHandler implements Listener
|
||||||
allowedFillBlocks.add(Material.SANDSTONE);
|
allowedFillBlocks.add(Material.SANDSTONE);
|
||||||
allowedFillBlocks.add(Material.ICE);
|
allowedFillBlocks.add(Material.ICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Block centerBlock = clickedBlock;
|
Block centerBlock = clickedBlock;
|
||||||
|
|
||||||
int maxHeight = centerBlock.getY();
|
int maxHeight = centerBlock.getY();
|
||||||
int minx = centerBlock.getX() - playerData.fillRadius;
|
int minx = centerBlock.getX() - playerData.fillRadius;
|
||||||
int maxx = centerBlock.getX() + playerData.fillRadius;
|
int maxx = centerBlock.getX() + playerData.fillRadius;
|
||||||
int minz = centerBlock.getZ() - playerData.fillRadius;
|
int minz = centerBlock.getZ() - playerData.fillRadius;
|
||||||
int maxz = centerBlock.getZ() + playerData.fillRadius;
|
int maxz = centerBlock.getZ() + playerData.fillRadius;
|
||||||
int minHeight = maxHeight - 10;
|
int minHeight = maxHeight - 10;
|
||||||
if(minHeight < 0) minHeight = 0;
|
if(minHeight < 0) minHeight = 0;
|
||||||
|
|
||||||
Claim cachedClaim = null;
|
Claim cachedClaim = null;
|
||||||
for(int x = minx; x <= maxx; x++)
|
for(int x = minx; x <= maxx; x++)
|
||||||
{
|
{
|
||||||
|
|
@ -2037,16 +2038,16 @@ class PlayerEventHandler implements Listener
|
||||||
//circular brush
|
//circular brush
|
||||||
Location location = new Location(centerBlock.getWorld(), x, centerBlock.getY(), z);
|
Location location = new Location(centerBlock.getWorld(), x, centerBlock.getY(), z);
|
||||||
if(location.distance(centerBlock.getLocation()) > playerData.fillRadius) continue;
|
if(location.distance(centerBlock.getLocation()) > playerData.fillRadius) continue;
|
||||||
|
|
||||||
//default fill block is initially the first from the allowed fill blocks list above
|
//default fill block is initially the first from the allowed fill blocks list above
|
||||||
Material defaultFiller = allowedFillBlocks.get(0);
|
Material defaultFiller = allowedFillBlocks.get(0);
|
||||||
|
|
||||||
//prefer to use the block the player clicked on, if it's an acceptable fill block
|
//prefer to use the block the player clicked on, if it's an acceptable fill block
|
||||||
if(allowedFillBlocks.contains(centerBlock.getType()))
|
if(allowedFillBlocks.contains(centerBlock.getType()))
|
||||||
{
|
{
|
||||||
defaultFiller = centerBlock.getType();
|
defaultFiller = centerBlock.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
//if the player clicks on water, try to sink through the water to find something underneath that's useful for a filler
|
//if the player clicks on water, try to sink through the water to find something underneath that's useful for a filler
|
||||||
else if(centerBlock.getType() == Material.WATER || centerBlock.getType() == Material.STATIONARY_WATER)
|
else if(centerBlock.getType() == Material.WATER || centerBlock.getType() == Material.STATIONARY_WATER)
|
||||||
{
|
{
|
||||||
|
|
@ -2060,12 +2061,12 @@ class PlayerEventHandler implements Listener
|
||||||
defaultFiller = block.getType();
|
defaultFiller = block.getType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//fill bottom to top
|
//fill bottom to top
|
||||||
for(int y = minHeight; y <= maxHeight; y++)
|
for(int y = minHeight; y <= maxHeight; y++)
|
||||||
{
|
{
|
||||||
Block block = centerBlock.getWorld().getBlockAt(x, y, z);
|
Block block = centerBlock.getWorld().getBlockAt(x, y, z);
|
||||||
|
|
||||||
//respect claims
|
//respect claims
|
||||||
Claim claim = this.dataStore.getClaimAt(block.getLocation(), false, cachedClaim);
|
Claim claim = this.dataStore.getClaimAt(block.getLocation(), false, cachedClaim);
|
||||||
if(claim != null)
|
if(claim != null)
|
||||||
|
|
@ -2073,16 +2074,16 @@ class PlayerEventHandler implements Listener
|
||||||
cachedClaim = claim;
|
cachedClaim = claim;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//only replace air, spilling water, snow, long grass
|
//only replace air, spilling water, snow, long grass
|
||||||
if(block.getType() == Material.AIR || block.getType() == Material.SNOW || (block.getType() == Material.STATIONARY_WATER && block.getData() != 0) || block.getType() == Material.LONG_GRASS)
|
if(block.getType() == Material.AIR || block.getType() == Material.SNOW || (block.getType() == Material.STATIONARY_WATER && block.getData() != 0) || block.getType() == Material.LONG_GRASS)
|
||||||
{
|
{
|
||||||
//if the top level, always use the default filler picked above
|
//if the top level, always use the default filler picked above
|
||||||
if(y == maxHeight)
|
if(y == maxHeight)
|
||||||
{
|
{
|
||||||
block.setType(defaultFiller);
|
block.setType(defaultFiller);
|
||||||
}
|
}
|
||||||
|
|
||||||
//otherwise look to neighbors for an appropriate fill block
|
//otherwise look to neighbors for an appropriate fill block
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2090,7 +2091,7 @@ class PlayerEventHandler implements Listener
|
||||||
Block westBlock = block.getRelative(BlockFace.WEST);
|
Block westBlock = block.getRelative(BlockFace.WEST);
|
||||||
Block northBlock = block.getRelative(BlockFace.NORTH);
|
Block northBlock = block.getRelative(BlockFace.NORTH);
|
||||||
Block southBlock = block.getRelative(BlockFace.SOUTH);
|
Block southBlock = block.getRelative(BlockFace.SOUTH);
|
||||||
|
|
||||||
//first, check lateral neighbors (ideally, want to keep natural layers)
|
//first, check lateral neighbors (ideally, want to keep natural layers)
|
||||||
if(allowedFillBlocks.contains(eastBlock.getType()))
|
if(allowedFillBlocks.contains(eastBlock.getType()))
|
||||||
{
|
{
|
||||||
|
|
@ -2108,7 +2109,7 @@ class PlayerEventHandler implements Listener
|
||||||
{
|
{
|
||||||
block.setType(southBlock.getType());
|
block.setType(southBlock.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
//if all else fails, use the default filler selected above
|
//if all else fails, use the default filler selected above
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2119,17 +2120,17 @@ class PlayerEventHandler implements Listener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if the player doesn't have claims permission, don't do anything
|
//if the player doesn't have claims permission, don't do anything
|
||||||
if(!player.hasPermission("griefprevention.createclaims"))
|
if(!player.hasPermission("griefprevention.createclaims"))
|
||||||
{
|
{
|
||||||
instance.sendMessage(player, TextMode.Err, Messages.NoCreateClaimPermission);
|
instance.sendMessage(player, TextMode.Err, Messages.NoCreateClaimPermission);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if he's resizing a claim and that claim hasn't been deleted since he started resizing it
|
//if he's resizing a claim and that claim hasn't been deleted since he started resizing it
|
||||||
if(playerData.claimResizing != null && playerData.claimResizing.inDataStore)
|
if(playerData.claimResizing != null && playerData.claimResizing.inDataStore)
|
||||||
{
|
{
|
||||||
|
|
@ -2145,7 +2146,7 @@ class PlayerEventHandler implements Listener
|
||||||
{
|
{
|
||||||
newx1 = playerData.claimResizing.getLesserBoundaryCorner().getBlockX();
|
newx1 = playerData.claimResizing.getLesserBoundaryCorner().getBlockX();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(playerData.lastShovelLocation.getBlockX() == playerData.claimResizing.getGreaterBoundaryCorner().getBlockX())
|
if(playerData.lastShovelLocation.getBlockX() == playerData.claimResizing.getGreaterBoundaryCorner().getBlockX())
|
||||||
{
|
{
|
||||||
newx2 = clickedBlock.getX();
|
newx2 = clickedBlock.getX();
|
||||||
|
|
@ -2154,7 +2155,7 @@ class PlayerEventHandler implements Listener
|
||||||
{
|
{
|
||||||
newx2 = playerData.claimResizing.getGreaterBoundaryCorner().getBlockX();
|
newx2 = playerData.claimResizing.getGreaterBoundaryCorner().getBlockX();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(playerData.lastShovelLocation.getBlockZ() == playerData.claimResizing.getLesserBoundaryCorner().getBlockZ())
|
if(playerData.lastShovelLocation.getBlockZ() == playerData.claimResizing.getLesserBoundaryCorner().getBlockZ())
|
||||||
{
|
{
|
||||||
newz1 = clickedBlock.getZ();
|
newz1 = clickedBlock.getZ();
|
||||||
|
|
@ -2163,7 +2164,7 @@ class PlayerEventHandler implements Listener
|
||||||
{
|
{
|
||||||
newz1 = playerData.claimResizing.getLesserBoundaryCorner().getBlockZ();
|
newz1 = playerData.claimResizing.getLesserBoundaryCorner().getBlockZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(playerData.lastShovelLocation.getBlockZ() == playerData.claimResizing.getGreaterBoundaryCorner().getBlockZ())
|
if(playerData.lastShovelLocation.getBlockZ() == playerData.claimResizing.getGreaterBoundaryCorner().getBlockZ())
|
||||||
{
|
{
|
||||||
newz2 = clickedBlock.getZ();
|
newz2 = clickedBlock.getZ();
|
||||||
|
|
@ -2172,18 +2173,18 @@ class PlayerEventHandler implements Listener
|
||||||
{
|
{
|
||||||
newz2 = playerData.claimResizing.getGreaterBoundaryCorner().getBlockZ();
|
newz2 = playerData.claimResizing.getGreaterBoundaryCorner().getBlockZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
newy1 = playerData.claimResizing.getLesserBoundaryCorner().getBlockY();
|
newy1 = playerData.claimResizing.getLesserBoundaryCorner().getBlockY();
|
||||||
newy2 = clickedBlock.getY() - instance.config_claims_claimsExtendIntoGroundDistance;
|
newy2 = clickedBlock.getY() - instance.config_claims_claimsExtendIntoGroundDistance;
|
||||||
|
|
||||||
this.dataStore.resizeClaimWithChecks(player, playerData, newx1, newx2, newy1, newy2, newz1, newz2);
|
this.dataStore.resizeClaimWithChecks(player, playerData, newx1, newx2, newy1, newy2, newz1, newz2);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//otherwise, since not currently resizing a claim, must be starting a resize, creating a new claim, or creating a subdivision
|
//otherwise, since not currently resizing a claim, must be starting a resize, creating a new claim, or creating a subdivision
|
||||||
Claim claim = this.dataStore.getClaimAt(clickedBlock.getLocation(), true /*ignore height*/, playerData.lastClaim);
|
Claim claim = this.dataStore.getClaimAt(clickedBlock.getLocation(), true /*ignore height*/, playerData.lastClaim);
|
||||||
|
|
||||||
//if within an existing claim, he's not creating a new one
|
//if within an existing claim, he's not creating a new one
|
||||||
if(claim != null)
|
if(claim != null)
|
||||||
{
|
{
|
||||||
|
|
@ -2198,19 +2199,19 @@ class PlayerEventHandler implements Listener
|
||||||
playerData.lastShovelLocation = clickedBlock.getLocation();
|
playerData.lastShovelLocation = clickedBlock.getLocation();
|
||||||
instance.sendMessage(player, TextMode.Instr, Messages.ResizeStart);
|
instance.sendMessage(player, TextMode.Instr, Messages.ResizeStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
//if he didn't click on a corner and is in subdivision mode, he's creating a new subdivision
|
//if he didn't click on a corner and is in subdivision mode, he's creating a new subdivision
|
||||||
else if(playerData.shovelMode == ShovelMode.Subdivide)
|
else if(playerData.shovelMode == ShovelMode.Subdivide)
|
||||||
{
|
{
|
||||||
//if it's the first click, he's trying to start a new subdivision
|
//if it's the first click, he's trying to start a new subdivision
|
||||||
if(playerData.lastShovelLocation == null)
|
if(playerData.lastShovelLocation == null)
|
||||||
{
|
{
|
||||||
//if the clicked claim was a subdivision, tell him he can't start a new subdivision here
|
//if the clicked claim was a subdivision, tell him he can't start a new subdivision here
|
||||||
if(claim.parent != null)
|
if(claim.parent != null)
|
||||||
{
|
{
|
||||||
instance.sendMessage(player, TextMode.Err, Messages.ResizeFailOverlapSubdivision);
|
instance.sendMessage(player, TextMode.Err, Messages.ResizeFailOverlapSubdivision);
|
||||||
}
|
}
|
||||||
|
|
||||||
//otherwise start a new subdivision
|
//otherwise start a new subdivision
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2219,7 +2220,7 @@ class PlayerEventHandler implements Listener
|
||||||
playerData.claimSubdividing = claim;
|
playerData.claimSubdividing = claim;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//otherwise, he's trying to finish creating a subdivision by setting the other boundary corner
|
//otherwise, he's trying to finish creating a subdivision by setting the other boundary corner
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2230,31 +2231,31 @@ class PlayerEventHandler implements Listener
|
||||||
this.onPlayerInteract(event);
|
this.onPlayerInteract(event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//try to create a new claim (will return null if this subdivision overlaps another)
|
//try to create a new claim (will return null if this subdivision overlaps another)
|
||||||
CreateClaimResult result = this.dataStore.createClaim(
|
CreateClaimResult result = this.dataStore.createClaim(
|
||||||
player.getWorld(),
|
player.getWorld(),
|
||||||
playerData.lastShovelLocation.getBlockX(), clickedBlock.getX(),
|
playerData.lastShovelLocation.getBlockX(), clickedBlock.getX(),
|
||||||
playerData.lastShovelLocation.getBlockY() - instance.config_claims_claimsExtendIntoGroundDistance, clickedBlock.getY() - instance.config_claims_claimsExtendIntoGroundDistance,
|
playerData.lastShovelLocation.getBlockY() - instance.config_claims_claimsExtendIntoGroundDistance, clickedBlock.getY() - instance.config_claims_claimsExtendIntoGroundDistance,
|
||||||
playerData.lastShovelLocation.getBlockZ(), clickedBlock.getZ(),
|
playerData.lastShovelLocation.getBlockZ(), clickedBlock.getZ(),
|
||||||
null, //owner is not used for subdivisions
|
null, //owner is not used for subdivisions
|
||||||
playerData.claimSubdividing,
|
playerData.claimSubdividing,
|
||||||
null, player);
|
null, player);
|
||||||
|
|
||||||
//if it didn't succeed, tell the player why
|
//if it didn't succeed, tell the player why
|
||||||
if(!result.succeeded)
|
if(!result.succeeded)
|
||||||
{
|
{
|
||||||
instance.sendMessage(player, TextMode.Err, Messages.CreateSubdivisionOverlap);
|
instance.sendMessage(player, TextMode.Err, Messages.CreateSubdivisionOverlap);
|
||||||
|
|
||||||
Visualization visualization = Visualization.FromClaim(result.claim, clickedBlock.getY(), VisualizationType.ErrorClaim, player.getLocation());
|
Visualization visualization = Visualization.FromClaim(result.claim, clickedBlock.getY(), VisualizationType.ErrorClaim, player.getLocation());
|
||||||
Visualization.Apply(player, visualization);
|
Visualization.Apply(player, visualization);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//otherwise, advise him on the /trust command and show him his new subdivision
|
//otherwise, advise him on the /trust command and show him his new subdivision
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
instance.sendMessage(player, TextMode.Success, Messages.SubdivisionSuccess);
|
instance.sendMessage(player, TextMode.Success, Messages.SubdivisionSuccess);
|
||||||
Visualization visualization = Visualization.FromClaim(result.claim, clickedBlock.getY(), VisualizationType.Claim, player.getLocation());
|
Visualization visualization = Visualization.FromClaim(result.claim, clickedBlock.getY(), VisualizationType.Claim, player.getLocation());
|
||||||
Visualization.Apply(player, visualization);
|
Visualization.Apply(player, visualization);
|
||||||
|
|
@ -2263,17 +2264,17 @@ class PlayerEventHandler implements Listener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//otherwise tell him he can't create a claim here, and show him the existing claim
|
//otherwise tell him he can't create a claim here, and show him the existing claim
|
||||||
//also advise him to consider /abandonclaim or resizing the existing claim
|
//also advise him to consider /abandonclaim or resizing the existing claim
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
instance.sendMessage(player, TextMode.Err, Messages.CreateClaimFailOverlap);
|
instance.sendMessage(player, TextMode.Err, Messages.CreateClaimFailOverlap);
|
||||||
Visualization visualization = Visualization.FromClaim(claim, clickedBlock.getY(), VisualizationType.Claim, player.getLocation());
|
Visualization visualization = Visualization.FromClaim(claim, clickedBlock.getY(), VisualizationType.Claim, player.getLocation());
|
||||||
Visualization.Apply(player, visualization);
|
Visualization.Apply(player, visualization);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//otherwise tell the player he can't claim here because it's someone else's claim, and show him the claim
|
//otherwise tell the player he can't claim here because it's someone else's claim, and show him the claim
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2281,12 +2282,12 @@ class PlayerEventHandler implements Listener
|
||||||
Visualization visualization = Visualization.FromClaim(claim, clickedBlock.getY(), VisualizationType.ErrorClaim, player.getLocation());
|
Visualization visualization = Visualization.FromClaim(claim, clickedBlock.getY(), VisualizationType.ErrorClaim, player.getLocation());
|
||||||
Visualization.Apply(player, visualization);
|
Visualization.Apply(player, visualization);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//otherwise, the player isn't in an existing claim!
|
//otherwise, the player isn't in an existing claim!
|
||||||
|
|
||||||
//if he hasn't already start a claim with a previous shovel action
|
//if he hasn't already start a claim with a previous shovel action
|
||||||
Location lastShovelLocation = playerData.lastShovelLocation;
|
Location lastShovelLocation = playerData.lastShovelLocation;
|
||||||
if(lastShovelLocation == null)
|
if(lastShovelLocation == null)
|
||||||
|
|
@ -2297,7 +2298,7 @@ class PlayerEventHandler implements Listener
|
||||||
instance.sendMessage(player, TextMode.Err, Messages.ClaimsDisabledWorld);
|
instance.sendMessage(player, TextMode.Err, Messages.ClaimsDisabledWorld);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if he's at the claim count per player limit already and doesn't have permission to bypass, display an error message
|
//if he's at the claim count per player limit already and doesn't have permission to bypass, display an error message
|
||||||
if(instance.config_claims_maxClaimsPerPlayer > 0 &&
|
if(instance.config_claims_maxClaimsPerPlayer > 0 &&
|
||||||
!player.hasPermission("griefprevention.overrideclaimcountlimit") &&
|
!player.hasPermission("griefprevention.overrideclaimcountlimit") &&
|
||||||
|
|
@ -2306,16 +2307,16 @@ class PlayerEventHandler implements Listener
|
||||||
instance.sendMessage(player, TextMode.Err, Messages.ClaimCreationFailedOverClaimCountLimit);
|
instance.sendMessage(player, TextMode.Err, Messages.ClaimCreationFailedOverClaimCountLimit);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//remember it, and start him on the new claim
|
//remember it, and start him on the new claim
|
||||||
playerData.lastShovelLocation = clickedBlock.getLocation();
|
playerData.lastShovelLocation = clickedBlock.getLocation();
|
||||||
instance.sendMessage(player, TextMode.Instr, Messages.ClaimStart);
|
instance.sendMessage(player, TextMode.Instr, Messages.ClaimStart);
|
||||||
|
|
||||||
//show him where he's working
|
//show him where he's working
|
||||||
Visualization visualization = Visualization.FromClaim(new Claim(clickedBlock.getLocation(), clickedBlock.getLocation(), null, new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), null), clickedBlock.getY(), VisualizationType.RestoreNature, player.getLocation());
|
Visualization visualization = Visualization.FromClaim(new Claim(clickedBlock.getLocation(), clickedBlock.getLocation(), null, new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), null), clickedBlock.getY(), VisualizationType.RestoreNature, player.getLocation());
|
||||||
Visualization.Apply(player, visualization);
|
Visualization.Apply(player, visualization);
|
||||||
}
|
}
|
||||||
|
|
||||||
//otherwise, he's trying to finish creating a claim by setting the other boundary corner
|
//otherwise, he's trying to finish creating a claim by setting the other boundary corner
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2326,18 +2327,18 @@ class PlayerEventHandler implements Listener
|
||||||
this.onPlayerInteract(event);
|
this.onPlayerInteract(event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//apply pvp rule
|
//apply pvp rule
|
||||||
if(playerData.inPvpCombat())
|
if(playerData.inPvpCombat())
|
||||||
{
|
{
|
||||||
instance.sendMessage(player, TextMode.Err, Messages.NoClaimDuringPvP);
|
instance.sendMessage(player, TextMode.Err, Messages.NoClaimDuringPvP);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//apply minimum claim dimensions rule
|
//apply minimum claim dimensions rule
|
||||||
int newClaimWidth = Math.abs(playerData.lastShovelLocation.getBlockX() - clickedBlock.getX()) + 1;
|
int newClaimWidth = Math.abs(playerData.lastShovelLocation.getBlockX() - clickedBlock.getX()) + 1;
|
||||||
int newClaimHeight = Math.abs(playerData.lastShovelLocation.getBlockZ() - clickedBlock.getZ()) + 1;
|
int newClaimHeight = Math.abs(playerData.lastShovelLocation.getBlockZ() - clickedBlock.getZ()) + 1;
|
||||||
|
|
||||||
if(playerData.shovelMode != ShovelMode.Admin)
|
if(playerData.shovelMode != ShovelMode.Admin)
|
||||||
{
|
{
|
||||||
if(newClaimWidth < instance.config_claims_minWidth || newClaimHeight < instance.config_claims_minWidth)
|
if(newClaimWidth < instance.config_claims_minWidth || newClaimHeight < instance.config_claims_minWidth)
|
||||||
|
|
@ -2349,7 +2350,7 @@ class PlayerEventHandler implements Listener
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int newArea = newClaimWidth * newClaimHeight;
|
int newArea = newClaimWidth * newClaimHeight;
|
||||||
if(newArea < instance.config_claims_minArea)
|
if(newArea < instance.config_claims_minArea)
|
||||||
{
|
{
|
||||||
|
|
@ -2357,15 +2358,15 @@ class PlayerEventHandler implements Listener
|
||||||
{
|
{
|
||||||
instance.sendMessage(player, TextMode.Err, Messages.ResizeClaimInsufficientArea, String.valueOf(instance.config_claims_minArea));
|
instance.sendMessage(player, TextMode.Err, Messages.ResizeClaimInsufficientArea, String.valueOf(instance.config_claims_minArea));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//if not an administrative claim, verify the player has enough claim blocks for this new claim
|
//if not an administrative claim, verify the player has enough claim blocks for this new claim
|
||||||
if(playerData.shovelMode != ShovelMode.Admin)
|
if(playerData.shovelMode != ShovelMode.Admin)
|
||||||
{
|
{
|
||||||
int newClaimArea = newClaimWidth * newClaimHeight;
|
int newClaimArea = newClaimWidth * newClaimHeight;
|
||||||
int remainingBlocks = playerData.getRemainingClaimBlocks();
|
int remainingBlocks = playerData.getRemainingClaimBlocks();
|
||||||
if(newClaimArea > remainingBlocks)
|
if(newClaimArea > remainingBlocks)
|
||||||
{
|
{
|
||||||
|
|
@ -2373,29 +2374,29 @@ class PlayerEventHandler implements Listener
|
||||||
instance.dataStore.tryAdvertiseAdminAlternatives(player);
|
instance.dataStore.tryAdvertiseAdminAlternatives(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
playerID = null;
|
playerID = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
//try to create a new claim
|
//try to create a new claim
|
||||||
CreateClaimResult result = this.dataStore.createClaim(
|
CreateClaimResult result = this.dataStore.createClaim(
|
||||||
player.getWorld(),
|
player.getWorld(),
|
||||||
lastShovelLocation.getBlockX(), clickedBlock.getX(),
|
lastShovelLocation.getBlockX(), clickedBlock.getX(),
|
||||||
lastShovelLocation.getBlockY() - instance.config_claims_claimsExtendIntoGroundDistance, clickedBlock.getY() - instance.config_claims_claimsExtendIntoGroundDistance,
|
lastShovelLocation.getBlockY() - instance.config_claims_claimsExtendIntoGroundDistance, clickedBlock.getY() - instance.config_claims_claimsExtendIntoGroundDistance,
|
||||||
lastShovelLocation.getBlockZ(), clickedBlock.getZ(),
|
lastShovelLocation.getBlockZ(), clickedBlock.getZ(),
|
||||||
playerID,
|
playerID,
|
||||||
null, null,
|
null, null,
|
||||||
player);
|
player);
|
||||||
|
|
||||||
//if it didn't succeed, tell the player why
|
//if it didn't succeed, tell the player why
|
||||||
if(!result.succeeded)
|
if(!result.succeeded)
|
||||||
{
|
{
|
||||||
if(result.claim != null)
|
if(result.claim != null)
|
||||||
{
|
{
|
||||||
instance.sendMessage(player, TextMode.Err, Messages.CreateClaimFailOverlapShort);
|
instance.sendMessage(player, TextMode.Err, Messages.CreateClaimFailOverlapShort);
|
||||||
|
|
||||||
Visualization visualization = Visualization.FromClaim(result.claim, clickedBlock.getY(), VisualizationType.ErrorClaim, player.getLocation());
|
Visualization visualization = Visualization.FromClaim(result.claim, clickedBlock.getY(), VisualizationType.ErrorClaim, player.getLocation());
|
||||||
Visualization.Apply(player, visualization);
|
Visualization.Apply(player, visualization);
|
||||||
}
|
}
|
||||||
|
|
@ -2403,25 +2404,25 @@ class PlayerEventHandler implements Listener
|
||||||
{
|
{
|
||||||
instance.sendMessage(player, TextMode.Err, Messages.CreateClaimFailOverlapRegion);
|
instance.sendMessage(player, TextMode.Err, Messages.CreateClaimFailOverlapRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//otherwise, advise him on the /trust command and show him his new claim
|
//otherwise, advise him on the /trust command and show him his new claim
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
instance.sendMessage(player, TextMode.Success, Messages.CreateClaimSuccess);
|
instance.sendMessage(player, TextMode.Success, Messages.CreateClaimSuccess);
|
||||||
Visualization visualization = Visualization.FromClaim(result.claim, clickedBlock.getY(), VisualizationType.Claim, player.getLocation());
|
Visualization visualization = Visualization.FromClaim(result.claim, clickedBlock.getY(), VisualizationType.Claim, player.getLocation());
|
||||||
Visualization.Apply(player, visualization);
|
Visualization.Apply(player, visualization);
|
||||||
playerData.lastShovelLocation = null;
|
playerData.lastShovelLocation = null;
|
||||||
|
|
||||||
//if it's a big claim, tell the player about subdivisions
|
//if it's a big claim, tell the player about subdivisions
|
||||||
if(!player.hasPermission("griefprevention.adminclaims") && result.claim.getArea() >= 1000)
|
if(!player.hasPermission("griefprevention.adminclaims") && result.claim.getArea() >= 1000)
|
||||||
{
|
{
|
||||||
instance.sendMessage(player, TextMode.Info, Messages.BecomeMayor, 200L);
|
instance.sendMessage(player, TextMode.Info, Messages.BecomeMayor, 200L);
|
||||||
instance.sendMessage(player, TextMode.Instr, Messages.SubdivisionVideo2, 201L, DataStore.SUBDIVISION_VIDEO_URL);
|
instance.sendMessage(player, TextMode.Instr, Messages.SubdivisionVideo2, 201L, DataStore.SUBDIVISION_VIDEO_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
instance.autoExtendClaim(result.claim);
|
instance.autoExtendClaim(result.claim);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user