Package net.minecraft.server.v1_7_R4

Examples of net.minecraft.server.v1_7_R4.EntityLiving


        return watcher;
    }

    //Other methods
    public static void displayTextBar(String text, final Player player, int health) {
        PacketPlayOutSpawnEntityLiving mobPacket = getMobPacket(text, player.getLocation(), health);
        PacketHelper.sendPacket(player, mobPacket);
        hasHealthBar.put(player.getName(), true);
    }
View Full Code Here


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

    public static void displayLoadingBar(final String text, final String completeText, final Player player, final int healthAdd, final long delay, final boolean loadUp) {
        PacketPlayOutSpawnEntityLiving mobPacket = getMobPacket(text, player.getLocation(), 200);
        PacketHelper.sendPacket(player, mobPacket);
        hasHealthBar.put(player.getName(), true);
        new BukkitRunnable() {
            int health = (loadUp ? 0 : 300);

            @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);
View Full Code Here

        }
        return experiencePacket;
    }

    public static PacketPlayOutUpdateHealth getHealthPacket(float health, int food, float food_saturation) {
        PacketPlayOutUpdateHealth healthPacket = new PacketPlayOutUpdateHealth();
        try {
            health_health.set(healthPacket, health);
            health_food.set(healthPacket, food);
            health_saturation.set(healthPacket, food_saturation);
View Full Code Here

        }
        return healthPacket;
    }

    public static void showHealth(Player player, float health, int food, float food_saturation) {
        PacketPlayOutUpdateHealth healthPacket = getHealthPacket(health, food, food_saturation);
        PacketHelper.sendPacket(player, healthPacket);
    }
View Full Code Here

        PacketPlayOutExperience experiencePacket = getExperiencePacket(player.getExp(), player.getLevel());
        PacketHelper.sendPacket(player, experiencePacket);
    }

    public static void resetHealth(Player player) {
        PacketPlayOutUpdateHealth healthPacket = getHealthPacket((float) player.getHealth(),
                player.getFoodLevel(), player.getSaturation());
        PacketHelper.sendPacket(player, healthPacket);
    }
View Full Code Here

    }

    public org.bukkit.inventory.PlayerInventory getInventory() {
        if (InventoryScriptHelper.offlineInventories.containsKey(getUniqueId()))
            return InventoryScriptHelper.offlineInventories.get(getUniqueId());
        PlayerInventory inventory = new PlayerInventory(null);
        inventory.b(this.compound.getList("Inventory", 10));
        org.bukkit.inventory.PlayerInventory inv = new CraftInventoryPlayer(inventory);
        InventoryScriptHelper.offlineInventories.put(getUniqueId(), inv);
        return inv;
    }
View Full Code Here

        InventoryScriptHelper.offlineInventories.put(getUniqueId(), inv);
        return inv;
    }

    public void setInventory(org.bukkit.inventory.Inventory inventory) {
        CraftInventoryPlayer inv = new CraftInventoryPlayer(new PlayerInventory(null));
        inv.setContents(inventory.getContents());
        this.compound.set("Inventory", inv.getInventory().a(new NBTTagList()));
        if(this.autosave) savePlayerData();
    }
View Full Code Here

    // canSpawnStructureAtCoords
    @Override
    protected boolean a(int chunkX, int chunkZ)
    {
        Random rand = b;
        World worldMC = c;
        if (rand.nextInt(80) < Math.max(Math.abs(chunkX), Math.abs(chunkZ)))
        {
            LocalWorld world = WorldHelper.toLocalWorld(worldMC);
            LocalBiome biome = world.getBiome(chunkX * 16 + 8, chunkZ * 16 + 8);
            if (rand.nextDouble() * 100.0 < biome.getBiomeConfig().mineshaftsRarity)
View Full Code Here

    }

    @Override
    protected StructureStart b(int i, int j)
    {
        return new WorldGenMineshaftStart(this.c, this.b, i, j);
    }
View Full Code Here

TOP

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

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.