mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Fixes
This commit is contained in:
parent
1d1834699a
commit
5d0f377d3b
@ -138,7 +138,7 @@ public class PlayerFunctions {
|
|||||||
// System.out.print("SOUTH");
|
// System.out.print("SOUTH");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
PlotId id = new PlotId(dx,dz);
|
PlotId id = new PlotId(dx+1,dz+1);
|
||||||
Plot plot = PlotMain.getPlots(loc.getWorld()).get(id);
|
Plot plot = PlotMain.getPlots(loc.getWorld()).get(id);
|
||||||
if (plot==null) {
|
if (plot==null) {
|
||||||
return id;
|
return id;
|
||||||
|
@ -477,7 +477,7 @@ public class PlotHelper {
|
|||||||
final World world = requester.getWorld();
|
final World world = requester.getWorld();
|
||||||
final Location pos1 = getPlotBottomLoc(world, plot.id).add(1, 0, 1);
|
final Location pos1 = getPlotBottomLoc(world, plot.id).add(1, 0, 1);
|
||||||
final Location pos2 = getPlotTopLoc(world, plot.id);
|
final Location pos2 = getPlotTopLoc(world, plot.id);
|
||||||
|
|
||||||
final short[] plotfloors = new short[plotworld.TOP_BLOCK.length];
|
final short[] plotfloors = new short[plotworld.TOP_BLOCK.length];
|
||||||
final short[] plotfloors_data = new short[plotworld.TOP_BLOCK.length];
|
final short[] plotfloors_data = new short[plotworld.TOP_BLOCK.length];
|
||||||
|
|
||||||
@ -783,7 +783,7 @@ public class PlotHelper {
|
|||||||
|
|
||||||
public static Location getPlotTopLoc(World world, PlotId id) {
|
public static Location getPlotTopLoc(World world, PlotId id) {
|
||||||
Plot plot = PlotMain.getPlots(world).get(id);
|
Plot plot = PlotMain.getPlots(world).get(id);
|
||||||
if (id!=null) {
|
if (plot!=null) {
|
||||||
id = PlayerFunctions.getTopPlot(world, plot).id;
|
id = PlayerFunctions.getTopPlot(world, plot).id;
|
||||||
}
|
}
|
||||||
PlotWorld plotworld = PlotMain.getWorldSettings(world);
|
PlotWorld plotworld = PlotMain.getWorldSettings(world);
|
||||||
@ -798,7 +798,7 @@ public class PlotHelper {
|
|||||||
|
|
||||||
public static Location getPlotBottomLoc(World world, PlotId id) {
|
public static Location getPlotBottomLoc(World world, PlotId id) {
|
||||||
Plot plot = PlotMain.getPlots(world).get(id);
|
Plot plot = PlotMain.getPlots(world).get(id);
|
||||||
if (id!=null) {
|
if (plot!=null) {
|
||||||
id = PlayerFunctions.getBottomPlot(world, plot).id;
|
id = PlayerFunctions.getBottomPlot(world, plot).id;
|
||||||
}
|
}
|
||||||
PlotWorld plotworld = PlotMain.getWorldSettings(world);
|
PlotWorld plotworld = PlotMain.getWorldSettings(world);
|
||||||
|
@ -11,6 +11,7 @@ package com.intellectualcrafters.plot.commands;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.intellectualcrafters.plot.C;
|
||||||
import com.intellectualcrafters.plot.PlayerFunctions;
|
import com.intellectualcrafters.plot.PlayerFunctions;
|
||||||
import com.intellectualcrafters.plot.Plot;
|
import com.intellectualcrafters.plot.Plot;
|
||||||
import com.intellectualcrafters.plot.PlotMain;
|
import com.intellectualcrafters.plot.PlotMain;
|
||||||
@ -32,6 +33,10 @@ public class Clear extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
||||||
|
if ((plot==null || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId())) && !plr.hasPermission("plots.admin")) {
|
||||||
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
boolean result = PlotMain.removePlot(plr.getWorld().getName(), plot.id, true);
|
boolean result = PlotMain.removePlot(plr.getWorld().getName(), plot.id, true);
|
||||||
if (result) {
|
if (result) {
|
||||||
plot.clear(plr);
|
plot.clear(plr);
|
||||||
|
@ -30,7 +30,7 @@ public enum Command {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
CLEAR("clear", "delete", new CommandPermission("plots.admin")),
|
CLEAR("clear", "delete", new CommandPermission("plots.clear")),
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -246,7 +246,7 @@ public class PlayerEvents implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (PlayerFunctions.getPlot(event.getBlock().getLocation()).equals("road")) {
|
if (PlayerFunctions.getPlot(event.getBlock().getLocation())==null) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -266,7 +266,7 @@ public class PlayerEvents implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (PlayerFunctions.getPlot(event.getBlockPlaced().getLocation()).equals("road")) {
|
if (PlayerFunctions.getPlot(event.getBlockPlaced().getLocation())==null) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -483,7 +483,7 @@ public class PlayerEvents implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (PlayerFunctions.getPlot(event.getClickedBlock().getLocation()).equals("road")) {
|
if (PlayerFunctions.getPlot(event.getClickedBlock().getLocation())==null) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import com.intellectualcrafters.plot.Plot;
|
|||||||
import com.intellectualcrafters.plot.PlotHelper;
|
import com.intellectualcrafters.plot.PlotHelper;
|
||||||
import com.intellectualcrafters.plot.PlotId;
|
import com.intellectualcrafters.plot.PlotId;
|
||||||
import com.intellectualcrafters.plot.PlotMain;
|
import com.intellectualcrafters.plot.PlotMain;
|
||||||
|
import com.intellectualcrafters.plot.events.PlayerEnterPlotEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -117,6 +118,7 @@ public class WorldEditListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||||
public void onPlayerCommand(PlayerCommandPreprocessEvent e) {
|
public void onPlayerCommand(PlayerCommandPreprocessEvent e) {
|
||||||
if (e.getPlayer().hasPermission("plots.worldedit.bypass")) {
|
if (e.getPlayer().hasPermission("plots.worldedit.bypass")) {
|
||||||
|
PWE.removeMask(e.getPlayer());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
@ -136,6 +138,10 @@ public class WorldEditListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||||
public void onInteract(PlayerInteractEvent e) {
|
public void onInteract(PlayerInteractEvent e) {
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
|
if (p.hasPermission("plots.worldedit.bypass")) {
|
||||||
|
PWE.removeMask(p);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!p.hasPermission("plots.admin") && isPlotWorld(p.getLocation())) {
|
if (!p.hasPermission("plots.admin") && isPlotWorld(p.getLocation())) {
|
||||||
if (((e.getAction() == Action.LEFT_CLICK_BLOCK) || (e.getAction() == Action.RIGHT_CLICK_BLOCK)) && (p.getItemInHand() != null) && (p.getItemInHand().getType() != Material.AIR)) {
|
if (((e.getAction() == Action.LEFT_CLICK_BLOCK) || (e.getAction() == Action.RIGHT_CLICK_BLOCK)) && (p.getItemInHand() != null) && (p.getItemInHand().getType() != Material.AIR)) {
|
||||||
Block b = e.getClickedBlock();
|
Block b = e.getClickedBlock();
|
||||||
|
Loading…
Reference in New Issue
Block a user