- added some custom food and drinks
- added kand coins - started working on the blazing set
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>fantasypvp</groupId>
|
||||
<artifactId>kand_smp</artifactId>
|
||||
<artifactId>kand</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>kand_smp</name>
|
||||
<name>kand</name>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
@@ -23,8 +23,8 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<source>14</source>
|
||||
<target>14</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
package fantasypvp.kand_smp.commands;
|
||||
package fantasypvp.kand.commands;
|
||||
|
||||
import fantasypvp.kand_smp.items.LightningGear;
|
||||
import fantasypvp.kand.items.LightningGear;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -16,12 +16,12 @@ public class CmdLightningSword implements CommandExecutor {
|
||||
|
||||
Player player = (Player) sender;
|
||||
|
||||
if(player.hasPermission("lightning_sword")) {
|
||||
if(player.hasPermission("kand.lightning_sword")) {
|
||||
if (command.getName().equalsIgnoreCase("lightning_sword")) {
|
||||
player.getInventory().addItem(LightningGear.lightning_sword);
|
||||
}
|
||||
|
||||
}else {
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED+"You don't have permission to run this command.");
|
||||
}
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
package fantasypvp.kand_smp.commands;
|
||||
package fantasypvp.kand.commands;
|
||||
//Was made by DanThePythonMan
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.Command;
|
||||
+3
-4
@@ -1,15 +1,14 @@
|
||||
package fantasypvp.kand_smp.commands;
|
||||
package fantasypvp.kand.commands;
|
||||
|
||||
import fantasypvp.kand_smp.items.DashItem;
|
||||
import fantasypvp.kand.items.DashItem;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
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 GiveDashItemCommand implements CommandExecutor {
|
||||
public class GiveDashItemCmd implements CommandExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+2
-3
@@ -1,4 +1,4 @@
|
||||
package fantasypvp.kand_smp.commands;
|
||||
package fantasypvp.kand.commands;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
@@ -28,13 +28,12 @@ public class SetSpawnCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
if(!player.hasPermission("SpawnTP.canSetSpawn")){
|
||||
if(!player.hasPermission("kand.setglobalspawn")){
|
||||
|
||||
player.sendMessage(ChatColor.RED+"You don't have permission to run this.");
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
String coordinates = getCoordinates(player);
|
||||
|
||||
try {
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package fantasypvp.kand_smp.events;
|
||||
package fantasypvp.kand.events;
|
||||
|
||||
import fantasypvp.kand_smp.items.DashItem;
|
||||
import fantasypvp.kand.items.DashItem;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
@@ -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!");
|
||||
}
|
||||
}
|
||||
+16
-9
@@ -1,20 +1,14 @@
|
||||
package fantasypvp.kand_smp.events;
|
||||
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.event.entity.EntityPotionEffectEvent;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
|
||||
import static org.bukkit.Bukkit.*;
|
||||
|
||||
public class Events implements Listener {
|
||||
@EventHandler
|
||||
public static void onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event) {
|
||||
|
||||
getServer().broadcastMessage("§a" + event.getPlayer().getName() + " has joined the server!");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public static void onEntityDamageByEntity(org.bukkit.event.entity.EntityDamageByEntityEvent event) {
|
||||
@@ -23,10 +17,23 @@ public class Events implements Listener {
|
||||
Player player = (Player) event.getDamager();
|
||||
// check if the player is using the lightning sword
|
||||
|
||||
if (player.getInventory().getItemInMainHand().getItemMeta().getLore().toString().contains("§7All who oppose shall be smitten")) {
|
||||
player.getWorld().strikeLightning(event.getEntity().getLocation());
|
||||
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) {
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fantasypvp.kand_smp.items;
|
||||
package fantasypvp.kand.items;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package fantasypvp.kand_smp.items;
|
||||
package fantasypvp.kand.items;
|
||||
|
||||
import fantasypvp.kand_smp.util.attribute_gear.TierV;
|
||||
import fantasypvp.kand.util.attribute_gear.TierV;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.inventory.*;
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
+21
-13
@@ -1,5 +1,6 @@
|
||||
package fantasypvp.kand_smp.items;
|
||||
package fantasypvp.kand.items;
|
||||
|
||||
import fantasypvp.kand.util.attribute_gear.TierVI;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
@@ -9,6 +10,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
|
||||
@@ -27,25 +29,31 @@ public class LightningGear {
|
||||
lore.add("§7All who oppose shall be smitten");
|
||||
meta.setLore(lore);
|
||||
// set damage to 12 when in main hand
|
||||
meta.addAttributeModifier(
|
||||
Attribute.GENERIC_ATTACK_DAMAGE,
|
||||
new AttributeModifier(
|
||||
"generic.attackDamage",
|
||||
12,
|
||||
AttributeModifier.Operation.ADD_NUMBER
|
||||
)
|
||||
);
|
||||
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;
|
||||
|
||||
meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
|
||||
|
||||
// shaped recipe
|
||||
ShapedRecipe recipe = new ShapedRecipe(NamespacedKey.minecraft("lightning_sword"), item);
|
||||
recipe.shape(
|
||||
" X",
|
||||
" X ",
|
||||
"H "
|
||||
" X ",
|
||||
" H "
|
||||
);
|
||||
recipe.setIngredient('X', Material.NETHER_STAR);
|
||||
recipe.setIngredient('H', Material.LIGHTNING_ROD);
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package fantasypvp.kand_smp.items;
|
||||
package fantasypvp.kand.items;
|
||||
|
||||
import fantasypvp.kand_smp.util.attribute_gear.TierVI;
|
||||
import fantasypvp.kand.util.attribute_gear.TierVI;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
+6
-3
@@ -1,8 +1,11 @@
|
||||
package fantasypvp.kand_smp.items;
|
||||
package fantasypvp.kand.items;
|
||||
|
||||
import fantasypvp.kand_smp.util.attribute_gear.TierV;
|
||||
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;
|
||||
|
||||
@@ -11,7 +14,7 @@ import java.util.List;
|
||||
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
|
||||
public class Witherite {
|
||||
public class Witherite {
|
||||
public static ItemStack sword;
|
||||
public static ItemStack helmet;
|
||||
public static ItemStack chestplate;
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fantasypvp.kand_smp.util.attribute_gear;
|
||||
package fantasypvp.kand.util.attribute_gear;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
+3
-1
@@ -1,4 +1,4 @@
|
||||
package fantasypvp.kand_smp.util.attribute_gear;
|
||||
package fantasypvp.kand.util.attribute_gear;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
@@ -9,6 +9,8 @@ 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);
|
||||
+3
-1
@@ -1,4 +1,4 @@
|
||||
package fantasypvp.kand_smp.util.attribute_gear;
|
||||
package fantasypvp.kand.util.attribute_gear;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
@@ -9,6 +9,8 @@ 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);
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
package fantasypvp.kand_smp.util.attribute_gear;
|
||||
package fantasypvp.kand.util.attribute_gear;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
@@ -9,6 +9,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
// NETHERITE ARMOUR EQUIVALENT
|
||||
|
||||
public abstract class TierV extends TierBase {
|
||||
public static ItemStack sword () {
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
package fantasypvp.kand_smp.util.attribute_gear;
|
||||
package fantasypvp.kand.util.attribute_gear;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
@@ -9,6 +9,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
// STATS > NETHERITE
|
||||
|
||||
public abstract class TierVI extends TierBase {
|
||||
public static ItemStack sword () {
|
||||
@@ -1,41 +0,0 @@
|
||||
package fantasypvp.kand_smp;
|
||||
|
||||
import fantasypvp.kand_smp.commands.CmdLightningSword;
|
||||
import fantasypvp.kand_smp.commands.CmdTeleportSpawn;
|
||||
import fantasypvp.kand_smp.commands.GiveDashItemCommand;
|
||||
import fantasypvp.kand_smp.commands.SetSpawnCommand;
|
||||
import fantasypvp.kand_smp.events.DashItemListener;
|
||||
import fantasypvp.kand_smp.events.Events;
|
||||
import fantasypvp.kand_smp.items.DashItem;
|
||||
import fantasypvp.kand_smp.items.LightningGear;
|
||||
import fantasypvp.kand_smp.items.TrueNetherite;
|
||||
import fantasypvp.kand_smp.items.Witherite;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public final class Kand_smp extends JavaPlugin {
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
// Plugin startup logic
|
||||
LightningGear.init();
|
||||
TrueNetherite.init();
|
||||
Witherite.init();
|
||||
// register listeners
|
||||
getServer().getPluginManager().registerEvents(new Events(), this);
|
||||
getServer().getPluginManager().registerEvents(new DashItemListener(),this);
|
||||
|
||||
getCommand("lightning_sword").setExecutor(new CmdLightningSword());
|
||||
getCommand("spawn").setExecutor(new CmdTeleportSpawn(this));
|
||||
getCommand("setSpawnTp").setExecutor(new SetSpawnCommand(this));
|
||||
getCommand("dashstick").setExecutor(new GiveDashItemCommand());
|
||||
|
||||
|
||||
getServer().broadcastMessage("§aKand SMP has been enabled!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
// Plugin shutdown logic
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
name: kand_smp
|
||||
name: kand
|
||||
version: '${project.version}'
|
||||
main: fantasypvp.kand_smp.Kand_smp
|
||||
main: fantasypvp.kand.kandMain
|
||||
api-version: '1.20'
|
||||
commands:
|
||||
lightning_sword:
|
||||
@@ -9,21 +9,42 @@ commands:
|
||||
spawn:
|
||||
description: Spawn player
|
||||
usage: /spawn
|
||||
setSpawnTp:
|
||||
setglobalspawn:
|
||||
description: Sets the world spawn tp point
|
||||
usage: /setSpawnTp
|
||||
dashstick:
|
||||
description: gives the user a dash stick
|
||||
usage: /dashstick
|
||||
get_currency:
|
||||
description: get currency
|
||||
usage: /get_currency
|
||||
|
||||
|
||||
permissions:
|
||||
lightning_sword:
|
||||
kand.admin:
|
||||
description: provides access to all kand commands
|
||||
children:
|
||||
kand.lightning_sword: true
|
||||
kand.spawn: true
|
||||
kand.setglobalspawn: true
|
||||
kand.dashstick: true
|
||||
economy.*: true
|
||||
default: op
|
||||
kand.lightning_sword:
|
||||
description: Allows player to run /lightning_sword
|
||||
default: op
|
||||
setSpawnTp:
|
||||
description: allows player to run /setSpawnTp
|
||||
kand.setglobalspawn:
|
||||
description: Allows player to run /setglobalspawn
|
||||
default: op
|
||||
kand.spawn:
|
||||
description: allows player to teleport to spawn from anywhere in the world
|
||||
default: true
|
||||
giveDashItem:
|
||||
description: allows the player to run /dashstick
|
||||
default: op
|
||||
kand.economy.manage:
|
||||
description: Allows player to use economy commands
|
||||
default: op
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user