mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16:45 +01:00
Minor tweaks
This commit is contained in:
parent
95feaed870
commit
215ed04754
2
pom.xml
2
pom.xml
@ -8,7 +8,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<artifactId>PlotSquared</artifactId>
|
<artifactId>PlotSquared</artifactId>
|
||||||
<version>3.2.16</version>
|
<version>3.2.17</version>
|
||||||
<name>PlotSquared</name>
|
<name>PlotSquared</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<build>
|
<build>
|
||||||
|
@ -146,14 +146,12 @@ public class PS {
|
|||||||
PLATFORM = platform;
|
PLATFORM = platform;
|
||||||
EconHandler.manager = IMP.getEconomyHandler();
|
EconHandler.manager = IMP.getEconomyHandler();
|
||||||
if (getJavaVersion() < 1.7) {
|
if (getJavaVersion() < 1.7) {
|
||||||
log(C.PREFIX.s() + "&cYour java version is outdated. Please update to at least 1.7.");
|
log(C.CONSOLE_JAVA_OUTDATED_1_7);
|
||||||
// Didn't know of any other link :D
|
|
||||||
log(C.PREFIX.s() + "&cURL: &6https://java.com/en/download/index.jsp");
|
|
||||||
IMP.disable();
|
IMP.disable();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (getJavaVersion() < 1.8) {
|
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();
|
TASK = IMP.getTaskManager();
|
||||||
if (C.ENABLED.s().length() > 0) {
|
if (C.ENABLED.s().length() > 0) {
|
||||||
@ -185,7 +183,7 @@ public class PS {
|
|||||||
if (Settings.METRICS) {
|
if (Settings.METRICS) {
|
||||||
IMP.startMetrics();
|
IMP.startMetrics();
|
||||||
} else {
|
} else {
|
||||||
log("&dUsing metrics will allow us to improve the plugin, please consider it :)");
|
log(C.CONSOLE_PLEASE_ENABLE_METRICS);
|
||||||
}
|
}
|
||||||
IMP.startMetrics();
|
IMP.startMetrics();
|
||||||
if (Settings.CHUNK_PROCESSOR) {
|
if (Settings.CHUNK_PROCESSOR) {
|
||||||
|
@ -69,8 +69,8 @@ public class Template extends SubCommand {
|
|||||||
final ZipInputStream zis = new ZipInputStream(new FileInputStream(input));
|
final ZipInputStream zis = new ZipInputStream(new FileInputStream(input));
|
||||||
ZipEntry ze = zis.getNextEntry();
|
ZipEntry ze = zis.getNextEntry();
|
||||||
while (ze != null) {
|
while (ze != null) {
|
||||||
final String name = ze.getName();
|
final String name = ze.getName().replace('\\', File.separatorChar).replace('/', File.separatorChar);
|
||||||
final File newFile = new File((output + File.separator + name.replaceAll("[\\\\|\\|/]", File.separator)).replaceAll("__TEMP_DIR__", world));
|
final File newFile = new File((output + File.separator + name).replaceAll("__TEMP_DIR__", world));
|
||||||
new File(newFile.getParent()).mkdirs();
|
new File(newFile.getParent()).mkdirs();
|
||||||
final FileOutputStream fos = new FileOutputStream(newFile);
|
final FileOutputStream fos = new FileOutputStream(newFile);
|
||||||
int len;
|
int len;
|
||||||
|
@ -90,6 +90,12 @@ public enum C {
|
|||||||
PERMISSION_ADMIN_INTERACT_UNOWNED("plots.admin.interact.unowned", "static.permissions"),
|
PERMISSION_ADMIN_INTERACT_UNOWNED("plots.admin.interact.unowned", "static.permissions"),
|
||||||
PERMISSION_ADMIN_INTERACT_OTHER("plots.admin.interact.other", "static.permissions"),
|
PERMISSION_ADMIN_INTERACT_OTHER("plots.admin.interact.other", "static.permissions"),
|
||||||
PERMISSION_ADMIN_BUILD_HEIGHTLIMIT("plots.admin.build.heightlimit", "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
|
* Confirm
|
||||||
*/
|
*/
|
||||||
|
@ -661,7 +661,6 @@ public class MainUtil {
|
|||||||
plot = plot.getBasePlot(false);
|
plot = plot.getBasePlot(false);
|
||||||
final PlotWorld plotworld = PS.get().getPlotWorld(plot.world);
|
final PlotWorld plotworld = PS.get().getPlotWorld(plot.world);
|
||||||
if (plotworld.DEFAULT_HOME != null) {
|
if (plotworld.DEFAULT_HOME != null) {
|
||||||
final PlotManager manager = PS.get().getPlotManager(plot.world);
|
|
||||||
final int x;
|
final int x;
|
||||||
final int z;
|
final int z;
|
||||||
if ((plotworld.DEFAULT_HOME.x == Integer.MAX_VALUE) && (plotworld.DEFAULT_HOME.z == Integer.MAX_VALUE)) {
|
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;
|
x = bot.getX() + plotworld.DEFAULT_HOME.x;
|
||||||
z = bot.getZ() + plotworld.DEFAULT_HOME.z;
|
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);
|
return new Location(plot.world, x, y + 1, z);
|
||||||
}
|
}
|
||||||
// Side
|
// Side
|
||||||
|
@ -3,6 +3,7 @@ package com.plotsquared.bukkit;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -16,6 +17,7 @@ import org.bukkit.entity.Entity;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.generator.ChunkGenerator;
|
import org.bukkit.generator.ChunkGenerator;
|
||||||
|
import org.bukkit.metadata.MetadataValue;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
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.config.Settings;
|
||||||
import com.intellectualcrafters.plot.flag.FlagManager;
|
import com.intellectualcrafters.plot.flag.FlagManager;
|
||||||
import com.intellectualcrafters.plot.generator.HybridUtils;
|
import com.intellectualcrafters.plot.generator.HybridUtils;
|
||||||
|
import com.intellectualcrafters.plot.object.Plot;
|
||||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||||
import com.intellectualcrafters.plot.object.PlotWorld;
|
import com.intellectualcrafters.plot.object.PlotWorld;
|
||||||
import com.intellectualcrafters.plot.object.SetupObject;
|
import com.intellectualcrafters.plot.object.SetupObject;
|
||||||
@ -244,8 +247,20 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
|||||||
if (!Settings.KILL_ROAD_VEHICLES) {
|
if (!Settings.KILL_ROAD_VEHICLES) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
final Location loc = entity.getLocation();
|
com.intellectualcrafters.plot.object.Location loc = BukkitUtil.getLocation(entity.getLocation());
|
||||||
if (MainUtil.isPlotRoad(BukkitUtil.getLocation(loc))) {
|
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();
|
entity.remove();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1789,9 +1789,22 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
|
|||||||
public void onVehicleCreate(final VehicleCreateEvent event) {
|
public void onVehicleCreate(final VehicleCreateEvent event) {
|
||||||
final Vehicle entity = event.getVehicle();
|
final Vehicle entity = event.getVehicle();
|
||||||
final Location loc = BukkitUtil.getLocation(entity);
|
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)) {
|
if (checkEntity(entity, plot)) {
|
||||||
entity.remove();
|
entity.remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Settings.KILL_ROAD_VEHICLES) {
|
||||||
|
entity.setMetadata("plot", new FixedMetadataValue((Plugin) PS.get().IMP, plot));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user