Files
LevelCraft/src/main/java/com/simolzimol/levelcraft/demo/DemoAugmentationSystem.java
SimolZimol 6517913eeb Implement complete Augmentation & Item Leveling System
Major Features Added:
- Complete Augmentation System with 17 augmentation types
- Item Leveling System with XP progression
- Player Level System with XP tracking
- Auto-Enhancement for all items (Level 1, no augmentations)
- Demo system with 10 pre-configured items
- Beautiful lore display with slot visualization
- Level-based slot unlocking system
- Legacy system cleanup and deactivation

New Commands:
- /augment (create, add, remove, info, levelup)
- /demo (1-10, all, random, list)
- /playerlevel (info, add, set)
- /convert (hand, all)

Technical Implementation:
- EnhancedItem class with NBT persistence
- AugmentationType enum with 17 types
- ItemLevelingSystem with XP curves
- PlayerLevelManager with progression
- Auto-enhancement listeners for all item sources
- Item leveling through usage (mining, combat, crafting)
- Rarity-based max levels and slot limits
2025-10-12 00:17:55 +02:00

213 lines
8.5 KiB
Java

package com.simolzimol.levelcraft.demo;
import com.simolzimol.levelcraft.augmentation.*;
import com.simolzimol.levelcraft.item.Rarity;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
/**
* Demo system for creating items with pre-configured augmentations
* This showcases the augmentation system with 10 different demo setups
*/
public class DemoAugmentationSystem {
private static final Random random = new Random();
/**
* Creates a list of 10 demo items with different augmentation setups
*/
public static List<ItemStack> createDemoItems() {
List<ItemStack> demoItems = new ArrayList<>();
// 1. Warrior's Sword - Combat focused
demoItems.add(createWarriorSword());
// 2. Guardian's Shield - Protection focused
demoItems.add(createGuardianShield());
// 3. Miner's Pickaxe - Utility focused
demoItems.add(createMinerPickaxe());
// 4. Assassin's Dagger - Critical strike focused
demoItems.add(createAssassinDagger());
// 5. Paladin's Hammer - Balanced combat/defense
demoItems.add(createPaladinHammer());
// 6. Hunter's Bow - Ranged combat
demoItems.add(createHunterBow());
// 7. Wizard's Staff - Magic focused
demoItems.add(createWizardStaff());
// 8. Survivor's Armor - Survival focused
demoItems.add(createSurvivorArmor());
// 9. Treasure Hunter's Tool - Luck focused
demoItems.add(createTreasureHunterTool());
// 10. Legendary All-Purpose Item - Mixed augmentations
demoItems.add(createLegendaryItem());
return demoItems;
}
private static ItemStack createWarriorSword() {
ItemStack sword = new ItemStack(Material.NETHERITE_SWORD);
EnhancedItem enhanced = new EnhancedItem(sword, Rarity.EPIC, 15);
enhanced.addAugmentation(new Augmentation(AugmentationType.SHARPNESS, 8));
enhanced.addAugmentation(new Augmentation(AugmentationType.CRITICAL_STRIKE, 4));
enhanced.addAugmentation(new Augmentation(AugmentationType.FIRE_ASPECT, 2));
return enhanced.getItemStack();
}
private static ItemStack createGuardianShield() {
ItemStack chestplate = new ItemStack(Material.DIAMOND_CHESTPLATE);
EnhancedItem enhanced = new EnhancedItem(chestplate, Rarity.RARE, 12);
enhanced.addAugmentation(new Augmentation(AugmentationType.PROTECTION, 5));
enhanced.addAugmentation(new Augmentation(AugmentationType.RESISTANCE, 3));
enhanced.addAugmentation(new Augmentation(AugmentationType.THORNS, 2));
return enhanced.getItemStack();
}
private static ItemStack createMinerPickaxe() {
ItemStack pickaxe = new ItemStack(Material.DIAMOND_PICKAXE);
EnhancedItem enhanced = new EnhancedItem(pickaxe, Rarity.RARE, 10);
enhanced.addAugmentation(new Augmentation(AugmentationType.EFFICIENCY, 7));
enhanced.addAugmentation(new Augmentation(AugmentationType.FORTUNE, 4));
enhanced.addAugmentation(new Augmentation(AugmentationType.UNBREAKING, 4));
return enhanced.getItemStack();
}
private static ItemStack createAssassinDagger() {
ItemStack dagger = new ItemStack(Material.IRON_SWORD);
EnhancedItem enhanced = new EnhancedItem(dagger, Rarity.UNCOMMON, 8);
enhanced.addAugmentation(new Augmentation(AugmentationType.CRITICAL_STRIKE, 5));
enhanced.addAugmentation(new Augmentation(AugmentationType.VAMPIRIC, 2));
enhanced.addAugmentation(new Augmentation(AugmentationType.SPEED, 1));
return enhanced.getItemStack();
}
private static ItemStack createPaladinHammer() {
ItemStack hammer = new ItemStack(Material.NETHERITE_AXE);
EnhancedItem enhanced = new EnhancedItem(hammer, Rarity.EPIC, 16);
enhanced.addAugmentation(new Augmentation(AugmentationType.SMITE, 6));
enhanced.addAugmentation(new Augmentation(AugmentationType.PROTECTION, 3));
enhanced.addAugmentation(new Augmentation(AugmentationType.REGENERATION, 2));
enhanced.addAugmentation(new Augmentation(AugmentationType.UNBREAKING, 3));
return enhanced.getItemStack();
}
private static ItemStack createHunterBow() {
ItemStack bow = new ItemStack(Material.BOW);
EnhancedItem enhanced = new EnhancedItem(bow, Rarity.RARE, 11);
enhanced.addAugmentation(new Augmentation(AugmentationType.SHARPNESS, 5)); // Represents Power
enhanced.addAugmentation(new Augmentation(AugmentationType.CRITICAL_STRIKE, 3));
enhanced.addAugmentation(new Augmentation(AugmentationType.MENDING, 1));
return enhanced.getItemStack();
}
private static ItemStack createWizardStaff() {
ItemStack staff = new ItemStack(Material.BLAZE_ROD);
EnhancedItem enhanced = new EnhancedItem(staff, Rarity.LEGENDARY, 18);
enhanced.addAugmentation(new Augmentation(AugmentationType.CHAIN_LIGHTNING, 2));
enhanced.addAugmentation(new Augmentation(AugmentationType.FIRE_ASPECT, 3));
enhanced.addAugmentation(new Augmentation(AugmentationType.REGENERATION, 2));
enhanced.addAugmentation(new Augmentation(AugmentationType.MENDING, 1));
return enhanced.getItemStack();
}
private static ItemStack createSurvivorArmor() {
ItemStack armor = new ItemStack(Material.CHAINMAIL_HELMET);
EnhancedItem enhanced = new EnhancedItem(armor, Rarity.UNCOMMON, 7);
enhanced.addAugmentation(new Augmentation(AugmentationType.PROTECTION, 4));
enhanced.addAugmentation(new Augmentation(AugmentationType.REGENERATION, 1));
enhanced.addAugmentation(new Augmentation(AugmentationType.UNBREAKING, 3));
return enhanced.getItemStack();
}
private static ItemStack createTreasureHunterTool() {
ItemStack shovel = new ItemStack(Material.GOLDEN_SHOVEL);
EnhancedItem enhanced = new EnhancedItem(shovel, Rarity.RARE, 9);
enhanced.addAugmentation(new Augmentation(AugmentationType.FORTUNE, 5));
enhanced.addAugmentation(new Augmentation(AugmentationType.EFFICIENCY, 6));
enhanced.addAugmentation(new Augmentation(AugmentationType.SILK_TOUCH, 1));
return enhanced.getItemStack();
}
private static ItemStack createLegendaryItem() {
ItemStack item = new ItemStack(Material.NETHERITE_HELMET);
EnhancedItem enhanced = new EnhancedItem(item, Rarity.LEGENDARY, 20);
// Fill all slots with different augmentations
enhanced.addAugmentation(new Augmentation(AugmentationType.PROTECTION, 5));
enhanced.addAugmentation(new Augmentation(AugmentationType.RESISTANCE, 3));
enhanced.addAugmentation(new Augmentation(AugmentationType.REGENERATION, 3));
enhanced.addAugmentation(new Augmentation(AugmentationType.SPEED, 2));
enhanced.addAugmentation(new Augmentation(AugmentationType.UNBREAKING, 5));
enhanced.addAugmentation(new Augmentation(AugmentationType.MENDING, 1));
return enhanced.getItemStack();
}
/**
* Creates a random demo item from the available templates
*/
public static ItemStack createRandomDemoItem() {
List<ItemStack> demoItems = createDemoItems();
return demoItems.get(random.nextInt(demoItems.size())).clone();
}
/**
* Gets a specific demo item by index (0-9)
*/
public static ItemStack getDemoItem(int index) {
if (index < 0 || index >= 10) {
throw new IllegalArgumentException("Demo item index must be between 0 and 9");
}
List<ItemStack> demoItems = createDemoItems();
return demoItems.get(index).clone();
}
/**
* Gets the name of a demo item by index
*/
public static String getDemoItemName(int index) {
String[] names = {
"Warrior's Sword", "Guardian's Shield", "Miner's Pickaxe",
"Assassin's Dagger", "Paladin's Hammer", "Hunter's Bow",
"Wizard's Staff", "Survivor's Armor", "Treasure Hunter's Tool",
"Legendary All-Purpose Item"
};
if (index < 0 || index >= names.length) {
return "Unknown Demo Item";
}
return names[index];
}
}