Examples of PacketPlayOutBlockAction


Examples of net.minecraft.server.v1_7_R4.PacketPlayOutBlockAction

        switch (ChestAction.valueOf(action.asString().toUpperCase())) {
            case OPEN:
                for (dPlayer player: players) {
                    if (sound.asBoolean()) player.getPlayerEntity().playSound(location, Sound.CHEST_OPEN, 1, 1);
                    ((CraftPlayer)player.getPlayerEntity()).getHandle().playerConnection.sendPacket(
                            new PacketPlayOutBlockAction(location.getBlockX(), location.getBlockY(), location.getBlockZ(),
                            ((CraftWorld) location.getWorld()).getHandle().getType(location.getBlockX(), location.getBlockY(), location.getBlockZ()), 1, 1));
                }
                break;

            case CLOSE:
                for (dPlayer player: players) {
                    if (sound.asBoolean()) player.getPlayerEntity().getWorld().playSound(location, Sound.CHEST_CLOSE, 1, 1);
                    ((CraftPlayer)player.getPlayerEntity()).getHandle().playerConnection.sendPacket(
                            new PacketPlayOutBlockAction(location.getBlockX(), location.getBlockY(), location.getBlockZ(),
                            ((CraftWorld)location.getWorld()).getHandle().getType(location.getBlockX(), location.getBlockY(), location.getBlockZ()), 1, 0));
                }
                break;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.