Package net.minecraft.server.v1_7_R4

Examples of net.minecraft.server.v1_7_R4.Block


        hasHealthBar.put(player.getName(), true);
    }

    public static void removeTextBar(Player player) {
        if (hasHealthBar.containsKey(player.getName())) {
            PacketPlayOutEntityDestroy destroyEntityPacket = getDestroyEntityPacket();
            PacketHelper.sendPacket(player, destroyEntityPacket);
            hasHealthBar.put(player.getName(), false);
        }
    }
View Full Code Here


                        health -= healthAdd;
                    }
                } else {
                    DataWatcher watcher = getWatcher(text, (loadUp ? 300 : 0));
                    PacketPlayOutEntityMetadata metaPacket = getMetadataPacket(watcher);
                    PacketPlayOutEntityDestroy destroyEntityPacket = getDestroyEntityPacket();
                    PacketHelper.sendPacket(player, metaPacket);
                    PacketHelper.sendPacket(player, destroyEntityPacket);
                    hasHealthBar.put(player.getName(), false);
//Complete text
                    PacketPlayOutSpawnEntityLiving mobPacket = getMobPacket(completeText, player.getLocation(), 200);
                    PacketHelper.sendPacket(player, mobPacket);
                    hasHealthBar.put(player.getName(), true);
                    DataWatcher watcher2 = getWatcher(completeText, 300);
                    PacketPlayOutEntityMetadata metaPacket2 = getMetadataPacket(watcher2);
                    PacketHelper.sendPacket(player, metaPacket2);
                    new BukkitRunnable() {
                        @Override
                        public void run() {
                            PacketPlayOutEntityDestroy destroyEntityPacket = getDestroyEntityPacket();
                            PacketHelper.sendPacket(player, destroyEntityPacket);
                            hasHealthBar.put(player.getName(), false);
                        }
                    }.runTaskLater(DenizenAPI.getCurrentInstance(), 40L);
                    this.cancel();
View Full Code Here

        equipment_slot = fields.get("b");
        equipment_itemstack = fields.get("c");
    }

    public static PacketPlayOutEntityEquipment getEquipmentPacket(LivingEntity entity, int slot, ItemStack item) {
        PacketPlayOutEntityEquipment equipmentPacket = new PacketPlayOutEntityEquipment();
        try {
            equipment_entityId.set(equipmentPacket, entity.getEntityId());
            equipment_slot.set(equipmentPacket, slot);
            equipment_itemstack.set(equipmentPacket, CraftItemStack.asNMSCopy(item));
        } catch (Exception e) {
View Full Code Here

        int slotNumber = entity.equals(player) ? slot.getSlot()-1 : slot.getSlot();
        if (slotNumber == -1) {
            dB.echoError("Cannot force a player to see themselves holding a different item.");
            return;
        }
        PacketPlayOutEntityEquipment equipmentPacket = getEquipmentPacket(entity, slotNumber, item);
        PacketHelper.sendPacket(player, equipmentPacket);
    }
View Full Code Here

        }
        return destroyPacket;
    }

    public static PacketPlayOutEntityMetadata getMetadataPacket(DataWatcher watcher) {
        PacketPlayOutEntityMetadata metaPacket = new PacketPlayOutEntityMetadata();
        try {
            metadata_entityId.set(metaPacket, ENTITY_ID);
            metadata_data.set(metaPacket, watcher.c());
        } catch (Exception e) {
            dB.echoError(e);
View Full Code Here

            @Override
            public void run() {
                if ((loadUp ? health < 300 : health > 0)) {
                    DataWatcher watcher = getWatcher(text, health);
                    PacketPlayOutEntityMetadata metaPacket = getMetadataPacket(watcher);
                    PacketHelper.sendPacket(player, metaPacket);
                    if (loadUp) {
                        health += healthAdd;
                    } else {
                        health -= healthAdd;
                    }
                } else {
                    DataWatcher watcher = getWatcher(text, (loadUp ? 300 : 0));
                    PacketPlayOutEntityMetadata metaPacket = getMetadataPacket(watcher);
                    PacketPlayOutEntityDestroy destroyEntityPacket = getDestroyEntityPacket();
                    PacketHelper.sendPacket(player, metaPacket);
                    PacketHelper.sendPacket(player, destroyEntityPacket);
                    hasHealthBar.put(player.getName(), false);
//Complete text
                    PacketPlayOutSpawnEntityLiving mobPacket = getMobPacket(completeText, player.getLocation(), 200);
                    PacketHelper.sendPacket(player, mobPacket);
                    hasHealthBar.put(player.getName(), true);
                    DataWatcher watcher2 = getWatcher(completeText, 300);
                    PacketPlayOutEntityMetadata metaPacket2 = getMetadataPacket(watcher2);
                    PacketHelper.sendPacket(player, metaPacket2);
                    new BukkitRunnable() {
                        @Override
                        public void run() {
                            PacketPlayOutEntityDestroy destroyEntityPacket = getDestroyEntityPacket();
View Full Code Here

        health_food = fields.get("b");
        health_saturation = fields.get("c");
    }

    public static PacketPlayOutExperience getExperiencePacket(float exp, int level) {
        PacketPlayOutExperience experiencePacket = new PacketPlayOutExperience();
        try {
            xp_current.set(experiencePacket, exp);
            // xp_total.set(experiencePacket, totalExp);
            xp_level.set(experiencePacket, level);
        } catch (Exception e) {
View Full Code Here

        PacketPlayOutUpdateHealth healthPacket = getHealthPacket(health, food, food_saturation);
        PacketHelper.sendPacket(player, healthPacket);
    }

    public static void showExperience(Player player, float experience, int level) {
        PacketPlayOutExperience experiencePacket = getExperiencePacket(experience, level);
        PacketHelper.sendPacket(player, experiencePacket);
    }
View Full Code Here

        PacketPlayOutExperience experiencePacket = getExperiencePacket(experience, level);
        PacketHelper.sendPacket(player, experiencePacket);
    }

    public static void resetExperience(Player player) {
        PacketPlayOutExperience experiencePacket = getExperiencePacket(player.getExp(), player.getLevel());
        PacketHelper.sendPacket(player, experiencePacket);
    }
View Full Code Here

    }

    @Override
    public void handlePacket(Object packet, Player destination) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
        if (packet instanceof PacketPlayOutNamedEntitySpawn) {
            final PacketPlayOutNamedEntitySpawn p = (PacketPlayOutNamedEntitySpawn) packet;
            final GameProfile profile = (GameProfile) this.gameProfileField.get(p);
            final String oldName = profile.getName();
            final UUID oldID = profile.getId();
            final TagInfo newName = this.handler.getNameForPacket20(oldID, this.entityIDField.getInt(p), oldName, destination);
            if (newName != null && !newName.getName().equals(oldName)) {
View Full Code Here

TOP

Related Classes of net.minecraft.server.v1_7_R4.Block

Copyright © 2018 www.massapicom. 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.