mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-29 04:04:43 +02:00
@ -1096,6 +1096,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
|
||||
case BEACON:
|
||||
case BED_BLOCK:
|
||||
case SIGN:
|
||||
case WALL_SIGN:
|
||||
case SIGN_POST:
|
||||
case ENCHANTMENT_TABLE:
|
||||
case BREWING_STAND:
|
||||
@ -1125,7 +1126,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
|
||||
if (eventType != null && !player.isSneaking()) {
|
||||
break;
|
||||
}
|
||||
if (hand == null) {
|
||||
if (hand == null || hand.getType() == Material.AIR || hand.getType().isBlock()) {
|
||||
eventType = PlayerBlockEventType.INTERACT_BLOCK;
|
||||
lb = new BukkitLazyBlock(block);
|
||||
break;
|
||||
|
@ -8,6 +8,7 @@ import org.bukkit.Effect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.WeatherType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
@ -130,7 +131,7 @@ public class BukkitPlayer extends PlotPlayer {
|
||||
if (Math.abs(loc.getX()) >= 30000000 || Math.abs(loc.getZ()) >= 30000000) {
|
||||
return;
|
||||
}
|
||||
this.player.teleport(new org.bukkit.Location(BukkitUtil.getWorld(loc.getWorld()), loc.getX() + 0.5, loc.getY(), loc.getZ() + 0.5, loc.getYaw(), loc.getPitch()));
|
||||
this.player.teleport(new org.bukkit.Location(BukkitUtil.getWorld(loc.getWorld()), loc.getX() + 0.5, loc.getY(), loc.getZ() + 0.5, loc.getYaw(), loc.getPitch()), TeleportCause.COMMAND);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -31,11 +31,11 @@ import com.intellectualcrafters.plot.object.schematic.PlotItem;
|
||||
import com.intellectualcrafters.plot.util.BlockManager;
|
||||
import com.intellectualcrafters.plot.util.MathMan;
|
||||
import com.intellectualcrafters.plot.util.StringComparison;
|
||||
import com.intellectualcrafters.plot.util.StringMan;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
import com.plotsquared.bukkit.object.BukkitPlayer;
|
||||
|
||||
public class BukkitUtil extends BlockManager {
|
||||
private static HashMap<String, World> worlds = new HashMap<>();
|
||||
private static String lastString = null;
|
||||
private static World lastWorld = null;
|
||||
|
||||
@ -145,14 +145,12 @@ public class BukkitUtil extends BlockManager {
|
||||
}
|
||||
|
||||
public static World getWorld(final String string) {
|
||||
if (string == lastString) {
|
||||
if (StringMan.isEqual(string,lastString)) {
|
||||
return lastWorld;
|
||||
}
|
||||
World world = worlds.get(string);
|
||||
if (world == null) {
|
||||
world = Bukkit.getWorld(string);
|
||||
worlds.put(string, world);
|
||||
}
|
||||
World world = Bukkit.getWorld(string);
|
||||
lastString = string;
|
||||
lastWorld = world;
|
||||
return world;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user