Packet132TileEntityData isn't working as it should...

Discussion in 'Plugin Development' started by xGhOsTkiLLeRx, Nov 18, 2012.

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

    xGhOsTkiLLeRx

    Hey guys,

    I'm having issues with updating a mob spawner.
    (Mob inside the spawner - only updated on login!?!)
    Normally a call from BlockState should work.
    But if I use the update (or even update(true);) method, nothing changes. So I went deeper and wanted to send a packet directly.

    It's called Packet132.
    I looked into the classes
    (see
    http://www.wiki.vg/Protocol#Update_Tile_Entity_.280x84.29
    https://github.com/Bukkit/mc-dev/blob/master/net/minecraft/server/Packet132TileEntityData.java
    https://github.com/Bukkit/CraftBukk...necraft/server/TileEntityMobSpawner.java#L165
    )

    I tried to achieve a paket update with reflection, my code runs just fine.
    I tried to call the update method on the spawner, not working

    I even tried to get the spawner with another way, calling update method on it - not working.

    My 3 code variants
    PHP:
    // Block is a valid mob spawner, player is valid, too
    Field tileField CraftCreatureSpawner.class.getDeclaredField("spawner");
    Packet132TileEntityData packet;
    BlockState blockState block.getState();
    CraftCreatureSpawner spawner = ((CraftCreatureSpawnerblockState);
    net.minecraft.server.TileEntityMobSpawner tile = (net.minecraft.server.TileEntityMobSpawnertileField.get(spawner);
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    tile.b(nbttagcompound);
    packet = new Packet132TileEntityData(block.getX(), block.getY(), block.getZ(), 1nbttagcompound);
    player.sendMessage("Packet is coming!");
    CraftPlayer cp = (CraftPlayerplayer;
    cp.getHandle().netServerHandler.sendPacket(packet);
    player.sendMessage("Packet received!");
     
    // Same with
    tile.getUpdatePacket();
     
    // Not working, too
    CraftWorld world = (CraftWorldblock.getWorld();
    TileEntityMobSpawner spawner3 = (TileEntityMobSpawnerworld.getTileEntityAt(block.getX(), block.getY(), block.getZ());
    spawner3.getUpdatePacket();
    Any other ideas or a MINECRAFT and not bukkit bug?
    Only re-login works...

    Thanks in advance :)
     
Thread Status:
Not open for further replies.

Share This Page