mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Fixes
Fixes #868 Fixes #778 Fixes attributes passing wrong key to persistent meta Fixes blob compatibility with JDBC driver for persistent meta Fix stackoverflow from countEntities under certain circumstances Minor cleanup
This commit is contained in:
@ -1,16 +1,5 @@
|
||||
package com.plotsquared.bukkit.object;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
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.plugin.PluginManager;
|
||||
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.object.Location;
|
||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
@ -19,6 +8,16 @@ import com.intellectualcrafters.plot.util.PlotGamemode;
|
||||
import com.intellectualcrafters.plot.util.PlotWeather;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||
import org.bukkit.Bukkit;
|
||||
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.plugin.PluginManager;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class BukkitPlayer extends PlotPlayer {
|
||||
|
||||
@ -133,24 +132,6 @@ public class BukkitPlayer extends PlotPlayer {
|
||||
return BukkitUtil.getLocationFull(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttribute(String key) {
|
||||
setPersistentMeta("attrib_" + key, new byte[]{(byte) 1});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAttribute(String key) {
|
||||
if (!hasPersistentMeta(key)) {
|
||||
return false;
|
||||
}
|
||||
return getPersistentMeta("attrib_" + key)[0] == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAttribute(String key) {
|
||||
removePersistentMeta("attrib_" + key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData() {
|
||||
if (!player.isOnline()) {
|
||||
|
@ -1075,7 +1075,9 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
final Set<Chunk> chunks = new HashSet<>();
|
||||
for (int X = bx; X <= tx; X++) {
|
||||
for (int Z = bz; Z <= tz; Z++) {
|
||||
chunks.add(world.getChunkAt(X, Z));
|
||||
if (world.isChunkLoaded(X, Z)) {
|
||||
chunks.add(world.getChunkAt(X, Z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,9 @@ public class SendChunk {
|
||||
final World myworld = Bukkit.getWorld(worldname);
|
||||
final ArrayList<Chunk> chunks = new ArrayList<>();
|
||||
for (final ChunkLoc loc : locs) {
|
||||
chunks.add(myworld.getChunkAt(loc.x, loc.z));
|
||||
if (myworld.isChunkLoaded(loc.x, loc.z)) {
|
||||
chunks.add(myworld.getChunkAt(loc.x, loc.z));
|
||||
}
|
||||
}
|
||||
sendChunk(chunks);
|
||||
}
|
||||
|
Reference in New Issue
Block a user