Minor tweaks

This commit is contained in:
Jesse Boyd 2015-10-29 23:13:10 +11:00
parent 95feaed870
commit 215ed04754
8 changed files with 44 additions and 13 deletions

View File

@ -8,7 +8,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<artifactId>PlotSquared</artifactId>
<version>3.2.16</version>
<version>3.2.17</version>
<name>PlotSquared</name>
<packaging>jar</packaging>
<build>

View File

@ -146,14 +146,12 @@ public class PS {
PLATFORM = platform;
EconHandler.manager = IMP.getEconomyHandler();
if (getJavaVersion() < 1.7) {
log(C.PREFIX.s() + "&cYour java version is outdated. Please update to at least 1.7.");
// Didn't know of any other link :D
log(C.PREFIX.s() + "&cURL: &6https://java.com/en/download/index.jsp");
log(C.CONSOLE_JAVA_OUTDATED_1_7);
IMP.disable();
return;
}
if (getJavaVersion() < 1.8) {
log(C.PREFIX.s() + "&cIt's really recommended to run Java 1.8, as it increases performance");
log(C.CONSOLE_JAVA_OUTDATED_1_8);
}
TASK = IMP.getTaskManager();
if (C.ENABLED.s().length() > 0) {
@ -185,7 +183,7 @@ public class PS {
if (Settings.METRICS) {
IMP.startMetrics();
} else {
log("&dUsing metrics will allow us to improve the plugin, please consider it :)");
log(C.CONSOLE_PLEASE_ENABLE_METRICS);
}
IMP.startMetrics();
if (Settings.CHUNK_PROCESSOR) {

View File

@ -69,8 +69,8 @@ public class Template extends SubCommand {
final ZipInputStream zis = new ZipInputStream(new FileInputStream(input));
ZipEntry ze = zis.getNextEntry();
while (ze != null) {
final String name = ze.getName();
final File newFile = new File((output + File.separator + name.replaceAll("[\\\\|\\|/]", File.separator)).replaceAll("__TEMP_DIR__", world));
final String name = ze.getName().replace('\\', File.separatorChar).replace('/', File.separatorChar);
final File newFile = new File((output + File.separator + name).replaceAll("__TEMP_DIR__", world));
new File(newFile.getParent()).mkdirs();
final FileOutputStream fos = new FileOutputStream(newFile);
int len;

View File

@ -90,6 +90,12 @@ public enum C {
PERMISSION_ADMIN_INTERACT_UNOWNED("plots.admin.interact.unowned", "static.permissions"),
PERMISSION_ADMIN_INTERACT_OTHER("plots.admin.interact.other", "static.permissions"),
PERMISSION_ADMIN_BUILD_HEIGHTLIMIT("plots.admin.build.heightlimit", "static.permissions"),
/*
* Static console
*/
CONSOLE_JAVA_OUTDATED_1_7("&cYour java version is outdated. Please update to at least 1.7.\n&cURL: &6https://java.com/en/download/index.jsp","static.console"),
CONSOLE_JAVA_OUTDATED_1_8("&cIt's really recommended to run Java 1.8, as it increases performance","static.console"),
CONSOLE_PLEASE_ENABLE_METRICS("&dUsing metrics will allow us to improve the plugin, please consider it :)","static.console"),
/*
* Confirm
*/

View File

@ -661,7 +661,6 @@ public class MainUtil {
plot = plot.getBasePlot(false);
final PlotWorld plotworld = PS.get().getPlotWorld(plot.world);
if (plotworld.DEFAULT_HOME != null) {
final PlotManager manager = PS.get().getPlotManager(plot.world);
final int x;
final int z;
if ((plotworld.DEFAULT_HOME.x == Integer.MAX_VALUE) && (plotworld.DEFAULT_HOME.z == Integer.MAX_VALUE)) {
@ -675,7 +674,7 @@ public class MainUtil {
x = bot.getX() + plotworld.DEFAULT_HOME.x;
z = bot.getZ() + plotworld.DEFAULT_HOME.z;
}
final int y = Math.max(getHeighestBlock(plot.world, x, z), manager.getSignLoc(PS.get().getPlotWorld(plot.world), plot).getY());
final int y = getHeighestBlock(plot.world, x, z);
return new Location(plot.world, x, y + 1, z);
}
// Side

View File

@ -3,6 +3,7 @@ package com.plotsquared.bukkit;
import java.io.File;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import org.bukkit.Bukkit;
@ -16,6 +17,7 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
@ -27,6 +29,7 @@ import com.intellectualcrafters.plot.config.ConfigurationNode;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.generator.HybridUtils;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.object.SetupObject;
@ -244,8 +247,20 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
if (!Settings.KILL_ROAD_VEHICLES) {
continue;
}
final Location loc = entity.getLocation();
if (MainUtil.isPlotRoad(BukkitUtil.getLocation(loc))) {
com.intellectualcrafters.plot.object.Location loc = BukkitUtil.getLocation(entity.getLocation());
Plot plot = loc.getPlot();
if (plot == null) {
if (MainUtil.isPlotAreaAbs(loc)) {
entity.remove();
}
return;
}
List<MetadataValue> meta = entity.getMetadata("plot");
if (meta.size() == 0) {
return;
}
Plot origin = (Plot) meta.get(0).value();
if (!plot.equals(origin.getBasePlot(false))) {
entity.remove();
}
break;

View File

@ -1789,9 +1789,22 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
public void onVehicleCreate(final VehicleCreateEvent event) {
final Vehicle entity = event.getVehicle();
final Location loc = BukkitUtil.getLocation(entity);
final Plot plot = MainUtil.getPlot(loc);
if (loc.getPlotWorld() == null) {
return;
}
Plot plot = loc.getPlot();
if (plot == null) {
if (MainUtil.isPlotArea(loc)) {
entity.remove();
}
return;
}
if (checkEntity(entity, plot)) {
entity.remove();
return;
}
if (Settings.KILL_ROAD_VEHICLES) {
entity.setMetadata("plot", new FixedMetadataValue((Plugin) PS.get().IMP, plot));
}
}

Binary file not shown.