mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-12-24 16:58:50 +01:00
parent
0147690eba
commit
b4707c94c4
@ -228,13 +228,14 @@ public class PlotAPI {
|
|||||||
* Get the plot manager for a world. Most of these methods can be accessed
|
* Get the plot manager for a world. Most of these methods can be accessed
|
||||||
* through the MainUtil.
|
* through the MainUtil.
|
||||||
*
|
*
|
||||||
* @param world Which manager to get
|
* @param world the world to retrieve the manager from
|
||||||
*
|
*
|
||||||
* @return PlotManager
|
* @return PlotManager
|
||||||
*
|
*
|
||||||
* @see PlotManager
|
* @see PlotManager
|
||||||
* @see PS#getPlotManager(Plot)
|
* @see PS#getPlotManager(Plot)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public PlotManager getPlotManager(World world) {
|
public PlotManager getPlotManager(World world) {
|
||||||
if (world == null) {
|
if (world == null) {
|
||||||
@ -292,6 +293,7 @@ public class PlotAPI {
|
|||||||
* @see #getPlotAreas(World)
|
* @see #getPlotAreas(World)
|
||||||
* @see PlotArea
|
* @see PlotArea
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public PlotArea getWorldSettings(World world) {
|
public PlotArea getWorldSettings(World world) {
|
||||||
if (world == null) {
|
if (world == null) {
|
||||||
@ -395,6 +397,7 @@ public class PlotAPI {
|
|||||||
*
|
*
|
||||||
* @see PlotArea#getPlot(PlotId)
|
* @see PlotArea#getPlot(PlotId)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Plot getPlot(World world, int x, int z) {
|
public Plot getPlot(World world, int x, int z) {
|
||||||
if (world == null) {
|
if (world == null) {
|
||||||
@ -446,6 +449,7 @@ public class PlotAPI {
|
|||||||
*
|
*
|
||||||
* @see #getPlots(World, Player, boolean)
|
* @see #getPlots(World, Player, boolean)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public boolean hasPlot(World world, Player player) {
|
public boolean hasPlot(World world, Player player) {
|
||||||
return getPlots(world, player, true).length > 0;
|
return getPlots(world, player, true).length > 0;
|
||||||
@ -500,6 +504,7 @@ public class PlotAPI {
|
|||||||
* @return World[] - array of plot worlds
|
* @return World[] - array of plot worlds
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public String[] getPlotWorlds() {
|
public String[] getPlotWorlds() {
|
||||||
Set<String> plotWorldStrings = PS.get().getPlotWorldStrings();
|
Set<String> plotWorldStrings = PS.get().getPlotWorldStrings();
|
||||||
@ -531,6 +536,7 @@ public class PlotAPI {
|
|||||||
*
|
*
|
||||||
* @see Plot
|
* @see Plot
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Location[] getLocations(Plot plot) {
|
public Location[] getLocations(Plot plot) {
|
||||||
Location bukkitBottom = BukkitUtil.getLocation(plot.getCorners()[0]);
|
Location bukkitBottom = BukkitUtil.getLocation(plot.getCorners()[0]);
|
||||||
@ -563,9 +569,10 @@ public class PlotAPI {
|
|||||||
*
|
*
|
||||||
* @see Plot
|
* @see Plot
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Location getBottomLocation(Plot plot) {
|
public Location getBottomLocation(Plot plot) {
|
||||||
return BukkitUtil.getLocation(plot.getBottom());
|
return BukkitUtil.getLocation(plot.getCorners()[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -579,9 +586,10 @@ public class PlotAPI {
|
|||||||
*
|
*
|
||||||
* @see Plot
|
* @see Plot
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Location getTopLocation(Plot plot) {
|
public Location getTopLocation(Plot plot) {
|
||||||
return BukkitUtil.getLocation(plot.getTop());
|
return BukkitUtil.getLocation(plot.getCorners()[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -79,6 +79,7 @@ import org.bukkit.OfflinePlayer;
|
|||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.command.PluginCommand;
|
import org.bukkit.command.PluginCommand;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
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;
|
||||||
@ -313,10 +314,21 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
|||||||
}
|
}
|
||||||
Location location = entity.getLocation();
|
Location location = entity.getLocation();
|
||||||
if (BukkitUtil.getLocation(location).isPlotRoad()) {
|
if (BukkitUtil.getLocation(location).isPlotRoad()) {
|
||||||
Entity passenger = entity.getPassenger();
|
if (entity instanceof LivingEntity) {
|
||||||
if (!(passenger instanceof Player) && entity.getMetadata("keep").isEmpty()) {
|
LivingEntity livingEntity = (LivingEntity) entity;
|
||||||
iterator.remove();
|
if (!livingEntity.isLeashed() || !entity.hasMetadata("keep")) {
|
||||||
entity.remove();
|
Entity passenger = entity.getPassenger();
|
||||||
|
if (!(passenger instanceof Player) && entity.getMetadata("keep").isEmpty()) {
|
||||||
|
iterator.remove();
|
||||||
|
entity.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Entity passenger = entity.getPassenger();
|
||||||
|
if (!(passenger instanceof Player) && entity.getMetadata("keep").isEmpty()) {
|
||||||
|
iterator.remove();
|
||||||
|
entity.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@ import java.util.UUID;
|
|||||||
|
|
||||||
public class PlayerEvents_1_8 extends PlotListener implements Listener {
|
public class PlayerEvents_1_8 extends PlotListener implements Listener {
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onInventoryClick(InventoryClickEvent event) {
|
public void onInventoryClick(InventoryClickEvent event) {
|
||||||
if (!event.isLeftClick() || (event.getAction() != InventoryAction.PLACE_ALL) || event.isShiftClick()) {
|
if (!event.isLeftClick() || (event.getAction() != InventoryAction.PLACE_ALL) || event.isShiftClick()) {
|
||||||
|
@ -9,6 +9,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
|
|||||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.WeatherType;
|
import org.bukkit.WeatherType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||||
@ -180,7 +181,7 @@ public class BukkitPlayer extends PlotPlayer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playMusic(Location location, int id) {
|
public void playMusic(Location location, int id) {
|
||||||
this.player.playEffect(BukkitUtil.getLocation(location), Effect.RECORD_PLAY, id);
|
this.player.playEffect(BukkitUtil.getLocation(location), Effect.RECORD_PLAY, Material.getMaterial(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user