mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Various
Fix compatibility with bukkit 1.5 Recover on failed fancy message initialization Fix /2 remove *
This commit is contained in:
@ -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
|
||||
|
@ -1,47 +0,0 @@
|
||||
package com.plotsquared.bukkit.util;
|
||||
|
||||
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>> {
|
||||
|
||||
@Override
|
||||
public List<StringBuilder> builder() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void color(PlotMessage message, String color) {
|
||||
List<StringBuilder> parts = message.$(this);
|
||||
parts.get(parts.size() - 1).insert(0, color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tooltip(PlotMessage message, PlotMessage... tooltips) {}
|
||||
|
||||
@Override
|
||||
public void command(PlotMessage message, String command) {}
|
||||
|
||||
@Override
|
||||
public void text(PlotMessage message, String text) {
|
||||
message.$(this).add(new StringBuilder(ChatColor.stripColor(text)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void send(PlotMessage plotMessage, PlotPlayer player) {
|
||||
StringBuilder built = new StringBuilder();
|
||||
for (StringBuilder sb : plotMessage.$(this)) {
|
||||
built.append(sb);
|
||||
}
|
||||
player.sendMessage(built.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void suggest(PlotMessage plotMessage, String command) {}
|
||||
|
||||
}
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user