- added some custom food and drinks
- added kand coins - started working on the blazing set
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package fantasypvp.kand.commands;
|
||||
|
||||
import fantasypvp.kand.items.LightningGear;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CmdLightningSword implements CommandExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("Only players can use this command");
|
||||
return true;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
|
||||
if(player.hasPermission("kand.lightning_sword")) {
|
||||
if (command.getName().equalsIgnoreCase("lightning_sword")) {
|
||||
player.getInventory().addItem(LightningGear.lightning_sword);
|
||||
}
|
||||
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED+"You don't have permission to run this command.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package fantasypvp.kand.commands;
|
||||
//Was made by DanThePythonMan
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
|
||||
public class CmdTeleportSpawn implements CommandExecutor {
|
||||
|
||||
private final JavaPlugin plugin;
|
||||
|
||||
|
||||
|
||||
public CmdTeleportSpawn(JavaPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
|
||||
boolean success = false;
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("You must be a player to execute this command!");
|
||||
return false;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
|
||||
player.sendMessage(ChatColor.GREEN + "Sending you to spawn");
|
||||
|
||||
String coordinates = getCoordinates();
|
||||
|
||||
if (coordinates == null) {
|
||||
player.sendMessage(ChatColor.RED + "An error occurred, you will not be teleported.");
|
||||
} else {
|
||||
|
||||
int x, y, z;
|
||||
|
||||
String[] coordsList = coordinates.split(" ");
|
||||
|
||||
x = Integer.parseInt(coordsList[0]);
|
||||
y = Integer.parseInt(coordsList[1]);
|
||||
z = Integer.parseInt(coordsList[2]);
|
||||
|
||||
Location location = new Location(player.getWorld(), x,y,z);
|
||||
|
||||
location.setPitch(player.getLocation().getPitch());
|
||||
location.setYaw(player.getLocation().getYaw());
|
||||
|
||||
player.teleport(location);
|
||||
|
||||
success = true;
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
private String getCoordinates() {
|
||||
File dataFolder = plugin.getDataFolder();
|
||||
if (!dataFolder.exists()) {
|
||||
dataFolder.mkdirs();
|
||||
}
|
||||
|
||||
try {
|
||||
File file = new File(dataFolder, "spawnCoords.txt");
|
||||
if (!file.exists()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
FileReader fileReader = new FileReader(file);
|
||||
BufferedReader bufferedReader = new BufferedReader(fileReader);
|
||||
String line = bufferedReader.readLine();
|
||||
bufferedReader.close();
|
||||
|
||||
return line;
|
||||
|
||||
} catch (IOException e) {
|
||||
plugin.getLogger().warning("Error occurred while reading spawn coordinates: " + e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package fantasypvp.kand.commands;
|
||||
|
||||
import fantasypvp.kand.items.DashItem;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class GiveDashItemCmd implements CommandExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
|
||||
if(!(sender instanceof Player)){
|
||||
sender.sendMessage("You must be a player to execute this command");
|
||||
return true;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
|
||||
if(!(player.hasPermission("giveDashItem"))){
|
||||
player.sendMessage(ChatColor.RED+"You don't have permission to run this command.");
|
||||
return true;
|
||||
}
|
||||
|
||||
ItemStack dashItem = new DashItem().createDashItem();
|
||||
|
||||
player.getInventory().addItem(dashItem);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package fantasypvp.kand.commands;
|
||||
|
||||
import fantasypvp.kand.items.KandCoin;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import static org.bukkit.Bukkit.broadcastMessage;
|
||||
|
||||
public class KandCoinCmd implements CommandExecutor, Listener {
|
||||
@Override
|
||||
public boolean onCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("Only players can use this command");
|
||||
return true;
|
||||
}
|
||||
|
||||
broadcastMessage("Kand Coin: ");
|
||||
|
||||
Player player = (Player) sender;
|
||||
|
||||
|
||||
if (player.hasPermission("kand.economy.admin")) {
|
||||
if (command.getName().equalsIgnoreCase("get_currency")) {
|
||||
|
||||
ItemStack k = KandCoin.kandCoin;
|
||||
|
||||
int quantity;
|
||||
try {
|
||||
quantity = Integer.parseInt(args[0]);
|
||||
|
||||
} catch (NumberFormatException e) {
|
||||
player.sendMessage(ChatColor.RED + "Invalid quantity");
|
||||
return true;
|
||||
}
|
||||
|
||||
broadcastMessage(quantity + " " + k.getItemMeta().getDisplayName() + " added to your inventory.");
|
||||
|
||||
k.setAmount(quantity);
|
||||
player.getInventory().addItem(KandCoin.kandCoin);
|
||||
}
|
||||
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + "You don't have permission to run this command.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public boolean onPlayerJoin(PlayerJoinEvent e) {
|
||||
Player p = e.getPlayer();
|
||||
if (!p.hasPlayedBefore()) {
|
||||
ItemStack k = KandCoin.kandCoin;
|
||||
int quantity = 16;
|
||||
k.setAmount(quantity);
|
||||
p.sendMessage(quantity + " " + k.getItemMeta().getDisplayName() + " welcome to KandSMP\n you have received 16 Kand coins to get you started!");
|
||||
p.getInventory().addItem(k);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package fantasypvp.kand.commands;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
public class SetSpawnCommand implements CommandExecutor {
|
||||
|
||||
private final JavaPlugin plugin;
|
||||
|
||||
public SetSpawnCommand(JavaPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("You must be a player to execute this command!");
|
||||
return false;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
if(!player.hasPermission("kand.setglobalspawn")){
|
||||
|
||||
player.sendMessage(ChatColor.RED+"You don't have permission to run this.");
|
||||
|
||||
}else{
|
||||
|
||||
String coordinates = getCoordinates(player);
|
||||
|
||||
try {
|
||||
if (SetCoordinates(coordinates)) {
|
||||
player.sendMessage(ChatColor.GREEN + "Spawn Coordinates set!");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
player.sendMessage(ChatColor.RED + "Unable to set spawn coordinates");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private String getCoordinates(Player player) {
|
||||
// return (player.getLocation().getX() + " " + player.getLocation().getY() + " " + player.getLocation().getZ());
|
||||
|
||||
String x,y,z;
|
||||
|
||||
x=String.format("%.0f",player.getLocation().getX());
|
||||
y=String.format("%.0f",player.getLocation().getY());
|
||||
z=String.format("%.0f",player.getLocation().getZ());
|
||||
|
||||
return (x +" " + y + " "+ z);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private boolean SetCoordinates(String coordinates) throws IOException {
|
||||
File dataFolder = plugin.getDataFolder();
|
||||
if (!dataFolder.exists()) {
|
||||
dataFolder.mkdirs();
|
||||
}
|
||||
|
||||
File file = new File(dataFolder, "spawnCoords.txt");
|
||||
try (FileWriter fileWriter = new FileWriter(file, false)) {
|
||||
fileWriter.write(coordinates);
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
plugin.getLogger().warning("Spawn TP Plugin couldn't save coordinates. Error: " + e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package fantasypvp.kand.events;
|
||||
|
||||
import fantasypvp.kand.items.DashItem;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class DashItemListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
ItemStack item = event.getItem(); // Get the item the player interacted with
|
||||
|
||||
// Check if the interaction was a right-click and the item is in the main hand
|
||||
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
if (item != null && item.isSimilar(new DashItem().createDashItem()) && event.getHand() == EquipmentSlot.HAND) {
|
||||
Location location = player.getLocation();
|
||||
Vector direction = location.getDirection();
|
||||
player.setVelocity(direction.multiply(5.0));
|
||||
player.playSound(location, Sound.ENTITY_DRAGON_FIREBALL_EXPLODE, 1.0f, 1.0f);
|
||||
World world = player.getWorld();
|
||||
world.spawnParticle(Particle.EXPLOSION_HUGE, location, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void OnEntityDamage(EntityDamageEvent event){
|
||||
if(event.getEntity() instanceof Player){
|
||||
|
||||
Player player = (Player) event.getEntity();
|
||||
|
||||
ItemStack itemInMainHand = player.getInventory().getItemInMainHand();
|
||||
|
||||
if (itemInMainHand.isSimilar(new DashItem().createDashItem()) && event.getCause() == EntityDamageEvent.DamageCause.FALL) {
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package fantasypvp.kand.events;
|
||||
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
import static org.bukkit.Bukkit.*;
|
||||
|
||||
public class DragonGlide implements Listener {
|
||||
@EventHandler
|
||||
public static void onPlayerJump(PlayerJumpEvent event) {
|
||||
getServer().broadcastMessage("§a" + event.getPlayer().getName() + " jumped!");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package fantasypvp.kand.events;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
|
||||
import static org.bukkit.Bukkit.*;
|
||||
|
||||
public class Events implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public static void onEntityDamageByEntity(org.bukkit.event.entity.EntityDamageByEntityEvent event) {
|
||||
|
||||
if (event.getDamager() instanceof org.bukkit.entity.Player) {
|
||||
Player player = (Player) event.getDamager();
|
||||
// check if the player is using the lightning sword
|
||||
|
||||
try {
|
||||
player.getInventory().getItemInMainHand().getItemMeta().getLore().toString();
|
||||
} catch (NullPointerException e) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getInventory().getItemInMainHand().getItemMeta().getLore().toString().contains("§7All who oppose shall be smitten")) {
|
||||
// check if hit is critical
|
||||
if (player.getFallDistance() > 0.0F && !player.isInsideVehicle() && !player.isGliding() && !player.isSwimming() && !player.isClimbing() && player.getAttackCooldown() == 1.0F) {
|
||||
player.getWorld().strikeLightningEffect(event.getEntity().getLocation());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
else if (player.getInventory().getItemInMainHand().getItemMeta().getLore().toString().contains("§f[T5+] Witherite Sword")) {
|
||||
// if affected entity is wearing witherite gear
|
||||
if (event.getEntity() instanceof Player) {
|
||||
Player entity = (Player) event.getEntity();
|
||||
if (entity.getInventory().getHelmet().getItemMeta().getLore().toString().contains("§f[T5+] Witherite Helmet")
|
||||
&& entity.getInventory().getChestplate().getItemMeta().getLore().toString().contains("§f[T5+] Witherite Chestplate")
|
||||
&& entity.getInventory().getLeggings().getItemMeta().getLore().toString().contains("§f[T5+] Witherite Leggings")
|
||||
&& entity.getInventory().getBoots().getItemMeta().getLore().toString().contains("§f[T5+] Witherite Boots")) {
|
||||
;
|
||||
} else {
|
||||
PotionEffect effect = new PotionEffect(
|
||||
org.bukkit.potion.PotionEffectType.WITHER,
|
||||
20 * 5,
|
||||
2
|
||||
);
|
||||
effect.apply((LivingEntity) event.getEntity());
|
||||
}
|
||||
} else {
|
||||
PotionEffect effect = new PotionEffect(
|
||||
org.bukkit.potion.PotionEffectType.WITHER,
|
||||
20 * 5,
|
||||
2
|
||||
);
|
||||
effect.apply((LivingEntity) event.getEntity());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package fantasypvp.kand.events;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Statistic;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.*;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class PlayerJumpEvent extends Event {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final PlayerJumpEventListener listener = new PlayerJumpEventListener();
|
||||
|
||||
private Player player;
|
||||
|
||||
public PlayerJumpEvent(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
private static class PlayerJumpEventListener implements Listener {
|
||||
|
||||
private Map<UUID, Integer> jumps = new HashMap<>();
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerJoin(PlayerJoinEvent e) {
|
||||
jumps.put(e.getPlayer().getUniqueId(), e.getPlayer().getStatistic(Statistic.JUMP));
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerQuit(PlayerQuitEvent e) {
|
||||
jumps.remove(e.getPlayer().getUniqueId());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerMove(PlayerMoveEvent e) {
|
||||
Player player = e.getPlayer();
|
||||
|
||||
if(e.getFrom().getY() < e.getTo().getY()) {
|
||||
int current = player.getStatistic(Statistic.JUMP);
|
||||
int last = jumps.getOrDefault(player.getUniqueId(), -1);
|
||||
|
||||
if(last != current) {
|
||||
jumps.put(player.getUniqueId(), current);
|
||||
|
||||
double yDif = (long) ((e.getTo().getY() - e.getFrom().getY()) * 1000) / 1000d;
|
||||
|
||||
if((yDif < 0.035 || yDif > 0.037) && (yDif < 0.116 || yDif > 0.118)) {
|
||||
Bukkit.getPluginManager().callEvent(new PlayerJumpEvent(player));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void register(JavaPlugin plugin) {
|
||||
Bukkit.getPluginManager().registerEvents(listener, plugin);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package fantasypvp.kand.items;
|
||||
|
||||
import fantasypvp.kand.util.attribute_gear.TierV;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.inventory.*;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
|
||||
public class BlazingSet {
|
||||
public static ItemStack sword;
|
||||
public static ItemStack helmet;
|
||||
public static ItemStack chestplate;
|
||||
public static ItemStack leggings;
|
||||
public static ItemStack boots;
|
||||
|
||||
public static ItemStack blazing_halo;
|
||||
|
||||
private static RecipeChoice netherite_upgrade;
|
||||
private static RecipeChoice upgrade_ingredient;
|
||||
|
||||
public static void init() {
|
||||
netherite_upgrade = new RecipeChoice.MaterialChoice(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);
|
||||
|
||||
// THIS MUST BE CHANGED
|
||||
upgrade_ingredient = new RecipeChoice.MaterialChoice(Material.NETHERITE_INGOT);
|
||||
|
||||
sword();
|
||||
helmet();
|
||||
chestplate();
|
||||
leggings();
|
||||
boots();
|
||||
}
|
||||
|
||||
private static void sword() {
|
||||
ItemStack item = TierV.sword();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bPLACEHOLDER");
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add("§f<PLACEHOLDER>");
|
||||
meta.setLore(lore);
|
||||
item.setItemMeta(meta);
|
||||
sword = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "PLACEHOLDER_SWORD");
|
||||
RecipeChoice sword = new RecipeChoice.MaterialChoice(Material.NETHERITE_SWORD);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, upgrade_ingredient, sword);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void helmet() {
|
||||
ItemStack item = TierV.helmet();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bPLACEHOLDER");
|
||||
item.setItemMeta(meta);
|
||||
helmet = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "PLACEHOLDER_HELMET");
|
||||
RecipeChoice helmet = new RecipeChoice.MaterialChoice(Material.NETHERITE_HELMET);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, upgrade_ingredient, helmet);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void chestplate() {
|
||||
ItemStack item = TierV.chestplate();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bPLACEHOLDER");
|
||||
item.setItemMeta(meta);
|
||||
helmet = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "PLACEHOLDER_CHESTPLATE");
|
||||
RecipeChoice chestplate = new RecipeChoice.MaterialChoice(Material.NETHERITE_CHESTPLATE);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, upgrade_ingredient, chestplate);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void leggings() {
|
||||
ItemStack item = TierV.leggings();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bPLACEHOLDER");
|
||||
item.setItemMeta(meta);
|
||||
helmet = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "PLACEHOLDER_LEGGINGS");
|
||||
RecipeChoice leggings = new RecipeChoice.MaterialChoice(Material.NETHERITE_LEGGINGS);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, upgrade_ingredient, leggings);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void boots() {
|
||||
ItemStack item = TierV.boots();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bPLACEHOLDER");
|
||||
item.setItemMeta(meta);
|
||||
helmet = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "PLACEHOLDER_BOOTS");
|
||||
RecipeChoice boots = new RecipeChoice.MaterialChoice(Material.NETHERITE_BOOTS);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, upgrade_ingredient, boots);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package fantasypvp.kand.items;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.Recipe;
|
||||
import org.bukkit.inventory.ShapedRecipe;
|
||||
import org.bukkit.inventory.ShapelessRecipe;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.PotionMeta;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.bukkit.Bukkit.broadcastMessage;
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
|
||||
public class CustomDrinks implements Listener {
|
||||
public static ItemStack apple_juice;
|
||||
public static ItemStack cider;
|
||||
|
||||
|
||||
public static void init() {
|
||||
appleJuice();
|
||||
cider();
|
||||
}
|
||||
|
||||
private static void appleJuice() {
|
||||
ItemStack item = new ItemStack(Material.POTION, 1);
|
||||
|
||||
PotionMeta pm = (PotionMeta) item.getItemMeta();
|
||||
pm.setBasePotionData(new org.bukkit.potion.PotionData(org.bukkit.potion.PotionType.WATER));
|
||||
|
||||
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add(ChatColor.YELLOW + "Just plain ordinary Apple Juice");
|
||||
|
||||
pm.setDisplayName("Apple Juice");
|
||||
|
||||
// set food value
|
||||
|
||||
pm.addCustomEffect(
|
||||
new org.bukkit.potion.PotionEffect(
|
||||
PotionEffectType.SATURATION,
|
||||
1,
|
||||
4
|
||||
),
|
||||
true
|
||||
);
|
||||
|
||||
item.setItemMeta(pm);
|
||||
apple_juice = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "apple_juice");
|
||||
ShapelessRecipe recipe = new ShapelessRecipe(key, apple_juice);
|
||||
recipe.addIngredient(Material.APPLE);
|
||||
recipe.addIngredient(1, Material.POTION, (byte)0);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void ciderCrafting(org.bukkit.event.inventory.PrepareItemCraftEvent event) {
|
||||
|
||||
int i = 0;
|
||||
for (ItemStack item : event.getInventory().getMatrix()) {
|
||||
if (item != null) {
|
||||
i += item.getAmount();
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getInventory().contains(apple_juice, 1)
|
||||
&& event.getInventory().contains(Material.SUGAR, 2)
|
||||
&& i == 3
|
||||
) {
|
||||
event.getInventory().setResult(cider);
|
||||
}
|
||||
}
|
||||
|
||||
private static void cider() {
|
||||
ItemStack item = new ItemStack(Material.POTION, 1);
|
||||
|
||||
PotionMeta pm = (PotionMeta) item.getItemMeta();
|
||||
pm.setBasePotionData(new org.bukkit.potion.PotionData(org.bukkit.potion.PotionType.WATER));
|
||||
|
||||
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add(ChatColor.YELLOW + "A bottle of cider.");
|
||||
|
||||
pm.setDisplayName("Cider");
|
||||
|
||||
// set food value
|
||||
|
||||
pm.addCustomEffect(
|
||||
new org.bukkit.potion.PotionEffect(
|
||||
PotionEffectType.SATURATION,
|
||||
1,
|
||||
5
|
||||
),
|
||||
true
|
||||
);
|
||||
pm.addCustomEffect(
|
||||
new org.bukkit.potion.PotionEffect(
|
||||
PotionEffectType.SPEED,
|
||||
5,
|
||||
1
|
||||
),
|
||||
true
|
||||
);
|
||||
|
||||
item.setItemMeta(pm);
|
||||
cider = item;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package fantasypvp.kand.items;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class CustomFoods {
|
||||
public static ItemStack steak_burger;
|
||||
|
||||
public static void init() {
|
||||
steakBurger();
|
||||
}
|
||||
|
||||
private static void steakBurger() {
|
||||
ItemStack item = new ItemStack(Material.COOKED_BEEF, 1);
|
||||
steak_burger = item;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package fantasypvp.kand.items;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DashItem extends ItemStack {
|
||||
|
||||
public ItemStack createDashItem(){
|
||||
|
||||
ItemStack item = new ItemStack(Material.STICK,1);
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
|
||||
List<String>stickLore = new ArrayList<>();
|
||||
stickLore.add("Click this stick and you'll be there in a jiffy.");
|
||||
stickLore.add("About this, don't get sniffy.");
|
||||
|
||||
|
||||
meta.setLore(stickLore);
|
||||
|
||||
meta.setDisplayName(ChatColor.AQUA+"[Dash"+ChatColor.BLUE+" Stick]");
|
||||
|
||||
item.setItemMeta(meta);
|
||||
|
||||
return item;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package fantasypvp.kand.items;
|
||||
|
||||
import fantasypvp.kand.util.attribute_gear.TierV;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.inventory.*;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
|
||||
public class GearTemplate {
|
||||
public static ItemStack sword;
|
||||
public static ItemStack helmet;
|
||||
public static ItemStack chestplate;
|
||||
public static ItemStack leggings;
|
||||
public static ItemStack boots;
|
||||
|
||||
private static RecipeChoice netherite_upgrade;
|
||||
private static RecipeChoice upgrade_ingredient;
|
||||
|
||||
public static void init() {
|
||||
netherite_upgrade = new RecipeChoice.MaterialChoice(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);
|
||||
|
||||
// THIS MUST BE CHANGED
|
||||
upgrade_ingredient = new RecipeChoice.MaterialChoice(Material.BARRIER);
|
||||
|
||||
sword();
|
||||
helmet();
|
||||
chestplate();
|
||||
leggings();
|
||||
boots();
|
||||
}
|
||||
|
||||
private static void sword() {
|
||||
ItemStack item = TierV.sword();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bPLACEHOLDER");
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add("§f<PLACEHOLDER>");
|
||||
meta.setLore(lore);
|
||||
item.setItemMeta(meta);
|
||||
sword = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "PLACEHOLDER_SWORD");
|
||||
RecipeChoice sword = new RecipeChoice.MaterialChoice(Material.NETHERITE_SWORD);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, upgrade_ingredient, sword);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void helmet() {
|
||||
ItemStack item = TierV.helmet();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bPLACEHOLDER");
|
||||
item.setItemMeta(meta);
|
||||
helmet = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "PLACEHOLDER_HELMET");
|
||||
RecipeChoice helmet = new RecipeChoice.MaterialChoice(Material.NETHERITE_HELMET);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, upgrade_ingredient, helmet);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void chestplate() {
|
||||
ItemStack item = TierV.chestplate();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bPLACEHOLDER");
|
||||
item.setItemMeta(meta);
|
||||
helmet = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "PLACEHOLDER_CHESTPLATE");
|
||||
RecipeChoice chestplate = new RecipeChoice.MaterialChoice(Material.NETHERITE_CHESTPLATE);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, upgrade_ingredient, chestplate);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void leggings() {
|
||||
ItemStack item = TierV.leggings();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bPLACEHOLDER");
|
||||
item.setItemMeta(meta);
|
||||
helmet = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "PLACEHOLDER_LEGGINGS");
|
||||
RecipeChoice leggings = new RecipeChoice.MaterialChoice(Material.NETHERITE_LEGGINGS);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, upgrade_ingredient, leggings);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void boots() {
|
||||
ItemStack item = TierV.boots();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bPLACEHOLDER");
|
||||
item.setItemMeta(meta);
|
||||
helmet = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "PLACEHOLDER_BOOTS");
|
||||
RecipeChoice boots = new RecipeChoice.MaterialChoice(Material.NETHERITE_BOOTS);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, upgrade_ingredient, boots);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package fantasypvp.kand.items;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class KandCoin extends ItemStack {
|
||||
public static ItemStack kandCoin;
|
||||
|
||||
public static void init() {
|
||||
kandCoin = KandCoin();
|
||||
}
|
||||
|
||||
public static ItemStack KandCoin() {
|
||||
ItemStack item = new ItemStack(Material.POPPED_CHORUS_FRUIT, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.GOLD + "Kand Coin");
|
||||
|
||||
List<String> lore = new ArrayList<>();
|
||||
String lore_line = ChatColor.GRAY + "The Official KandSMP Currency.";
|
||||
lore.add(lore_line);
|
||||
meta.setLore(lore);
|
||||
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package fantasypvp.kand.items;
|
||||
|
||||
import fantasypvp.kand.util.attribute_gear.TierVI;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.inventory.*;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
|
||||
public class LightningGear {
|
||||
public static ItemStack lightning_sword;
|
||||
|
||||
public static void init() {
|
||||
lightningSword();
|
||||
}
|
||||
|
||||
private static void lightningSword() {
|
||||
ItemStack item = new ItemStack(Material.NETHERITE_SWORD, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("Lightning Sword");
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add("§7All who oppose shall be smitten");
|
||||
meta.setLore(lore);
|
||||
// set damage to 12 when in main hand
|
||||
UUID uuid = UUID.randomUUID();
|
||||
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier(
|
||||
uuid,
|
||||
"generic.attackDamage",
|
||||
8,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HAND
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.attackSpeed",
|
||||
-2.4,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HAND
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
lightning_sword = item;
|
||||
|
||||
// shaped recipe
|
||||
ShapedRecipe recipe = new ShapedRecipe(NamespacedKey.minecraft("lightning_sword"), item);
|
||||
recipe.shape(
|
||||
" X ",
|
||||
" X ",
|
||||
" H "
|
||||
);
|
||||
recipe.setIngredient('X', Material.NETHER_STAR);
|
||||
recipe.setIngredient('H', Material.LIGHTNING_ROD);
|
||||
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
package fantasypvp.kand.items;
|
||||
|
||||
import fantasypvp.kand.util.attribute_gear.TierVI;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.inventory.*;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
|
||||
public class TrueNetherite {
|
||||
public static ItemStack true_netherite_sword;
|
||||
public static ItemStack true_netherite_helmet;
|
||||
public static ItemStack true_netherite_chestplate;
|
||||
public static ItemStack true_netherite_leggings;
|
||||
public static ItemStack true_netherite_boots;
|
||||
|
||||
public static void init() {
|
||||
trueNetheriteSword();
|
||||
trueNetheriteHelmet();
|
||||
trueNetheriteChestplate();
|
||||
trueNetheriteLeggings();
|
||||
trueNetheriteBoots();
|
||||
}
|
||||
|
||||
private static void trueNetheriteSword() {
|
||||
ItemStack item = TierVI.sword();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bTrue Netherite Sword");
|
||||
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add("§fThe true sword of the Nether");
|
||||
meta.setLore(lore);
|
||||
item.setItemMeta(meta);
|
||||
|
||||
true_netherite_sword = item;
|
||||
|
||||
RecipeChoice netherite_upgrade = new RecipeChoice.MaterialChoice(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);
|
||||
RecipeChoice nether_star = new RecipeChoice.MaterialChoice(Material.NETHER_STAR);
|
||||
RecipeChoice netherite_sword = new RecipeChoice.MaterialChoice(Material.NETHERITE_SWORD);
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "true_netherite_sword");
|
||||
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, nether_star, netherite_sword);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void trueNetheriteHelmet() {
|
||||
ItemStack item = TierVI.helmet();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bTrue Netherite Helmet");
|
||||
|
||||
UUID uuid = UUID.randomUUID();
|
||||
meta.addAttributeModifier(
|
||||
Attribute.GENERIC_MAX_HEALTH,
|
||||
new AttributeModifier(
|
||||
uuid,
|
||||
"generic.maxHealth",
|
||||
5.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HEAD
|
||||
)
|
||||
);
|
||||
item.setItemMeta(meta);
|
||||
true_netherite_helmet = item;
|
||||
|
||||
RecipeChoice netherite_upgrade = new RecipeChoice.MaterialChoice(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);
|
||||
RecipeChoice nether_star = new RecipeChoice.MaterialChoice(Material.NETHER_STAR);
|
||||
RecipeChoice netherite_helmet = new RecipeChoice.MaterialChoice(Material.NETHERITE_HELMET);
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "true_netherite_helmet");
|
||||
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, nether_star, netherite_helmet);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void trueNetheriteChestplate() {
|
||||
ItemStack item = TierVI.chestplate();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bTrue Netherite Chestplate");
|
||||
|
||||
UUID uuid = UUID.randomUUID();
|
||||
meta.addAttributeModifier(
|
||||
Attribute.GENERIC_MAX_HEALTH,
|
||||
new AttributeModifier(
|
||||
uuid,
|
||||
"generic.maxHealth",
|
||||
5.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.CHEST
|
||||
)
|
||||
);
|
||||
item.setItemMeta(meta);
|
||||
true_netherite_chestplate = item;
|
||||
|
||||
RecipeChoice netherite_upgrade = new RecipeChoice.MaterialChoice(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);
|
||||
RecipeChoice nether_star = new RecipeChoice.MaterialChoice(Material.NETHER_STAR);
|
||||
RecipeChoice netherite_chestplate = new RecipeChoice.MaterialChoice(Material.NETHERITE_CHESTPLATE);
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "true_netherite_chestplate");
|
||||
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, nether_star, netherite_chestplate);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void trueNetheriteLeggings() {
|
||||
ItemStack item = TierVI.leggings();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bTrue Netherite Leggings");
|
||||
|
||||
UUID uuid = UUID.randomUUID();
|
||||
meta.addAttributeModifier(
|
||||
Attribute.GENERIC_MAX_HEALTH,
|
||||
new AttributeModifier(
|
||||
uuid,
|
||||
"generic.maxHealth",
|
||||
5.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.LEGS
|
||||
)
|
||||
);
|
||||
item.setItemMeta(meta);
|
||||
true_netherite_leggings = item;
|
||||
|
||||
RecipeChoice netherite_upgrade = new RecipeChoice.MaterialChoice(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);
|
||||
RecipeChoice nether_star = new RecipeChoice.MaterialChoice(Material.NETHER_STAR);
|
||||
RecipeChoice netherite_leggings = new RecipeChoice.MaterialChoice(Material.NETHERITE_LEGGINGS);
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "true_netherite_leggings");
|
||||
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, nether_star, netherite_leggings);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void trueNetheriteBoots() {
|
||||
ItemStack item = TierVI.boots();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bTrue Netherite Boots");
|
||||
|
||||
UUID uuid = UUID.randomUUID();
|
||||
meta.addAttributeModifier(
|
||||
Attribute.GENERIC_MAX_HEALTH,
|
||||
new AttributeModifier(
|
||||
uuid,
|
||||
"generic.maxHealth",
|
||||
5.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.FEET
|
||||
)
|
||||
);
|
||||
item.setItemMeta(meta);
|
||||
true_netherite_boots = item;
|
||||
|
||||
RecipeChoice netherite_upgrade = new RecipeChoice.MaterialChoice(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);
|
||||
RecipeChoice nether_star = new RecipeChoice.MaterialChoice(Material.NETHER_STAR);
|
||||
RecipeChoice netherite_boots = new RecipeChoice.MaterialChoice(Material.NETHERITE_BOOTS);
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "true_netherite_boots");
|
||||
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, nether_star, netherite_boots);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
package fantasypvp.kand.items;
|
||||
|
||||
import fantasypvp.kand.util.attribute_gear.TierV;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.PrepareSmithingEvent;
|
||||
import org.bukkit.inventory.*;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
|
||||
public class Witherite {
|
||||
public static ItemStack sword;
|
||||
public static ItemStack helmet;
|
||||
public static ItemStack chestplate;
|
||||
public static ItemStack leggings;
|
||||
public static ItemStack boots;
|
||||
|
||||
private static RecipeChoice netherite_upgrade;
|
||||
private static RecipeChoice wither_skull;
|
||||
|
||||
public static void init() {
|
||||
netherite_upgrade = new RecipeChoice.MaterialChoice(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);
|
||||
wither_skull = new RecipeChoice.MaterialChoice(Material.WITHER_SKELETON_SKULL);
|
||||
|
||||
sword();
|
||||
helmet();
|
||||
chestplate();
|
||||
leggings();
|
||||
boots();
|
||||
}
|
||||
|
||||
private static void sword() {
|
||||
ItemStack item = TierV.sword();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("§bWitherite Sword");
|
||||
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add("§f[T5+] Witherite Sword");
|
||||
meta.setLore(lore);
|
||||
item.setItemMeta(meta);
|
||||
sword = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "witherite_sword");
|
||||
RecipeChoice netherite_sword = new RecipeChoice.MaterialChoice(Material.NETHERITE_SWORD);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, wither_skull, netherite_sword);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void helmet() {
|
||||
ItemStack item = TierV.helmet();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add("§f[T5+] Witherite Helmet");
|
||||
meta.setLore(lore);
|
||||
meta.setDisplayName("§bWitherite Helmet");
|
||||
item.setItemMeta(meta);
|
||||
helmet = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "witherite_helmet");
|
||||
RecipeChoice netherite_helmet = new RecipeChoice.MaterialChoice(Material.NETHERITE_HELMET);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, wither_skull, netherite_helmet);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void chestplate() {
|
||||
ItemStack item = TierV.chestplate();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add("§f[T5+] Witherite Chestplate");
|
||||
meta.setLore(lore);
|
||||
meta.setDisplayName("§bWitherite Chestplate");
|
||||
item.setItemMeta(meta);
|
||||
helmet = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "witherite_chestplate");
|
||||
RecipeChoice netherite_chestplate = new RecipeChoice.MaterialChoice(Material.NETHERITE_CHESTPLATE);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, wither_skull, netherite_chestplate);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void leggings() {
|
||||
ItemStack item = TierV.leggings();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add("§f[T5+] Witherite Leggings");
|
||||
meta.setLore(lore);
|
||||
meta.setDisplayName("§bWitherite Leggings");
|
||||
item.setItemMeta(meta);
|
||||
helmet = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "witherite_leggings");
|
||||
RecipeChoice netherite_leggings = new RecipeChoice.MaterialChoice(Material.NETHERITE_LEGGINGS);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, wither_skull, netherite_leggings);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
|
||||
private static void boots() {
|
||||
ItemStack item = TierV.boots();
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add("§f[T5+] Witherite Boots");
|
||||
meta.setLore(lore);
|
||||
meta.setDisplayName("§bWitherite Boots");
|
||||
item.setItemMeta(meta);
|
||||
helmet = item;
|
||||
|
||||
NamespacedKey key = new NamespacedKey("fantasypvp.kand_smp.items", "witherite_boots");
|
||||
RecipeChoice netherite_boots = new RecipeChoice.MaterialChoice(Material.NETHERITE_BOOTS);
|
||||
SmithingTransformRecipe recipe = new SmithingTransformRecipe(key, item, netherite_upgrade, wither_skull, netherite_boots);
|
||||
getServer().addRecipe(recipe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
|
||||
# Gear Tiers:
|
||||
|
||||
## Tier 1:
|
||||
- leather / wood gear
|
||||
- pretty much pointless
|
||||
|
||||
## Tier 2:
|
||||
- stone / chain gear
|
||||
- pretty much pointless
|
||||
|
||||
## Tier 3/3+:
|
||||
- Iron gear & upgrades
|
||||
- Upgrades are equivalent to iron gear in stats however have special abilities that make
|
||||
them a suitable alternative to vanilla diamond armour in some places
|
||||
- Eg:
|
||||
- [T3+] Blazing set: perm fire res, thorns effect deals fire damage, built in fire aspect & flame
|
||||
|
||||
## Tier 4/4+:
|
||||
- Diamond gear & upgrades & equivalents
|
||||
- Upgrades are equivalent to diamond gear in stats however have special abilities that make
|
||||
them a suitable alternative to vanilla netherite armour in some places
|
||||
- Eg:
|
||||
- [T4+] Dragon set: base stats of diamond armour but with built in elytra & dash ability
|
||||
- [T4+] Trader's set: Villager trades are around 20% cheaper & Illagers drop more emeralds on death
|
||||
|
||||
## Tier 5/5+/6:
|
||||
- Netherite gear & upgrades
|
||||
- Upgrades have equal or greater base stats than netherite gear, however may have custom abilties
|
||||
making them a suitable alternative to or upgrade from netherite
|
||||
- Late game sets / will be difficult to obtain
|
||||
- Eg:
|
||||
- [T5+] Witherite set: netherite gear - sword can inflict wither - immunity to wither
|
||||
- [T6] True Netherite: gear set with higher base stats than neatherite & permanent fire res
|
||||
|
||||
|
||||
# Nether Sets / Items:
|
||||
|
||||
## Blazing Halo
|
||||
- crafted with 8 blaze rods in a circle.
|
||||
|
||||
## True Netherite Set
|
||||
- Netherite gear upgraded with nether stars at a smithing table
|
||||
- Permanent fire resistance
|
||||
- Increased melee damage
|
||||
- Higher base armour than netherite
|
||||
|
||||
## Witherite Set
|
||||
- Netherite upgraded with wither skeleton skulls at a smithing table
|
||||
- Provides immunity to the wither effect
|
||||
- Sword may inflict Wither-I on hit
|
||||
- Right clicking with sword should shoot skulls?
|
||||
|
||||
## Blazing Set
|
||||
- upgrade from iron gear
|
||||
- sword can be crafted directly by crafting an iron sword with a blazing halo instead of a stick.
|
||||
- sword and armour can be upgraded using a *Blazing Halo* per piece
|
||||
- provides fire resistance
|
||||
- sword lights enemies on fire (built in fire aspect but with a longer duration)
|
||||
- sword has slightly increased attack damage over iron
|
||||
- enemies may be set on fire when attacking you
|
||||
|
||||
# End Sets / Items:
|
||||
|
||||
## Dragon Scale:
|
||||
- crafted with a diamond, a chorus fruit & dragon's breath
|
||||
|
||||
## Dragon Set:
|
||||
- crafted using dragon scales
|
||||
- the helmet also requires a dragon head
|
||||
- full set:
|
||||
- infinite elytra glide without elytra
|
||||
- same protection as diamond gear
|
||||
- dash ability which allows a player to launch into the air without fireworks
|
||||
|
||||
# Other
|
||||
|
||||
## Lightning Sword
|
||||
- Rename necessary? (Zeus Staff?)
|
||||
- (Critical) attacking strikes lightning on a target
|
||||
- independent item
|
||||
- crafted with a lightning rod, two diamonds and two nether stars
|
||||
|
||||
## Dash Stick
|
||||
- Rename
|
||||
- Right click launches player where they are looking, plays a sound and summons explosion particles
|
||||
- Disables fall damage when active
|
||||
@@ -0,0 +1,42 @@
|
||||
package fantasypvp.kand;
|
||||
|
||||
import fantasypvp.kand.commands.*;
|
||||
import fantasypvp.kand.events.DashItemListener;
|
||||
import fantasypvp.kand.events.Events;
|
||||
import fantasypvp.kand.events.PlayerJumpEvent;
|
||||
import fantasypvp.kand.items.*;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public final class kandMain extends JavaPlugin {
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
// Plugin startup logic
|
||||
LightningGear.init();
|
||||
TrueNetherite.init();
|
||||
Witherite.init();
|
||||
CustomDrinks.init();
|
||||
KandCoin.init();
|
||||
// register listeners
|
||||
getServer().getPluginManager().registerEvents(new Events(), this);
|
||||
getServer().getPluginManager().registerEvents(new DashItemListener(),this);
|
||||
getServer().getPluginManager().registerEvents(new CustomDrinks(), this);
|
||||
getServer().getPluginManager().registerEvents(new KandCoinCmd(), this);
|
||||
PlayerJumpEvent.register(this);
|
||||
|
||||
getCommand("lightning_sword").setExecutor(new CmdLightningSword());
|
||||
getCommand("spawn").setExecutor(new CmdTeleportSpawn(this));
|
||||
getCommand("setglobalspawn").setExecutor(new SetSpawnCommand(this));
|
||||
getCommand("dashstick").setExecutor(new GiveDashItemCmd());
|
||||
getCommand("get_currency").setExecutor(new KandCoinCmd());
|
||||
|
||||
|
||||
getServer().broadcastMessage("§aKand SMP 2 has been enabled!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
// Plugin shutdown logic
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package fantasypvp.kand.util.attribute_gear;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public abstract class TierBase {
|
||||
public static ItemStack sword() {
|
||||
return new ItemStack(Material.WOODEN_SWORD);
|
||||
}
|
||||
|
||||
public static ItemStack helmet() {
|
||||
return new ItemStack(Material.LEATHER_HELMET);
|
||||
}
|
||||
|
||||
public static ItemStack chestplate() {
|
||||
return new ItemStack(Material.LEATHER_CHESTPLATE);
|
||||
}
|
||||
|
||||
public static ItemStack leggings() {
|
||||
return new ItemStack(Material.LEATHER_LEGGINGS);
|
||||
}
|
||||
|
||||
public static ItemStack boots() {
|
||||
return new ItemStack(Material.LEATHER_BOOTS);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package fantasypvp.kand.util.attribute_gear;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
// IRON ARMOUR EQUIVALENT
|
||||
|
||||
public abstract class TierIII extends TierBase {
|
||||
public static ItemStack sword () {
|
||||
ItemStack item = new ItemStack(Material.IRON_SWORD, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.attackDamage",
|
||||
6.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HAND
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.attackSpeed",
|
||||
-2.4,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HAND
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack helmet () {
|
||||
ItemStack item = new ItemStack(Material.IRON_HELMET, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
2.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HEAD
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack chestplate () {
|
||||
ItemStack item = new ItemStack(Material.IRON_CHESTPLATE, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
6.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.CHEST
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack leggings () {
|
||||
ItemStack item = new ItemStack(Material.IRON_LEGGINGS, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
5.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.LEGS
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack boots () {
|
||||
ItemStack item = new ItemStack(Material.IRON_BOOTS, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
2.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.FEET
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package fantasypvp.kand.util.attribute_gear;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
// DIAMOND ARMOUR EQUIVALENT
|
||||
|
||||
public abstract class TierIV extends TierBase {
|
||||
public static ItemStack sword () {
|
||||
ItemStack item = new ItemStack(Material.DIAMOND_SWORD, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.attackDamage",
|
||||
7.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HAND
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.attackSpeed",
|
||||
-2.4,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HAND
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack helmet () {
|
||||
ItemStack item = new ItemStack(Material.DIAMOND_HELMET, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
3.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HEAD
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armorToughness",
|
||||
2.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HEAD
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack chestplate () {
|
||||
ItemStack item = new ItemStack(Material.DIAMOND_CHESTPLATE, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
8.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.CHEST
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armorToughness",
|
||||
2.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.CHEST
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack leggings () {
|
||||
ItemStack item = new ItemStack(Material.DIAMOND_LEGGINGS, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
6.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.LEGS
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armorToughness",
|
||||
2.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.LEGS
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack boots () {
|
||||
ItemStack item = new ItemStack(Material.DIAMOND_BOOTS, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
3.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.FEET
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armorToughness",
|
||||
2.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.FEET
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package fantasypvp.kand.util.attribute_gear;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
// NETHERITE ARMOUR EQUIVALENT
|
||||
|
||||
public abstract class TierV extends TierBase {
|
||||
public static ItemStack sword () {
|
||||
ItemStack item = new ItemStack(Material.NETHERITE_SWORD, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.attackDamage",
|
||||
8.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HAND
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.attackSpeed",
|
||||
-2.4,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HAND
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack helmet () {
|
||||
ItemStack item = new ItemStack(Material.NETHERITE_HELMET, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
3.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HEAD
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armorToughness",
|
||||
3.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HEAD
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_KNOCKBACK_RESISTANCE, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.knockbackResistance",
|
||||
0.1,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HEAD
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack chestplate () {
|
||||
ItemStack item = new ItemStack(Material.NETHERITE_CHESTPLATE, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
8.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.CHEST
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armorToughness",
|
||||
3.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.CHEST
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_KNOCKBACK_RESISTANCE, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.knockbackResistance",
|
||||
0.1,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.CHEST
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack leggings () {
|
||||
ItemStack item = new ItemStack(Material.NETHERITE_LEGGINGS, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
6.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.LEGS
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armorToughness",
|
||||
3.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.LEGS
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_KNOCKBACK_RESISTANCE, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.knockbackResistance",
|
||||
0.1,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.LEGS
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack boots () {
|
||||
ItemStack item = new ItemStack(Material.NETHERITE_BOOTS, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
3.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.FEET
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armorToughness",
|
||||
3.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.FEET
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_KNOCKBACK_RESISTANCE, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.knockbackResistance",
|
||||
0.1,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.FEET
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package fantasypvp.kand.util.attribute_gear;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
// STATS > NETHERITE
|
||||
|
||||
public abstract class TierVI extends TierBase {
|
||||
public static ItemStack sword () {
|
||||
ItemStack item = new ItemStack(Material.NETHERITE_SWORD, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.attackDamage",
|
||||
9.5,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HAND
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.attackSpeed",
|
||||
-2.4,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HAND
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack helmet () {
|
||||
ItemStack item = new ItemStack(Material.NETHERITE_HELMET, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
3.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HEAD
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armorToughness",
|
||||
5.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HEAD
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_KNOCKBACK_RESISTANCE, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.knockbackResistance",
|
||||
0.1,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.HEAD
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack chestplate () {
|
||||
ItemStack item = new ItemStack(Material.NETHERITE_CHESTPLATE, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
8.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.CHEST
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armorToughness",
|
||||
5.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.CHEST
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_KNOCKBACK_RESISTANCE, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.knockbackResistance",
|
||||
0.1,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.CHEST
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack leggings () {
|
||||
ItemStack item = new ItemStack(Material.NETHERITE_LEGGINGS, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
6.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.LEGS
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armorToughness",
|
||||
5.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.LEGS
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_KNOCKBACK_RESISTANCE, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.knockbackResistance",
|
||||
0.1,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.LEGS
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack boots () {
|
||||
ItemStack item = new ItemStack(Material.NETHERITE_BOOTS, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armor",
|
||||
3.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.FEET
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.armorToughness",
|
||||
5.0,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.FEET
|
||||
));
|
||||
meta.addAttributeModifier(Attribute.GENERIC_KNOCKBACK_RESISTANCE, new AttributeModifier(
|
||||
UUID.randomUUID(),
|
||||
"generic.knockbackResistance",
|
||||
0.1,
|
||||
AttributeModifier.Operation.ADD_NUMBER,
|
||||
EquipmentSlot.FEET
|
||||
));
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user