Wierd error... Can anyone point me in the right direction.

Discussion in 'Spigot Plugin Development' started by Jonnyo101, Jun 27, 2019.

  1. Hello i seem to be getting this error on my server.

    Code (YAML):
    [15:27:13 ERROR]:              it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap.get(Long2ObjectOpenHashMap.java:454)
    [15:27:13 ERROR]
    :              net.minecraft.server.v1_12_R1.PlayerChunkMap.getChunk(PlayerChunkMap.java:230)
    [15:27:13 ERROR]
    :              net.minecraft.server.v1_12_R1.PlayerChunkMap.flagDirty(PlayerChunkMap.java:266)
    [15:27:13 ERROR]
    :              net.minecraft.server.v1_12_R1.WorldManager.a(WorldManager.java:45)
    [15:27:13 ERROR]
    :              net.minecraft.server.v1_12_R1.World.notify(World.java:495)
    [15:27:13 ERROR]
    :              net.minecraft.server.v1_12_R1.World.notifyAndUpdatePhysics(World.java:455)
    [15:27:13 ERROR]
    :              net.minecraft.server.v1_12_R1.World.setTypeAndData(World.java:443)
    [15:27:13 ERROR]
    :              org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.setData(CraftBlock.java:105)
    [15:27:13 ERROR]
    :              org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.setData(CraftBlock.java:90)
    [COLOR=#0080ff][15:27:13 ERROR]:               RealmManager.RealmWorldBlockPopulator.populate(RealmWorldBlockPopulator.java:26)[/COLOR]
    [15:27:13 ERROR]
    :              net.minecraft.server.v1_12_R1.Chunk.a(Chunk.java:1179)
    [15:27:13 ERROR]
    :              net.minecraft.server.v1_12_R1.Chunk.loadNearby(Chunk.java:1152)
    Code (Java):
    public void populate(World world, Random rand, Chunk chunk) {
            final int chunkX = chunk.getX();
            final int chunkZ = chunk.getZ();

            for (int x = 0; x < 16; x++) {
                for (int z = 0; z < 16; z++) {
                    for (int y = 30; y < 256; y++) {
                        final int blockX = chunkX * 16 + x;
                        final int blockZ = chunkZ * 16 + z;

                        final Block block = world.getBlockAt(blockX, y, blockZ);
                        if (block.getType() == Material.STAINED_GLASS) {
                            block.setData((byte) 7);  [B][COLOR=#0080ff]LINE 26[/COLOR][/B]
                        }
                    }
                }
            }
        }
    Also would this lag the server what i am doing ?
     
  2. is that the full error stacktrace? no "caused by:"?
     
  3. My assumption is that block == null so doing .setData is throwing the error. Without a full trace and code I couldn't tell you for sure.