From 008237b2a45871a48917f9b839817034ac3ff95c Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Sat, 17 Aug 2019 18:40:39 -0400 Subject: [PATCH] Fixed #2469 --- .../plotsquared/bukkit/BukkitMain.java | 19 ++++++++++--------- .../plotsquared/bukkit/util/SendChunk.java | 4 +--- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java index 64d156130..0bba5cc09 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java @@ -54,8 +54,8 @@ import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; import org.jetbrains.annotations.NotNull; - import org.jetbrains.annotations.Nullable; + import java.io.File; import java.lang.reflect.Method; import java.util.ArrayList; @@ -598,14 +598,15 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain } @Override public QueueProvider initBlockQueue() { - try { - new SendChunk(); - MainUtil.canSendChunk = true; - } catch (ClassNotFoundException | NoSuchFieldException | NoSuchMethodException e) { - PlotSquared.debug( - SendChunk.class + " does not support " + StringMan.getString(getServerVersion())); - MainUtil.canSendChunk = false; - } + //TODO Figure out why this code is still here yet isn't being called anywhere. + // try { + // new SendChunk(); + // MainUtil.canSendChunk = true; + // } catch (ClassNotFoundException | NoSuchFieldException | NoSuchMethodException e) { + // PlotSquared.debug( + // SendChunk.class + " does not support " + StringMan.getString(getServerVersion())); + // MainUtil.canSendChunk = false; + // } return QueueProvider.of(BukkitLocalQueue.class, BukkitLocalQueue.class); } diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java index 6ed7317b6..cb525199c 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/SendChunk.java @@ -42,7 +42,6 @@ public class SendChunk { * Constructor. */ public SendChunk() throws ClassNotFoundException, NoSuchMethodException, NoSuchFieldException { - RefConstructor tempMapChunk; RefClass classCraftPlayer = getRefClass("{cb}.entity.CraftPlayer"); this.methodGetHandlePlayer = classCraftPlayer.getMethod("getHandle"); RefClass classCraftChunk = getRefClass("{cb}.CraftChunk"); @@ -50,8 +49,7 @@ public class SendChunk { RefClass classChunk = getRefClass("{nms}.Chunk"); this.methodInitLighting = classChunk.getMethod("initLighting"); RefClass classMapChunk = getRefClass("{nms}.PacketPlayOutMapChunk"); - tempMapChunk = classMapChunk.getConstructor(classChunk.getRealClass(), int.class); - this.mapChunk = tempMapChunk; + this.mapChunk = classMapChunk.getConstructor(classChunk.getRealClass(), int.class); RefClass classEntityPlayer = getRefClass("{nms}.EntityPlayer"); this.connection = classEntityPlayer.getField("playerConnection"); RefClass classPacket = getRefClass("{nms}.Packet");