mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Added horse armor /spawnmob horse:armor<iron|gold|diamond>
This commit is contained in:
parent
3aca9f793b
commit
8aac502ab6
3 changed files with 20 additions and 2 deletions
|
@ -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"))
|
if (commandLabel.equalsIgnoreCase("essversion"))
|
||||||
{
|
{
|
||||||
sender.sendMessage("This server is running Essentials " + getDescription().getVersion());
|
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);
|
return config.getInt("max-nick-length", 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #easteregg
|
||||||
public int getMaxUserCacheCount()
|
public int getMaxUserCacheCount()
|
||||||
{
|
{
|
||||||
long count = Runtime.getRuntime().maxMemory() / 1024 / 96;
|
long count = Runtime.getRuntime().maxMemory() / 1024 / 96;
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.*;
|
import org.bukkit.entity.*;
|
||||||
import org.bukkit.entity.Skeleton.SkeletonType;
|
import org.bukkit.entity.Skeleton.SkeletonType;
|
||||||
import org.bukkit.inventory.EntityEquipment;
|
import org.bukkit.inventory.EntityEquipment;
|
||||||
|
import org.bukkit.inventory.HorseInventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.material.Colorable;
|
import org.bukkit.material.Colorable;
|
||||||
|
|
||||||
|
@ -477,6 +478,23 @@ public class SpawnMob
|
||||||
((Horse)spawned).setTamed(true);
|
((Horse)spawned).setTamed(true);
|
||||||
((Horse)spawned).getInventory().setSaddle(new ItemStack(Material.SADDLE, 1));
|
((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)
|
if (type == EntityType.PIG)
|
||||||
|
|
Loading…
Reference in a new issue