mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
Various
Fix compatibility with bukkit 1.5 Recover on failed fancy message initialization Fix /2 remove *
This commit is contained in:
parent
047f9a75b9
commit
817a5bc16e
@ -52,7 +52,7 @@ import com.plotsquared.bukkit.util.BukkitEconHandler;
|
||||
import com.plotsquared.bukkit.util.BukkitEventUtil;
|
||||
import com.plotsquared.bukkit.util.BukkitHybridUtils;
|
||||
import com.plotsquared.bukkit.util.BukkitInventoryUtil;
|
||||
import com.plotsquared.bukkit.util.BukkitPlainChatManager;
|
||||
import com.intellectualcrafters.plot.object.chat.PlainChatManager;
|
||||
import com.plotsquared.bukkit.util.BukkitSchematicHandler;
|
||||
import com.plotsquared.bukkit.util.BukkitSetupUtils;
|
||||
import com.plotsquared.bukkit.util.BukkitTaskManager;
|
||||
@ -428,7 +428,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
new SendChunk();
|
||||
MainUtil.canSendChunk = true;
|
||||
} catch (ClassNotFoundException | NoSuchFieldException | NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
PS.debug(SendChunk.class + " does not support " + StringMan.getString(getServerVersion()));
|
||||
MainUtil.canSendChunk = false;
|
||||
}
|
||||
if (PS.get().checkVersion(getServerVersion(), 1, 9, 0)) {
|
||||
@ -653,7 +653,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
if (Settings.Chat.INTERACTIVE) {
|
||||
return new BukkitChatManager();
|
||||
} else {
|
||||
return new BukkitPlainChatManager();
|
||||
return new PlainChatManager();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,9 +64,8 @@ public final class Reflection {
|
||||
try {
|
||||
clazz = Class.forName(fullName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
_loadedNMSClasses.put(className, null);
|
||||
return null;
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
_loadedNMSClasses.put(className, clazz);
|
||||
return clazz;
|
||||
@ -89,9 +88,8 @@ public final class Reflection {
|
||||
try {
|
||||
clazz = Class.forName(fullName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
_loadedOBCClasses.put(className, null);
|
||||
return null;
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
_loadedOBCClasses.put(className, clazz);
|
||||
return clazz;
|
||||
@ -110,8 +108,7 @@ public final class Reflection {
|
||||
try {
|
||||
return getMethod(obj.getClass(), "getHandle").invoke(obj);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,6 @@ public class DefaultTitleManager_183 extends DefaultTitleManager {
|
||||
this.chatBaseComponent = Reflection.getNMSClass("IChatBaseComponent");
|
||||
this.packetActions = Reflection.getNMSClass("PacketPlayOutTitle$EnumTitleAction");
|
||||
this.nmsChatSerializer = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -85,7 +85,7 @@ public class BukkitLocalQueue<T> extends BasicLocalBlockQueue<T> {
|
||||
if (block != null) {
|
||||
int x = MainUtil.x_loc[layer][j];
|
||||
int y = MainUtil.y_loc[layer][j];
|
||||
int z = MainUtil.y_loc[layer][j];
|
||||
int z = MainUtil.z_loc[layer][j];
|
||||
Block existing = chunk.getBlock(x, y, z);
|
||||
int existingId = existing.getTypeId();
|
||||
if (existingId == block.id) {
|
||||
|
@ -54,7 +54,7 @@ public class Kick extends SubCommand {
|
||||
}
|
||||
players.add(pp);
|
||||
}
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
PlotPlayer pp = UUIDHandler.getPlayer(uuid);
|
||||
if (pp != null) {
|
||||
@ -67,8 +67,7 @@ public class Kick extends SubCommand {
|
||||
return false;
|
||||
}
|
||||
for (PlotPlayer player2 : players) {
|
||||
Location location2 = player2.getLocation();
|
||||
if (!player2.getLocation().getWorld().equals(location2.getWorld()) || !plot.equals(location2.getPlot())) {
|
||||
if (!plot.equals(player2.getCurrentPlot())) {
|
||||
MainUtil.sendMessage(player, C.INVALID_PLAYER, args[0]);
|
||||
return false;
|
||||
}
|
||||
|
@ -1650,7 +1650,7 @@ public class Plot {
|
||||
if (uuid == DBFunc.everyone) {
|
||||
boolean result = false;
|
||||
for (UUID other : new HashSet<>(getDenied())) {
|
||||
result = result || rmvDenied(other);
|
||||
result = rmvDenied(other) || result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -1677,7 +1677,7 @@ public class Plot {
|
||||
if (uuid == DBFunc.everyone) {
|
||||
boolean result = false;
|
||||
for (UUID other : new HashSet<>(getTrusted())) {
|
||||
result = result || rmvTrusted(other);
|
||||
result = rmvTrusted(other) || result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -1707,7 +1707,7 @@ public class Plot {
|
||||
if (uuid == DBFunc.everyone) {
|
||||
boolean result = false;
|
||||
for (UUID other : new HashSet<>(this.members)) {
|
||||
result = result || rmvMember(other);
|
||||
result = rmvMember(other) || result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.intellectualcrafters.plot.object;
|
||||
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.object.chat.PlainChatManager;
|
||||
import com.intellectualcrafters.plot.util.ChatManager;
|
||||
|
||||
public class PlotMessage {
|
||||
@ -8,7 +10,13 @@ public class PlotMessage {
|
||||
private Object builder;
|
||||
|
||||
public PlotMessage() {
|
||||
try {
|
||||
reset(ChatManager.manager);
|
||||
} catch (Throwable e) {
|
||||
PS.debug("PlotSquared doesn't support fancy chat for " + PS.get().IMP.getServerVersion());
|
||||
ChatManager.manager = new PlainChatManager();
|
||||
reset(ChatManager.manager);
|
||||
}
|
||||
}
|
||||
|
||||
public PlotMessage(String text) {
|
||||
|
@ -1,14 +1,14 @@
|
||||
package com.plotsquared.bukkit.util;
|
||||
package com.intellectualcrafters.plot.object.chat;
|
||||
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.object.PlotMessage;
|
||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
import com.intellectualcrafters.plot.util.ChatManager;
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BukkitPlainChatManager extends ChatManager<List<StringBuilder>> {
|
||||
public class PlainChatManager extends ChatManager<List<StringBuilder>> {
|
||||
|
||||
@Override
|
||||
public List<StringBuilder> builder() {
|
||||
@ -29,7 +29,7 @@ public class BukkitPlainChatManager extends ChatManager<List<StringBuilder>> {
|
||||
|
||||
@Override
|
||||
public void text(PlotMessage message, String text) {
|
||||
message.$(this).add(new StringBuilder(ChatColor.stripColor(text)));
|
||||
message.$(this).add(new StringBuilder(C.color(text)));
|
||||
}
|
||||
|
||||
@Override
|
Loading…
Reference in New Issue
Block a user