Fix setblock npe 1.8

This commit is contained in:
Jesse Boyd 2018-04-11 23:40:58 +10:00
parent 0c7be7e11d
commit c5b332246e
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -1,5 +1,7 @@
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.ChunkWrapper; import com.intellectualcrafters.plot.object.ChunkWrapper;
import com.intellectualcrafters.plot.object.PlotBlock; import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
@ -17,9 +19,6 @@ import org.bukkit.Chunk;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass;
public class BukkitLocalQueue_1_8 extends BukkitLocalQueue<PlotBlock[]> { public class BukkitLocalQueue_1_8 extends BukkitLocalQueue<PlotBlock[]> {
private final ReflectionUtils.RefMethod methodInitLighting; private final ReflectionUtils.RefMethod methodInitLighting;
@ -96,6 +95,8 @@ public class BukkitLocalQueue_1_8 extends BukkitLocalQueue<PlotBlock[]> {
int y = MainUtil.y_loc[i][j]; int y = MainUtil.y_loc[i][j];
int z = MainUtil.z_loc[i][j]; int z = MainUtil.z_loc[i][j];
PlotBlock newBlock = result2[j]; PlotBlock newBlock = result2[j];
if (newBlock == null) continue;
if (newBlock.id == -1) { if (newBlock.id == -1) {
chunk.getBlock(x, y, z).setData(newBlock.data, false); chunk.getBlock(x, y, z).setData(newBlock.data, false);
continue; continue;