mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
parent
45d8556b87
commit
82b17aeebf
@ -335,9 +335,8 @@ public class Metrics {
|
||||
else
|
||||
playersOnline = ((Player[])Bukkit.class.getMethod("getOnlinePlayers", new Class<?>[0]).invoke(null, new Object[0])).length;
|
||||
}
|
||||
catch (NoSuchMethodException ex){}
|
||||
catch (InvocationTargetException ex){}
|
||||
catch (IllegalAccessException ex){}
|
||||
catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException ex){}
|
||||
|
||||
// END server software specific section -- all code below does not use
|
||||
// any code outside of this class / Java
|
||||
// Construct the post data
|
||||
|
@ -22,16 +22,12 @@ import com.intellectualcrafters.plot.uuid.PlotUUIDSaver;
|
||||
import com.intellectualcrafters.plot.uuid.UUIDSaver;
|
||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
|
||||
import me.confuser.barapi.BarAPI;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Tameable;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@ -680,7 +676,7 @@ public class PlotMain extends JavaPlugin {
|
||||
add("plot");
|
||||
}
|
||||
});
|
||||
getCommand("plots").setTabCompleter(command);
|
||||
//getCommand("plots").setTabCompleter(command);
|
||||
getServer().getPluginManager().registerEvents(new PlayerEvents(), this);
|
||||
PlotPlusListener.startRunnable(this);
|
||||
getServer().getPluginManager().registerEvents(new PlotPlusListener(), this);
|
||||
|
@ -88,6 +88,7 @@ public abstract class PlotWorld {
|
||||
public boolean SPAWN_BREEDING;
|
||||
public static boolean SPAWN_BREEDING_DEFAULT = false;
|
||||
|
||||
|
||||
public PlotWorld(String worldname) {
|
||||
this.worldname = worldname;
|
||||
}
|
||||
|
@ -36,8 +36,6 @@ public class RUtils {
|
||||
double s = sec % 60;
|
||||
String string = C.TIME_FORMAT.s();
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
// String s_d = (int) d + " " + (d != 1 ? "days" : "day");
|
||||
String s_h = (int) h + " " + ((int) h != 1 ? "hours" : "hour");
|
||||
String s_m = (int) m + " " + ((int) m != 1 ? "minutes" : "minute");
|
||||
String s_s = (int) s + " " + ((int) s != 1 ? "seconds" : "second");
|
||||
@ -68,7 +66,6 @@ public class RUtils {
|
||||
double d = ((l.getYaw() * 4.0F) / 360.0F) + 0.5D;
|
||||
int i = (int) d;
|
||||
int x = d < i ? i - 1 : i;
|
||||
|
||||
switch (x) {
|
||||
case 0:
|
||||
return Direction.SOUTH;
|
||||
|
@ -130,6 +130,7 @@ public class Auto extends SubCommand {
|
||||
while (!br) {
|
||||
PlotId start = getNextPlot(Auto.lastPlot, 1);
|
||||
|
||||
//FIXME: Wtf is going on here?
|
||||
if (claimed) {
|
||||
if (PlotMain.getPlots(world).get(start) == null || PlotMain.getPlots(world).get(start).owner == null) {
|
||||
Auto.lastPlot = start;
|
||||
@ -181,7 +182,7 @@ public class Auto extends SubCommand {
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (id.x==id.y && id.x > 0) {
|
||||
if (id.x.equals(id.y) && id.x > 0) {
|
||||
return new PlotId(id.x, id.y + step);
|
||||
}
|
||||
if (id.x==absX) {
|
||||
|
@ -8,21 +8,13 @@
|
||||
|
||||
package com.intellectualcrafters.plot.commands;
|
||||
|
||||
import com.intellectualcrafters.plot.*;
|
||||
import com.intellectualcrafters.plot.events.PlayerClaimPlotEvent;
|
||||
import com.intellectualcrafters.plot.generator.DefaultPlotWorld;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.C;
|
||||
import com.intellectualcrafters.plot.FlagManager;
|
||||
import com.intellectualcrafters.plot.PlayerFunctions;
|
||||
import com.intellectualcrafters.plot.Plot;
|
||||
import com.intellectualcrafters.plot.PlotHelper;
|
||||
import com.intellectualcrafters.plot.PlotMain;
|
||||
import com.intellectualcrafters.plot.PlotWorld;
|
||||
import com.intellectualcrafters.plot.SchematicHandler;
|
||||
import com.intellectualcrafters.plot.events.PlayerClaimPlotEvent;
|
||||
|
||||
/**
|
||||
* @author Citymonstret
|
||||
*/
|
||||
@ -118,6 +110,12 @@ public class Claim extends SubCommand {
|
||||
if (world.DEFAULT_FLAGS != null && world.DEFAULT_FLAGS.size() > 0) {
|
||||
plot2.settings.setFlags(FlagManager.parseFlags(world.DEFAULT_FLAGS));
|
||||
}
|
||||
if (world instanceof DefaultPlotWorld) {
|
||||
DefaultPlotWorld pW = (DefaultPlotWorld) world;
|
||||
if(pW.CLAIMED_WALL_BLOCK != pW.WALL_BLOCK) {
|
||||
PlotMain.getPlotManager(plot.getWorld()).setWall(plot.getWorld(), world, plot.getId(), pW.CLAIMED_WALL_BLOCK);
|
||||
}
|
||||
}
|
||||
}
|
||||
return event.isCancelled();
|
||||
}
|
||||
|
@ -86,6 +86,10 @@ public enum Command {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
INTERFACE("interface", "int", new CommandPermission("plots.interface")),
|
||||
/**
|
||||
*
|
||||
*/
|
||||
HOME("home", "h"),
|
||||
/**
|
||||
*
|
||||
|
@ -64,8 +64,7 @@ public class MainCommand implements CommandExecutor, TabCompleter {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(C.HELP_INFO.s());
|
||||
for (SubCommand.CommandCategory category : SubCommand.CommandCategory.values()) {
|
||||
builder.append("\n"
|
||||
+ C.HELP_INFO_ITEM.s().replaceAll("%category%", category.toString().toLowerCase()).replaceAll("%category_desc%", category.toString()));
|
||||
builder.append("\n").append(C.HELP_INFO_ITEM.s().replaceAll("%category%", category.toString().toLowerCase()).replaceAll("%category_desc%", category.toString()));
|
||||
}
|
||||
PlayerFunctions.sendMessage(player, builder.toString());
|
||||
return true;
|
||||
@ -82,15 +81,14 @@ public class MainCommand implements CommandExecutor, TabCompleter {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(C.HELP_INFO.s());
|
||||
for (SubCommand.CommandCategory category : SubCommand.CommandCategory.values()) {
|
||||
builder.append("\n"
|
||||
+ C.HELP_INFO_ITEM.s().replaceAll("%category%", category.toString().toLowerCase()).replaceAll("%category_desc%", category.toString()));
|
||||
builder.append("\n").append(C.HELP_INFO_ITEM.s().replaceAll("%category%", category.toString().toLowerCase()).replaceAll("%category_desc%", category.toString()));
|
||||
}
|
||||
PlayerFunctions.sendMessage(player, builder.toString());
|
||||
return true;
|
||||
}
|
||||
StringBuilder help = new StringBuilder();
|
||||
for (String string : helpMenu(player, cato)) {
|
||||
help.append(string + "\n");
|
||||
help.append(string).append("\n");
|
||||
}
|
||||
PlayerFunctions.sendMessage(player, help.toString());
|
||||
return true;
|
||||
@ -99,15 +97,13 @@ public class MainCommand implements CommandExecutor, TabCompleter {
|
||||
for (SubCommand command : subCommands) {
|
||||
if (command.cmd.equalsIgnoreCase(args[0]) || command.alias.equalsIgnoreCase(args[0])) {
|
||||
String[] arguments = new String[args.length - 1];
|
||||
for (int x = 1; x < args.length; x++) {
|
||||
arguments[x - 1] = args[x];
|
||||
}
|
||||
System.arraycopy(args, 1, arguments, 0, args.length - 1);
|
||||
if (command.permission.hasPermission(player)) {
|
||||
if (player!=null || !command.isPlayer ) {
|
||||
return command.execute(player, arguments);
|
||||
}
|
||||
else {
|
||||
PlayerFunctions.sendMessage(player, C.IS_CONSOLE);
|
||||
PlayerFunctions.sendMessage(null, C.IS_CONSOLE);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +1,13 @@
|
||||
package com.intellectualcrafters.plot.generator;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.intellectualcrafters.plot.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.PlayerFunctions;
|
||||
import com.intellectualcrafters.plot.Plot;
|
||||
import com.intellectualcrafters.plot.PlotBlock;
|
||||
import com.intellectualcrafters.plot.PlotHelper;
|
||||
import com.intellectualcrafters.plot.PlotId;
|
||||
import com.intellectualcrafters.plot.PlotMain;
|
||||
import com.intellectualcrafters.plot.PlotManager;
|
||||
import com.intellectualcrafters.plot.PlotWorld;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class DefaultPlotManager extends PlotManager {
|
||||
|
||||
@ -233,8 +224,10 @@ public class DefaultPlotManager extends PlotManager {
|
||||
PlotBlock[] plotfloor = dpw.TOP_BLOCK;
|
||||
PlotBlock[] filling = dpw.MAIN_BLOCK;
|
||||
|
||||
PlotBlock wall = dpw.WALL_BLOCK;
|
||||
PlotBlock wall_filling = dpw.WALL_FILLING;
|
||||
//PlotBlock wall = dpw.WALL_BLOCK;
|
||||
PlotBlock wall = plot.hasOwner() ? dpw.CLAIMED_WALL_BLOCK : dpw.WALL_BLOCK;
|
||||
|
||||
PlotBlock wall_filling = dpw.WALL_FILLING;
|
||||
|
||||
Block block = world.getBlockAt(new Location(world, pos1.getBlockX()-1, 1, pos1.getBlockZ()));
|
||||
if (block.getTypeId()!=wall_filling.id || block.getData()!=wall_filling.data) {
|
||||
|
@ -87,6 +87,8 @@ public class DefaultPlotWorld extends PlotWorld {
|
||||
* Default wall block: 44
|
||||
*/
|
||||
public static PlotBlock WALL_BLOCK_DEFAULT = new PlotBlock((short) 44, (byte) 0);
|
||||
public PlotBlock CLAIMED_WALL_BLOCK;
|
||||
public static PlotBlock CLAIMED_WALL_BLOCK_DEFAULT = new PlotBlock((short) 44, (byte) 1);
|
||||
|
||||
/**
|
||||
* Wall filling
|
||||
@ -144,6 +146,7 @@ public class DefaultPlotWorld extends PlotWorld {
|
||||
new ConfigurationNode("plot.filling", DefaultPlotWorld.MAIN_BLOCK_DEFAULT, "Plot block", Configuration.BLOCKLIST, true),
|
||||
new ConfigurationNode("plot.floor", DefaultPlotWorld.TOP_BLOCK_DEFAULT, "Plot floor block", Configuration.BLOCKLIST, true),
|
||||
new ConfigurationNode("wall.block", DefaultPlotWorld.WALL_BLOCK_DEFAULT, "Top wall block", Configuration.BLOCK, true),
|
||||
new ConfigurationNode("wall.block.claimed", DefaultPlotWorld.CLAIMED_WALL_BLOCK_DEFAULT, "Wall block (claimed)", Configuration.BLOCK, true),
|
||||
new ConfigurationNode("road.width", DefaultPlotWorld.ROAD_WIDTH_DEFAULT, "Road width", Configuration.INTEGER, true),
|
||||
new ConfigurationNode("road.height", DefaultPlotWorld.ROAD_HEIGHT_DEFAULT, "Road height", Configuration.INTEGER, true),
|
||||
new ConfigurationNode("road.enable_stripes", DefaultPlotWorld.ROAD_STRIPES_ENABLED_DEFAULT, "Enable road stripes", Configuration.BOOLEAN, true),
|
||||
@ -179,6 +182,6 @@ public class DefaultPlotWorld extends PlotWorld {
|
||||
this.ROAD_STRIPES = (PlotBlock) Configuration.BLOCK.parseString(config.getString("road.stripes"));
|
||||
this.WALL_FILLING = (PlotBlock) Configuration.BLOCK.parseString(config.getString("wall.filling"));
|
||||
this.WALL_HEIGHT = config.getInt("wall.height");
|
||||
|
||||
this.CLAIMED_WALL_BLOCK = (PlotBlock) Configuration.BLOCK.parseString(config.getString("wall.block.claimed"));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user