change the docs and some class things
This commit is contained in:
parent
e6ea2a59cb
commit
4613ef6bcb
13 changed files with 99 additions and 5 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -9,6 +9,7 @@ api/
|
|||
libs/
|
||||
*.iml
|
||||
|
||||
gradle-wrapper.properties
|
||||
.gradle/
|
||||
|
||||
*.lock
|
||||
|
@ -125,3 +126,4 @@ buildNumber.properties
|
|||
# Common working directory
|
||||
run/
|
||||
/.gradle/
|
||||
/gradle/
|
||||
|
|
|
@ -5,9 +5,9 @@ Minecraft Plugin that do multiple stuff.
|
|||
|
||||
## Future of the Plugin/to do
|
||||
|
||||
![Schema of Raxen](./main.svg)
|
||||
![Schema of Raxen](docs/main.svg)
|
||||
|
||||
[FUTURE.md](/FUTURE.md)
|
||||
[FUTURE.md](/docs/FUTURE.md)
|
||||
|
||||
## Installing
|
||||
|
||||
|
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
@ -0,0 +1,54 @@
|
|||
package gq.unurled.raxen.components.items.custom.weapon;
|
||||
|
||||
import de.tr7zw.nbtapi.NBTItem;
|
||||
import gq.unurled.raxen.Raxen;
|
||||
import lombok.Getter;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static gq.unurled.raxen.components.items.NBT.*;
|
||||
import static gq.unurled.raxen.utils.Utils.color;
|
||||
|
||||
public class Dager {
|
||||
|
||||
private Raxen main;
|
||||
|
||||
@Getter
|
||||
ItemStack dager;
|
||||
|
||||
public void buildItem() {
|
||||
dager = new ItemStack(Material.IRON_SWORD);
|
||||
ItemMeta itm = dager.getItemMeta();
|
||||
itm.displayName(Component.text(color("&bDager")));
|
||||
itm.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
|
||||
itm.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_ENCHANTS);
|
||||
itm.setUnbreakable(true);
|
||||
List<Component> lore = new ArrayList<>();
|
||||
lore.add(Component.text("hallooo"));
|
||||
itm.lore(lore);
|
||||
dager.setItemMeta(itm);
|
||||
NBTItem nbti = new NBTItem(dager);
|
||||
nbti.setString(ID, "DAGER");
|
||||
nbti.setInteger(SPEED, 100);
|
||||
nbti.setInteger(STRENGTH, 50);
|
||||
nbti.setString(CUSTOM_ABILITY, "throwing_dager");
|
||||
nbti.setDouble(DROP_RATE, 50.0);
|
||||
dager = nbti.getItem();
|
||||
}
|
||||
|
||||
/**
|
||||
* need Raxen main to be set before calling this method.
|
||||
*/
|
||||
public void register() {
|
||||
main.getItemManager().registerItem(dager);
|
||||
}
|
||||
|
||||
}
|
|
@ -17,11 +17,14 @@ public class Class {
|
|||
String ID;
|
||||
@Getter
|
||||
ItemStack placeHolder;
|
||||
@Getter
|
||||
Integer max_level;
|
||||
|
||||
public Class(String name, String colorName, String ID, String itemPlaceHolder) {
|
||||
public Class(String name, String colorName, String ID, String itemPlaceHolder, Integer max_level) {
|
||||
this.name = name;
|
||||
this.ID = ID;
|
||||
this.placeHolder = new ItemStack(Material.getMaterial(itemPlaceHolder));
|
||||
this.placeHolder.getItemMeta().displayName(Component.text(color(colorName)));
|
||||
this.max_level = max_level;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,6 +75,12 @@ public class Classes {
|
|||
public resultClass registerClass(FileConfiguration file) {
|
||||
String id = file.getString("id");
|
||||
debug(id);
|
||||
return new resultClass(new Class(file.getString("name"), file.getString("color-name"), id, file.getString("item_placeholder")), id);
|
||||
return new resultClass(new Class(file.getString("name"), file.getString("color-name"), id, file.getString("item_placeholder"), file.getInt("max_level")), id);
|
||||
}
|
||||
|
||||
public void registerClass(Class clas) {
|
||||
debug(clas.getID());
|
||||
resultClass result = new resultClass(clas, clas.getID());
|
||||
classes.put(result.getId(), result.getClas());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package gq.unurled.raxen.components.player.classes.list;
|
||||
|
||||
import gq.unurled.raxen.components.items.custom.weapon.Dager;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class Assassin {
|
||||
String ID = "ASSASSIN";
|
||||
String name = "Assassin";
|
||||
String colorName = "&cAssassin";
|
||||
Integer max_level = 100;
|
||||
|
||||
ItemStack placeHolder;
|
||||
|
||||
public Assassin() {
|
||||
Dager dager = new Dager();
|
||||
dager.buildItem();
|
||||
placeHolder = dager.getDager();
|
||||
}
|
||||
}
|
|
@ -132,4 +132,14 @@ public class ItemManager {
|
|||
it = setLoreFromNBT(it);
|
||||
list.put(file.getString("customId"), it);
|
||||
}
|
||||
|
||||
/**
|
||||
* register Item into the custom item list
|
||||
* Need that the Itm is already set with custom nbt!
|
||||
* @param itm an ItemStack with already set custom nbt using NBTapi
|
||||
*/
|
||||
public void registerItem(ItemStack itm) {
|
||||
NBTItem it = new NBTItem(itm);
|
||||
list.put(it.getString("ID"), itm);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue