mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-09-15 01:05:34 +02:00
@@ -41,7 +41,6 @@ public class AugmentedPopulator extends BlockPopulator {
|
||||
|
||||
public AugmentedPopulator(final String world, final BukkitPlotGenerator generator, final PlotCluster cluster, final boolean p, final boolean b) {
|
||||
MainUtil.initCache();
|
||||
PS.log("== NEW AUGMENTED POPULATOR FOR: " + world);
|
||||
this.cluster = cluster;
|
||||
this.generator = generator;
|
||||
plotworld = PS.get().getPlotWorld(world);
|
||||
|
@@ -5,6 +5,7 @@ import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
@@ -140,7 +141,8 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
|
||||
public void run() {
|
||||
final String world = bloc.getWorld().getName();
|
||||
final int x = bloc.getBlockX();
|
||||
final int z = bloc.getBlockZ();
|
||||
final int z = bloc.getBlockZ();
|
||||
final int distance = Bukkit.getViewDistance() * 16;
|
||||
for (Entry<String, PlotPlayer> entry : UUIDHandler.getPlayers().entrySet()) {
|
||||
PlotPlayer player = entry.getValue();
|
||||
final Location loc = player.getLocation();
|
||||
@@ -223,8 +225,8 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Settings.REDSTONE_DISABLER_UNOCCUPIED) {
|
||||
}
|
||||
if (Settings.REDSTONE_DISABLER_UNOCCUPIED) {
|
||||
for (Entry<String, PlotPlayer> entry : UUIDHandler.getPlayers().entrySet()) {
|
||||
if (plot.equals(entry.getValue().getCurrentPlot())) {
|
||||
return;
|
||||
|
@@ -6,6 +6,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
@@ -34,7 +35,33 @@ public class BukkitCommand implements CommandExecutor, TabCompleter {
|
||||
public boolean onCommand(final CommandSender commandSender, final org.bukkit.command.Command command, final String commandLabel, final String[] args) {
|
||||
if (commandSender instanceof Player) {
|
||||
return MainCommand.onCommand(BukkitUtil.getPlayer((Player) commandSender), commandLabel, args);
|
||||
}
|
||||
}
|
||||
if (commandSender == null || commandSender.getClass() == Bukkit.getConsoleSender().getClass()) {
|
||||
return MainCommand.onCommand(ConsolePlayer.getConsole(), commandLabel, args);
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
ConsolePlayer sender = new ConsolePlayer() {
|
||||
@Override
|
||||
public void sendMessage(String message) {
|
||||
commandSender.sendMessage(commandLabel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(String perm) {
|
||||
return commandSender.hasPermission(commandLabel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
if (commandSender.getName().equals("CONSOLE")) {
|
||||
return "*";
|
||||
}
|
||||
return commandSender.getName();
|
||||
}
|
||||
};
|
||||
sender.teleport(ConsolePlayer.getConsole().getLocationFull());
|
||||
boolean result = MainCommand.onCommand(sender, commandLabel, args);
|
||||
ConsolePlayer.getConsole().teleport(sender.getLocationFull());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -125,7 +125,7 @@ public class BukkitUtil extends BlockManager {
|
||||
return lastPlotPlayer;
|
||||
}
|
||||
final String name = player.getName();
|
||||
final PlotPlayer pp = UUIDHandler.getPlayers().get(name);
|
||||
final PlotPlayer pp = UUIDHandler.getPlayer(name);
|
||||
if (pp != null) {
|
||||
return pp;
|
||||
}
|
||||
|
@@ -7,6 +7,7 @@ import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
@@ -76,7 +77,8 @@ public class SendChunk {
|
||||
list.add(chunk);
|
||||
final Object c = methodGetHandleChunk.of(chunk).call();
|
||||
methodInitLighting.of(c).call();
|
||||
}
|
||||
}
|
||||
for (Entry<String, PlotPlayer> entry : UUIDHandler.getPlayers().entrySet()) {
|
||||
PlotPlayer pp = entry.getValue();
|
||||
final Plot plot = pp.getCurrentPlot();
|
||||
Location loc = null;
|
||||
|
@@ -3,6 +3,7 @@ package com.plotsquared.sponge.listener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
@@ -408,7 +409,8 @@ public class MainListener {
|
||||
final String newMessage = StringMan.replaceAll(C.PLOT_CHAT_FORMAT.s(), "%plot_id%", id.x + ";" + id.y, "%sender%", sender);
|
||||
final Text forcedMessage = event.getMessage();
|
||||
// String forcedMessage = StringMan.replaceAll(C.PLOT_CHAT_FORCED.s(), "%plot_id%", id.x + ";" + id.y, "%sender%", sender);
|
||||
for (final PlotPlayer user : UUIDHandler.getPlayers().values()) {
|
||||
for (Entry<String, PlotPlayer> entry : UUIDHandler.getPlayers().entrySet()) {
|
||||
PlotPlayer user = entry.getValue();
|
||||
String toSend;
|
||||
if (plot.equals(MainUtil.getPlot(user.getLocation()))) {
|
||||
toSend = newMessage;
|
||||
|
@@ -46,7 +46,7 @@ public class SpongeUtil {
|
||||
return lastPlotPlayer;
|
||||
}
|
||||
final String name = player.getName();
|
||||
final PlotPlayer pp = UUIDHandler.getPlayers().get(name);
|
||||
final PlotPlayer pp = UUIDHandler.getPlayer(name);
|
||||
if (pp != null) {
|
||||
return pp;
|
||||
}
|
||||
|
Reference in New Issue
Block a user