Migrating NBT-tag code from 1.5.2 to 1.7.10

Discussion in 'Plugin Development' started by bars96, Jun 5, 2015.

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

    bars96

    I must update one plugin, but I get errors with NBT NMS code [SOURCE]
    Code:
    // Lines 193-198:
    /* The method getName() is undefined for the type NBTBase
       The field NBTTagInt.data is not visible */
                for (NBTBase v: (Collection<NBTBase>) cTag.c()) {
                    if (v instanceof NBTTagInt) {
                        NBTTagInt intTag = (NBTTagInt) v;
                        if (v.getName().equals("x")) {
                            x = intTag.data;
                        } else if (v.getName().equals("y")) {
                            y = intTag.data;
                        } else if(v.getName().equals("z")) {
                            z = intTag.data;
                        }
                    }
                }
    // Line 175: The method getList(String, int) in the type NBTTagCompound is not applicable for the arguments (String)
    NBTTagList tileEntities = tag.getList("TileEntities");
    // Line 137: The method a(InputStream) in the type NBTCompressedStreamTools is not applicable for the arguments (byte[])
    NBTTagCompound tag = NBTCompressedStreamTools.a(input);
    // Line 298: The constructor NBTTagList(String) is undefined
    tag.set("Entities", new NBTTagList("Entities"));
    // Line 304: The method setName(String) is undefined for the type NBTTagCompound
    tag.setName("Schematic");
    // Line 478: The constructor NBTTagCompound(String) is undefined
    NBTTagCompound tag = new NBTTagCompound(MaterialID.getTileEntityId(block.getTypeId()));
    // Line 618: The method setName(String) is undefined for the type NBTTagCompound
    btag.setName(MaterialID.getTileEntityId(block.getType()));
    Maybe it help:
    https://github.com/Bukkit/mc-dev/blob/master/net/minecraft/server/NBTTagCompound.java


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 12, 2016
Thread Status:
Not open for further replies.

Share This Page