Attempted to place a tile entity error

Discussion in 'Plugin Development' started by Soldado_08, Feb 18, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    Soldado_08

    I'm using my plugin to place schematics and removing them by placing another schematic with but same size but without any blocks.
    Sometimes, when i place them, an error appear in my console:
    Code:
    [14:30:14] [Server thread/INFO]: Attempted to place a tile entity (net.minecraft.server.v1_12_R1.TileEntityDispenser@f1d985e) at 1,68,-81 (AIR) where there was no entity tile!
    [14:30:14] [Server thread/INFO]: Chunk coordinates: 0,-96
    [14:30:14] [Server thread/WARN]: java.lang.Exception
    [14:30:14] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.Chunk.a(Chunk.java:728)
    [14:30:14] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.World.setTileEntity(World.java:1997)
    [14:30:14] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.ItemStack.placeItem(ItemStack.java:226)
    [14:30:14] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.PlayerInteractManager.a(PlayerInteractManager.java:505)
    [14:30:14] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:951)
    [14:30:14] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.PacketPlayInUseItem.a(PacketPlayInUseItem.java:37)
    [14:30:14] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.PacketPlayInUseItem.a(PacketPlayInUseItem.java:1)
    [14:30:14] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13)
    [14:30:14] [Server thread/WARN]:     at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    [14:30:14] [Server thread/WARN]:     at java.util.concurrent.FutureTask.run(Unknown Source)
    [14:30:14] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46)
    [14:30:14] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:748)
    [14:30:14] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406)
    [14:30:14] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679)
    [14:30:14] [Server thread/WARN]:     at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577)
    [14:30:14] [Server thread/WARN]:     at java.lang.Thread.run(Unknown Source)
    And this is the method i'm using to paste them:
    Code:
        public void schematic(Tipo tipo, Location loc, boolean colocar){
            if(!colocar){
                if(tipo.equals(Tipo.x3) || tipo.equals(Tipo.x5)) loc.add(0, -3, 0);
                if(tipo.equals(Tipo.x7) || tipo.equals(Tipo.x9)) loc.add(0, -4, 0);
            }
            WorldEditPlugin worldEditPlugin = (WorldEditPlugin)Bukkit.getPluginManager().getPlugin("WorldEdit");
            String stipo = tipo.toString();
            String nomeschematic = stipo.charAt(stipo.length()-1) + stipo;
            if(!colocar) nomeschematic += "clear";
            File schematic = new File(plugin.getDataFolder() + File.separator + "/schematics/"+nomeschematic+".schematic");
            EditSession session = worldEditPlugin.getWorldEdit().getEditSessionFactory().getEditSession(new BukkitWorld(loc.getWorld()), 10000);
            try{
                CuboidClipboard clipboard = MCEditSchematicFormat.getFormat(schematic).load(schematic);
                clipboard.paste(session, new Vector(loc.getX(), loc.getY() + 1, loc.getZ()), colocar);
            }
            catch (IOException | MaxChangedBlocksException | DataException  e)
            {
                e.printStackTrace();
            }
        }
    This error does not affect my plugin, but i'm afraid that it might be corrupting the world in some way. Is there any way to fix it?
     
Thread Status:
Not open for further replies.

Share This Page