mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-02 17:09:58 +01:00
Added horse armor /spawnmob horse:armor<iron|gold|diamond>
This commit is contained in:
parent
3aca9f793b
commit
8aac502ab6
@ -400,7 +400,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
|
||||
}
|
||||
}
|
||||
|
||||
//Print version even if admin command is not available
|
||||
//Print version even if admin command is not available #easteregg
|
||||
if (commandLabel.equalsIgnoreCase("essversion"))
|
||||
{
|
||||
sender.sendMessage("This server is running Essentials " + getDescription().getVersion());
|
||||
|
@ -1106,7 +1106,7 @@ public class Settings implements net.ess3.api.ISettings
|
||||
return config.getInt("max-nick-length", 30);
|
||||
}
|
||||
|
||||
|
||||
// #easteregg
|
||||
public int getMaxUserCacheCount()
|
||||
{
|
||||
long count = Runtime.getRuntime().maxMemory() / 1024 / 96;
|
||||
|
@ -21,6 +21,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.entity.Skeleton.SkeletonType;
|
||||
import org.bukkit.inventory.EntityEquipment;
|
||||
import org.bukkit.inventory.HorseInventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.Colorable;
|
||||
|
||||
@ -477,6 +478,23 @@ public class SpawnMob
|
||||
((Horse)spawned).setTamed(true);
|
||||
((Horse)spawned).getInventory().setSaddle(new ItemStack(Material.SADDLE, 1));
|
||||
}
|
||||
|
||||
if (data.contains("armor"))
|
||||
{
|
||||
((Horse)spawned).setTamed(true);
|
||||
HorseInventory invent = ((Horse)spawned).getInventory();
|
||||
if (data.contains("gold")) {
|
||||
invent.setArmor(new ItemStack(Material.GOLD_BARDING, 1));
|
||||
}
|
||||
else if (data.contains("diamond"))
|
||||
{
|
||||
invent.setArmor(new ItemStack(Material.DIAMOND_BARDING, 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
invent.setArmor(new ItemStack(Material.IRON_BARDING, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (type == EntityType.PIG)
|
||||
|
Loading…
Reference in New Issue
Block a user