mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Merge remote-tracking branch 'remotes/origin/master'
This commit is contained in:
commit
c2c20ff189
@ -571,7 +571,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||||
public void onChat(AsyncPlayerChatEvent event) {
|
public void onChat(AsyncPlayerChatEvent event) {
|
||||||
PlotPlayer plotPlayer = BukkitUtil.getPlayer(event.getPlayer());
|
PlotPlayer plotPlayer = BukkitUtil.getPlayer(event.getPlayer());
|
||||||
Location location = plotPlayer.getLocation();
|
Location location = plotPlayer.getLocation();
|
||||||
@ -603,14 +603,11 @@ public class PlayerEvents extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String full = format.replaceAll("%plot_id%", id.x + ";" + id.y).replaceAll("%sender%", sender).replaceAll("%msg%", message);
|
String full = format.replace("%plot_id%", id.x + ";" + id.y).replace("%sender%", sender).replace("%msg%", message);
|
||||||
full = ChatColor.translateAlternateColorCodes('&', full);
|
full = ChatColor.translateAlternateColorCodes('&', full);
|
||||||
// format = format.replaceAll("%plot_id%", id.x + ";" + id.y).replaceAll("%sender%", "%s").replaceAll("%msg%", "%s");
|
|
||||||
// format = ChatColor.translateAlternateColorCodes('&', format);
|
|
||||||
for (Player receiver : recipients) {
|
for (Player receiver : recipients) {
|
||||||
receiver.sendMessage(full);
|
receiver.sendMessage(full);
|
||||||
}
|
}
|
||||||
// event.setFormat(format);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
|
@ -15,7 +15,6 @@ import com.intellectualcrafters.plot.util.ReflectionUtils.RefMethod.RefExecutor;
|
|||||||
import com.intellectualcrafters.plot.util.SetQueue;
|
import com.intellectualcrafters.plot.util.SetQueue;
|
||||||
import com.intellectualcrafters.plot.util.SetQueue.ChunkWrapper;
|
import com.intellectualcrafters.plot.util.SetQueue.ChunkWrapper;
|
||||||
import com.intellectualcrafters.plot.util.TaskManager;
|
import com.intellectualcrafters.plot.util.TaskManager;
|
||||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
|
||||||
import com.plotsquared.bukkit.util.SendChunk;
|
import com.plotsquared.bukkit.util.SendChunk;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -261,17 +260,6 @@ public class FastQueue_1_8_3 extends SlowQueue {
|
|||||||
return new FastChunk_1_8_3(wrap);
|
return new FastChunk_1_8_3(wrap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void regenerateChunk(String worldname, ChunkLoc loc) {
|
|
||||||
World world = BukkitUtil.getWorld(worldname);
|
|
||||||
Chunk chunk = world.getChunkAt(loc.x, loc.z);
|
|
||||||
if (chunk.getTileEntities().length > 0) {
|
|
||||||
Object w = this.methodGetHandleWorld.of(world).call();
|
|
||||||
((Collection) this.tileEntityListTick.of(w).get()).clear();
|
|
||||||
}
|
|
||||||
super.regenerateChunk(worldname, loc);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This should be overridden by any specialized queues
|
* This should be overridden by any specialized queues
|
||||||
* @param plotChunk
|
* @param plotChunk
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package com.plotsquared.bukkit.util.block;
|
package com.plotsquared.bukkit.util.block;
|
||||||
|
|
||||||
import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass;
|
|
||||||
|
|
||||||
import com.intellectualcrafters.plot.object.ChunkLoc;
|
import com.intellectualcrafters.plot.object.ChunkLoc;
|
||||||
import com.intellectualcrafters.plot.object.PseudoRandom;
|
import com.intellectualcrafters.plot.object.PseudoRandom;
|
||||||
import com.intellectualcrafters.plot.util.ChunkManager;
|
import com.intellectualcrafters.plot.util.ChunkManager;
|
||||||
@ -15,12 +13,6 @@ import com.intellectualcrafters.plot.util.ReflectionUtils.RefMethod.RefExecutor;
|
|||||||
import com.intellectualcrafters.plot.util.SetQueue.ChunkWrapper;
|
import com.intellectualcrafters.plot.util.SetQueue.ChunkWrapper;
|
||||||
import com.intellectualcrafters.plot.util.TaskManager;
|
import com.intellectualcrafters.plot.util.TaskManager;
|
||||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||||
import org.bukkit.Chunk;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.World.Environment;
|
|
||||||
import org.bukkit.block.Biome;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
@ -30,6 +22,14 @@ import java.util.HashMap;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import org.bukkit.Chunk;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.World.Environment;
|
||||||
|
import org.bukkit.block.Biome;
|
||||||
|
|
||||||
|
|
||||||
|
import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass;
|
||||||
|
|
||||||
public class FastQueue_1_9 extends SlowQueue {
|
public class FastQueue_1_9 extends SlowQueue {
|
||||||
|
|
||||||
@ -80,18 +80,6 @@ public class FastQueue_1_9 extends SlowQueue {
|
|||||||
MainUtil.initCache();
|
MainUtil.initCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void regenerateChunk(String worldname, ChunkLoc loc) {
|
|
||||||
World world = BukkitUtil.getWorld(worldname);
|
|
||||||
Chunk chunk = world.getChunkAt(loc.x, loc.z);
|
|
||||||
if (chunk.getTileEntities().length > 0) {
|
|
||||||
Object c = this.methodGetHandleChunk.of(chunk).call();
|
|
||||||
Object w = this.methodGetWorld.of(c).call();
|
|
||||||
((Collection) this.tileEntityListTick.of(w).get()).clear();
|
|
||||||
}
|
|
||||||
super.regenerateChunk(worldname, loc);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This should be overridden by any specialized queues
|
* This should be overridden by any specialized queues
|
||||||
* @param plotChunk
|
* @param plotChunk
|
||||||
|
@ -171,10 +171,16 @@ public class PS {
|
|||||||
if (Settings.KILL_ROAD_MOBS || Settings.KILL_ROAD_VEHICLES) {
|
if (Settings.KILL_ROAD_MOBS || Settings.KILL_ROAD_VEHICLES) {
|
||||||
this.IMP.runEntityTask();
|
this.IMP.runEntityTask();
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
if (this.IMP.initWorldEdit()) {
|
if (this.IMP.initWorldEdit()) {
|
||||||
this.worldedit = WorldEdit.getInstance();
|
this.worldedit = WorldEdit.getInstance();
|
||||||
WorldEdit.getInstance().getEventBus().register(new WESubscriber());
|
WorldEdit.getInstance().getEventBus().register(new WESubscriber());
|
||||||
new WE_Anywhere();
|
new WE_Anywhere();
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
PS.debug("Incompatible version of WorldEdit, please upgrade: http://builds.enginehub.org/job/worldedit?branch=master");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
|
@ -134,7 +134,7 @@ public class MainCommand extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public void run(final Command cmd, final Runnable success, final Runnable failure) {
|
public void run(final Command cmd, final Runnable success, final Runnable failure) {
|
||||||
if (cmd.hasConfirmation(player) ) {
|
if (cmd.hasConfirmation(player) ) {
|
||||||
CmdConfirm.addPending(player, "/plot area create pos2 (Creates world)", new Runnable() {
|
CmdConfirm.addPending(player, cmd.getUsage(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (EconHandler.manager != null) {
|
if (EconHandler.manager != null) {
|
||||||
|
@ -290,7 +290,6 @@ public enum C {
|
|||||||
TASK_START("Starting task...", "Core"),
|
TASK_START("Starting task...", "Core"),
|
||||||
PREFIX("$3[$1P2$3] $2", "Core"),
|
PREFIX("$3[$1P2$3] $2", "Core"),
|
||||||
ENABLED("$1PlotSquared is now enabled", "Core"),
|
ENABLED("$1PlotSquared is now enabled", "Core"),
|
||||||
EXAMPLE_MESSAGE("$2This is an example message &k!!!", "Core"),
|
|
||||||
/*
|
/*
|
||||||
* Reload
|
* Reload
|
||||||
*/
|
*/
|
||||||
|
@ -1635,7 +1635,7 @@ public class Plot {
|
|||||||
public boolean removeDenied(UUID uuid) {
|
public boolean removeDenied(UUID uuid) {
|
||||||
if (uuid == DBFunc.everyone) {
|
if (uuid == DBFunc.everyone) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
for (UUID other : getDenied()) {
|
for (UUID other : new HashSet<>(getDenied())) {
|
||||||
result = result || rmvDenied(other);
|
result = result || rmvDenied(other);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -1662,7 +1662,7 @@ public class Plot {
|
|||||||
public boolean removeTrusted(UUID uuid) {
|
public boolean removeTrusted(UUID uuid) {
|
||||||
if (uuid == DBFunc.everyone) {
|
if (uuid == DBFunc.everyone) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
for (UUID other : getTrusted()) {
|
for (UUID other : new HashSet<>(getTrusted())) {
|
||||||
result = result || rmvTrusted(other);
|
result = result || rmvTrusted(other);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -721,7 +721,7 @@ public class MainUtil {
|
|||||||
expires = String.format("%d days", TimeUnit.MILLISECONDS.toDays(l));
|
expires = String.format("%d days", TimeUnit.MILLISECONDS.toDays(l));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else if (ExpireManager.IMP != null) {
|
||||||
long timestamp = ExpireManager.IMP.getTimestamp(plot.owner);
|
long timestamp = ExpireManager.IMP.getTimestamp(plot.owner);
|
||||||
long compared = System.currentTimeMillis() - timestamp;
|
long compared = System.currentTimeMillis() - timestamp;
|
||||||
long l = Settings.AUTO_CLEAR_DAYS - TimeUnit.MILLISECONDS.toDays(compared);
|
long l = Settings.AUTO_CLEAR_DAYS - TimeUnit.MILLISECONDS.toDays(compared);
|
||||||
|
Loading…
Reference in New Issue
Block a user