first commit

This commit is contained in:
Patrick
2026-05-01 19:04:16 +02:00
commit 3201c67fd5
62 changed files with 4128 additions and 0 deletions
@@ -0,0 +1,60 @@
package de.winniepat.kingdomClashSurvival.items;
import de.winniepat.kingdomClashSurvival.util.ColorUtil;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextDecoration;
import de.winniepat.kingdomClashSurvival.KingdomClashSurvival;
import java.util.Arrays;
public class PlayerTracker {
public static final ItemStack PLAYER_TRACKER = createHunterEye();
public static final NamespacedKey KEY = new NamespacedKey(KingdomClashSurvival.instance, "player_tracker");
private static ItemStack createHunterEye() {
ItemStack item = new ItemStack(Material.ENDER_PEARL);
ItemMeta meta = item.getItemMeta();
TextComponent name = Component.text("ᴘʟᴀʏᴇʀ ᴛʀᴀᴄᴋᴇʀ")
.color(NamedTextColor.DARK_PURPLE)
.decorate(TextDecoration.BOLD);
meta.displayName(name);
meta.lore(Arrays.asList(
Component.text(""),
Component.text("Right-Click to reveal nearby players.")
.color(NamedTextColor.GRAY),
Component.text("Cooldown: 3 Minutes")
.color(NamedTextColor.RED),
Component.text("")
));
meta.setEnchantmentGlintOverride(true);
meta.setCustomModelData(1);
item.setItemMeta(meta);
return item;
}
public static ShapedRecipe getRecipe() {
ShapedRecipe recipe = new ShapedRecipe(KEY, PLAYER_TRACKER);
recipe.shape(
"DDD",
"DCD",
"DDD");
recipe.setIngredient('C', Material.COMPASS);
recipe.setIngredient('D', Material.DIAMOND_BLOCK);
return recipe;
}
}
@@ -0,0 +1,87 @@
package de.winniepat.kingdomClashSurvival.items;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextDecoration;
import de.winniepat.kingdomClashSurvival.KingdomClashSurvival;
import java.util.Arrays;
public class VillageBlessing {
private final KingdomClashSurvival plugin;
public static NamespacedKey KEY = null;
private final NamespacedKey TAG_IS_BLESSING;
private final ItemStack BLESSING_ITEM;
public VillageBlessing(KingdomClashSurvival plugin) {
this.plugin = plugin;
KEY = new NamespacedKey(plugin, "village_blessing");
this.TAG_IS_BLESSING = new NamespacedKey(plugin, "is_blessing_bell");
this.BLESSING_ITEM = createBlessingItem();
}
public NamespacedKey getKey() {
return KEY;
}
public NamespacedKey getTagIsBlessing() {
return TAG_IS_BLESSING;
}
public ItemStack getBlessingItem() {
return BLESSING_ITEM;
}
private ItemStack createBlessingItem() {
ItemStack item = new ItemStack(Material.BELL);
ItemMeta meta = item.getItemMeta();
TextComponent name = Component.text("ᴠɪʟʟᴀɢᴇ ʙʟᴇꜱꜱɪɴɢ ʙᴇʟʟ")
.color(NamedTextColor.GOLD)
.decorate(TextDecoration.BOLD);
meta.displayName(name);
meta.lore(Arrays.asList(
Component.text(""),
Component.text("Right-Click to gain the Hero of the Village effect.")
.color(NamedTextColor.GRAY),
Component.text("Duration: 5 Minutes")
.color(NamedTextColor.GREEN),
Component.text("Cooldown: 30 Minutes")
.color(NamedTextColor.RED),
Component.text("")
));
meta.getPersistentDataContainer().set(this.TAG_IS_BLESSING, PersistentDataType.BYTE, (byte) 1);
meta.setEnchantmentGlintOverride(true);
item.setItemMeta(meta);
return item;
}
public ShapedRecipe getRecipe() {
ShapedRecipe recipe = new ShapedRecipe(this.KEY, this.BLESSING_ITEM);
recipe.shape(
"EEE",
"EBE",
"EEE"
);
recipe.setIngredient('E', Material.EMERALD_BLOCK);
recipe.setIngredient('B', Material.BELL);
return recipe;
}
}