not finished, tried to make entity with custom skin + bug patches
This commit is contained in:
parent
559bead7d8
commit
b935c6fee6
25 changed files with 442 additions and 113 deletions
10
build.gradle
10
build.gradle
|
@ -16,28 +16,22 @@ repositories {
|
||||||
maven {
|
maven {
|
||||||
url = uri('https://papermc.io/repo/repository/maven-public/')
|
url = uri('https://papermc.io/repo/repository/maven-public/')
|
||||||
}
|
}
|
||||||
|
|
||||||
maven {
|
maven {
|
||||||
url = uri('https://oss.sonatype.org/content/groups/public/')
|
url = uri('https://oss.sonatype.org/content/groups/public/')
|
||||||
}
|
}
|
||||||
|
|
||||||
maven {
|
maven {
|
||||||
name = 'CodeMC'
|
name = 'CodeMC'
|
||||||
url = 'https://repo.codemc.org/repository/maven-public/'
|
url = 'https://repo.codemc.org/repository/maven-public/'
|
||||||
}
|
}
|
||||||
|
|
||||||
maven {
|
maven {
|
||||||
url = uri('https://repo.dmulloy2.net/repository/public/')
|
url = uri('https://repo.dmulloy2.net/repository/public/')
|
||||||
}
|
}
|
||||||
|
|
||||||
maven {
|
maven {
|
||||||
url = uri('https://repo.essentialsx.net/releases/')
|
url = uri('https://repo.essentialsx.net/releases/')
|
||||||
}
|
}
|
||||||
|
|
||||||
maven {
|
maven {
|
||||||
url = uri('https://s01.oss.sonatype.org/content/repositories/snapshots/')
|
url = uri('https://s01.oss.sonatype.org/content/repositories/snapshots/')
|
||||||
}
|
}
|
||||||
|
|
||||||
maven {
|
maven {
|
||||||
url = uri('https://repo.maven.apache.org/maven2/')
|
url = uri('https://repo.maven.apache.org/maven2/')
|
||||||
}
|
}
|
||||||
|
@ -65,7 +59,7 @@ dependencies {
|
||||||
implementation 'org.mongodb:mongodb-driver-core:4.7.2'
|
implementation 'org.mongodb:mongodb-driver-core:4.7.2'
|
||||||
|
|
||||||
implementation 'de.tr7zw:item-nbt-api-plugin:2.10.0'
|
implementation 'de.tr7zw:item-nbt-api-plugin:2.10.0'
|
||||||
compileOnly 'io.papermc.paper:paper-api:1.19.2-R0.1-SNAPSHOT'
|
compileOnly 'io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT'
|
||||||
compileOnly 'com.comphenix.protocol:ProtocolLib:4.8.0'
|
compileOnly 'com.comphenix.protocol:ProtocolLib:4.8.0'
|
||||||
compileOnly 'net.luckperms:api:5.4'
|
compileOnly 'net.luckperms:api:5.4'
|
||||||
compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1'
|
compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1'
|
||||||
|
@ -80,7 +74,7 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
group = 'me.unurled'
|
group = 'me.unurled'
|
||||||
version = '0.5.5'
|
version = '0.5.6'
|
||||||
description = 'Raxen'
|
description = 'Raxen'
|
||||||
|
|
||||||
java {
|
java {
|
||||||
|
|
|
@ -18,7 +18,7 @@ import static me.unurled.raxen.utils.Utils.colorComp;
|
||||||
public final class Raxen extends JavaPlugin {
|
public final class Raxen extends JavaPlugin {
|
||||||
|
|
||||||
private static final String prefix = "<aqua>Rx</aqua><light_purple>></light_purple> ";
|
private static final String prefix = "<aqua>Rx</aqua><light_purple>></light_purple> ";
|
||||||
@Getter private static String version = "0.5.5";
|
@Getter private static String version = "0.5.6";
|
||||||
private final PluginManager pm = getServer().getPluginManager();
|
private final PluginManager pm = getServer().getPluginManager();
|
||||||
|
|
||||||
private static Raxen plugin;
|
private static Raxen plugin;
|
||||||
|
|
|
@ -53,8 +53,8 @@ public class NbtCommand implements TabExecutor {
|
||||||
a = nbti.getInteger(args[1]);
|
a = nbti.getInteger(args[1]);
|
||||||
}
|
}
|
||||||
List<Component> lore = new ArrayList<>();
|
List<Component> lore = new ArrayList<>();
|
||||||
ItemMeta itm = it.getItemMeta();
|
// ItemMeta itm = it.getItemMeta();
|
||||||
lore.add((Component) itm.lore());
|
// lore.add((Component) itm.lore());
|
||||||
boolean yes = false;
|
boolean yes = false;
|
||||||
boolean ever = false;
|
boolean ever = false;
|
||||||
for (Component ct : lore) {
|
for (Component ct : lore) {
|
||||||
|
@ -74,8 +74,8 @@ public class NbtCommand implements TabExecutor {
|
||||||
lore.add(colorTextComp("<red>Attributes:"));
|
lore.add(colorTextComp("<red>Attributes:"));
|
||||||
//lore.add(colorTextComp(attributes(args[0]) + ": " + (Integer.parseInt(args[1]) + a))); deprecated
|
//lore.add(colorTextComp(attributes(args[0]) + ": " + (Integer.parseInt(args[1]) + a))); deprecated
|
||||||
}
|
}
|
||||||
itm.lore(lore);
|
// itm.lore(lore);
|
||||||
it.setItemMeta(itm);
|
// it.setItemMeta(itm);
|
||||||
PlayerManager pm = ((Raxen) Objects.requireNonNull(Bukkit.getPluginManager().getPlugin("Raxen"))).getManager().getPlayerManager();
|
PlayerManager pm = ((Raxen) Objects.requireNonNull(Bukkit.getPluginManager().getPlugin("Raxen"))).getManager().getPlayerManager();
|
||||||
nbti.setInteger(args[0], Integer.parseInt(args[1]) + a);
|
nbti.setInteger(args[0], Integer.parseInt(args[1]) + a);
|
||||||
if (nbti.hasKey("SPEED")) {
|
if (nbti.hasKey("SPEED")) {
|
||||||
|
|
|
@ -31,6 +31,14 @@ public class Attribute {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gives the name uppercased
|
||||||
|
* @return the name in uppercase
|
||||||
|
*/
|
||||||
|
public String nameUppercase() {
|
||||||
|
return name.toUpperCase();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get how many the Entity has Attributed
|
* get how many the Entity has Attributed
|
||||||
* @param entity a living entity
|
* @param entity a living entity
|
||||||
|
|
|
@ -4,10 +4,14 @@ import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import me.unurled.raxen.Raxen;
|
import me.unurled.raxen.Raxen;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import static me.unurled.raxen.utils.Utils.colorString;
|
import static me.unurled.raxen.utils.Utils.colorString;
|
||||||
|
|
||||||
public class Entity {
|
public class Entity {
|
||||||
|
|
||||||
|
private java.util.UUID uuid;
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
@Getter
|
@Getter
|
||||||
private Integer level;
|
private Integer level;
|
||||||
|
@ -38,6 +42,7 @@ public class Entity {
|
||||||
this.speed = speed;
|
this.speed = speed;
|
||||||
this.maxHealth = maxHealth;
|
this.maxHealth = maxHealth;
|
||||||
this.isHostile = isHostile;
|
this.isHostile = isHostile;
|
||||||
|
this.uuid = UUID.randomUUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void register (Raxen main) {
|
public void register (Raxen main) {
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
package me.unurled.raxen.components.entity.other.custom;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class Humanoid extends Entity {
|
||||||
|
|
||||||
|
private String skin; // used to get the path to the skin
|
||||||
|
private UUID skinUuid; // used to get the player skin (if i do it this way...
|
||||||
|
|
||||||
|
public Humanoid(String name, Integer level, Double maxHealth, Double strength, Double defense, Double speed, boolean isHostile, String skin, UUID skinUuid) {
|
||||||
|
super(name, level, maxHealth, strength, defense, speed, isHostile);
|
||||||
|
this.skin = skin;
|
||||||
|
this.skinUuid = skinUuid;
|
||||||
|
}
|
||||||
|
}
|
|
@ -68,8 +68,7 @@ public class RaxenPlayer {
|
||||||
PersistentDataContainer data = player.getPersistentDataContainer();
|
PersistentDataContainer data = player.getPersistentDataContainer();
|
||||||
String inv = data.get(namespacedKey.inventory, PersistentDataType.STRING);
|
String inv = data.get(namespacedKey.inventory, PersistentDataType.STRING);
|
||||||
org.bukkit.inventory.Inventory invv = Bukkit.createInventory(player, InventoryType.PLAYER);
|
org.bukkit.inventory.Inventory invv = Bukkit.createInventory(player, InventoryType.PLAYER);
|
||||||
PlayerInventory invvvvv = (PlayerInventory) Bukkit.createInventory(null, InventoryType.PLAYER);
|
invv = setItemsToInventory(Items.listItemStackDeserialize(inv), (PlayerInventory) invv);
|
||||||
invv = setItemsToInventory(Items.listItemStackDeserialize(inv), invvvvv);
|
|
||||||
Inventory invvv = new Inventory(invv);
|
Inventory invvv = new Inventory(invv);
|
||||||
Inventories invvvv = new Inventories(invvv);
|
Inventories invvvv = new Inventories(invvv);
|
||||||
return invvvv;
|
return invvvv;
|
||||||
|
|
|
@ -6,6 +6,8 @@ import me.unurled.raxen.manager.entity.PlayerManager;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class Attributes {
|
public class Attributes {
|
||||||
|
|
||||||
|
@ -15,7 +17,8 @@ public class Attributes {
|
||||||
namespacedKey = new EntityNamespacedKey(main);
|
namespacedKey = new EntityNamespacedKey(main);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Attribute getAttribute(Player player) {
|
@Contract("_ -> new")
|
||||||
|
public static @NotNull Attribute getAttribute(Player player) {
|
||||||
int maxHealth, health, itemHealth, defense, itemDefense, speed, itemSpeed, strength, itemStrength, maxMana, mana, itemMana, luck, itemLuck;
|
int maxHealth, health, itemHealth, defense, itemDefense, speed, itemSpeed, strength, itemStrength, maxMana, mana, itemMana, luck, itemLuck;
|
||||||
PlayerManager pm = ((Raxen) Bukkit.getPluginManager().getPlugin("Raxen")).getManager().getPlayerManager();
|
PlayerManager pm = ((Raxen) Bukkit.getPluginManager().getPlugin("Raxen")).getManager().getPlayerManager();
|
||||||
Entity e = player;
|
Entity e = player;
|
||||||
|
@ -54,4 +57,9 @@ public class Attributes {
|
||||||
pm.getItemSpeed().set(e, itemSpeed);
|
pm.getItemSpeed().set(e, itemSpeed);
|
||||||
pm.getItemMana().set(e, itemMana);
|
pm.getItemMana().set(e, itemMana);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String[] getNameList() {
|
||||||
|
return new String[]{"Defense", "Health", "Luck", "Mana", "Speed", "Strength"};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package me.unurled.raxen.components.entity.player.classes.list;
|
package me.unurled.raxen.components.entity.player.classes.list;
|
||||||
|
|
||||||
import me.unurled.raxen.components.entity.player.classes.Class;
|
import me.unurled.raxen.components.entity.player.classes.Class;
|
||||||
import me.unurled.raxen.components.items.custom.weapon.Dager;
|
import me.unurled.raxen.components.items.custom.weapon.Dagger;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
@ -16,9 +16,9 @@ public class Assassin extends Class {
|
||||||
|
|
||||||
public Assassin() {
|
public Assassin() {
|
||||||
super("Assassin", "<red>Assassin", "ASSASSIN", new ItemStack(Material.AIR), 100);
|
super("Assassin", "<red>Assassin", "ASSASSIN", new ItemStack(Material.AIR), 100);
|
||||||
Dager dager = new Dager();
|
Dagger dagger = new Dagger();
|
||||||
dager.buildItem();
|
dagger.buildItem();
|
||||||
placeHolder = dager.getDager();
|
placeHolder = dagger.getItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Assassin(String name, String colorName, String ID, String itemPlaceHolder, Integer max_level) {
|
public Assassin(String name, String colorName, String ID, String itemPlaceHolder, Integer max_level) {
|
||||||
|
|
|
@ -3,8 +3,12 @@ package me.unurled.raxen.components.gui;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import me.unurled.raxen.Raxen;
|
import me.unurled.raxen.Raxen;
|
||||||
import me.unurled.raxen.components.entity.player.PlayerUtils;
|
import me.unurled.raxen.components.entity.player.PlayerUtils;
|
||||||
|
import me.unurled.raxen.utils.Utils;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
|
import net.kyori.adventure.text.TextComponent;
|
||||||
|
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
@ -163,7 +167,8 @@ public class ItemListGui implements Listener {
|
||||||
//previous
|
//previous
|
||||||
if (e.getCurrentItem() != GREY_PANE) {
|
if (e.getCurrentItem() != GREY_PANE) {
|
||||||
ItemStack pagee = einv.getItem(49);
|
ItemStack pagee = einv.getItem(49);
|
||||||
Integer page = Integer.parseInt(pagee.displayName().toString().replace("page", ""));
|
String name = ChatColor.stripColor(ChatColor.translateAlternateColorCodes('&',Utils.textCompToString(pagee.displayName())));
|
||||||
|
Integer page = Integer.parseInt(name.toString().replace("page", ""));
|
||||||
switch(page) {
|
switch(page) {
|
||||||
case 2:
|
case 2:
|
||||||
player.openInventory(inv);
|
player.openInventory(inv);
|
||||||
|
@ -189,7 +194,12 @@ public class ItemListGui implements Listener {
|
||||||
} else if (slot == 50) {
|
} else if (slot == 50) {
|
||||||
//next
|
//next
|
||||||
ItemStack pagee = einv.getItem(49);
|
ItemStack pagee = einv.getItem(49);
|
||||||
Integer page = Integer.parseInt(pagee.displayName().toString().replace("page", ""));
|
if (pagee != null) {
|
||||||
|
String name = ChatColor.stripColor(ChatColor.translateAlternateColorCodes('&',Utils.textCompToString(pagee.displayName())));
|
||||||
|
name = name.replace("[", "");
|
||||||
|
name = name.replace("]", "");
|
||||||
|
log(name);
|
||||||
|
Integer page = Integer.parseInt(name.replace("page", ""));
|
||||||
switch (page) {
|
switch (page) {
|
||||||
case 1:
|
case 1:
|
||||||
player.openInventory(inv2);
|
player.openInventory(inv2);
|
||||||
|
@ -208,6 +218,7 @@ public class ItemListGui implements Listener {
|
||||||
case 8:
|
case 8:
|
||||||
player.openInventory(inv9);
|
player.openInventory(inv9);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (slot == 53) {
|
} else if (slot == 53) {
|
||||||
//close
|
//close
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
package me.unurled.raxen.components.items.abilities.weapon;
|
||||||
|
|
||||||
|
import me.unurled.raxen.utils.RayTrace;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.util.BoundingBox;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class ThrowingDagger {
|
||||||
|
|
||||||
|
Player player;
|
||||||
|
ItemStack item;
|
||||||
|
Location start;
|
||||||
|
|
||||||
|
public ThrowingDagger(Player p) {
|
||||||
|
this.player = p;
|
||||||
|
this.item = p.getActiveItem();
|
||||||
|
this.start = p.getLocation();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void throwDagger() {
|
||||||
|
// ability throw a dagger in the direction the player is looking, max 20 blocks
|
||||||
|
RayTrace rayTrace = new RayTrace(player.getEyeLocation().toVector(),player.getEyeLocation().getDirection());
|
||||||
|
ArrayList<Vector> positions = rayTrace.traverse(10,0.01);
|
||||||
|
for(int i = 0; i < positions.size();i++){
|
||||||
|
|
||||||
|
Location position = positions.get(i).toLocation(player.getWorld());
|
||||||
|
Block block = player.getWorld().getBlockAt(position);
|
||||||
|
|
||||||
|
if(block != null && block.getType() != Material.AIR && rayTrace.intersects(BoundingBox.of(block),10,0.01)){
|
||||||
|
player.sendMessage(block.getType().toString());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/*for (int i = 0 ; i < 20 ; i++) {
|
||||||
|
// spawn an item in air
|
||||||
|
// dispawn the last one
|
||||||
|
// repeat
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +1,32 @@
|
||||||
package me.unurled.raxen.components.items.custom;
|
package me.unurled.raxen.components.items.custom;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
import me.unurled.raxen.Raxen;
|
import me.unurled.raxen.Raxen;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public interface Item {
|
public abstract class Item {
|
||||||
|
|
||||||
public void buildItem();
|
@Getter
|
||||||
|
ItemStack item;
|
||||||
|
|
||||||
public void registerItem(Raxen main);
|
String NAME;
|
||||||
|
String ID;
|
||||||
|
|
||||||
|
ItemClass ITEM_CLASS;
|
||||||
|
ItemTypes ITEM_TYPES;
|
||||||
|
|
||||||
|
protected Item() {
|
||||||
|
this.item = buildItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract ItemStack buildItem();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* need item to be set before calling this method.
|
||||||
|
*/
|
||||||
|
public void registerItem(@NotNull Raxen main) {
|
||||||
|
main.getManager().getItemManager().registerItem(item);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package me.unurled.raxen.components.items.custom;
|
||||||
|
|
||||||
|
public enum ItemClass {
|
||||||
|
F,
|
||||||
|
E,
|
||||||
|
D,
|
||||||
|
C,
|
||||||
|
B,
|
||||||
|
A,
|
||||||
|
S,
|
||||||
|
SS,
|
||||||
|
SSS,
|
||||||
|
MYTHIC,
|
||||||
|
UNIC,
|
||||||
|
GOD,
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package me.unurled.raxen.components.items.custom;
|
||||||
|
|
||||||
|
public enum ItemTypes {
|
||||||
|
WEAPON,
|
||||||
|
BOW,
|
||||||
|
TOOLS,
|
||||||
|
MEDICINE,
|
||||||
|
ARMOR,
|
||||||
|
BLOCKS,
|
||||||
|
MISCELLANEOUS
|
||||||
|
}
|
|
@ -2,7 +2,7 @@ package me.unurled.raxen.components.items.custom;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import me.unurled.raxen.Raxen;
|
import me.unurled.raxen.Raxen;
|
||||||
import me.unurled.raxen.components.items.custom.weapon.Dager;
|
import me.unurled.raxen.components.items.custom.weapon.Dagger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
@ -16,11 +16,11 @@ public class List {
|
||||||
public List(Raxen main) {
|
public List(Raxen main) {
|
||||||
this.main = main;
|
this.main = main;
|
||||||
this.items = new ArrayList<>();
|
this.items = new ArrayList<>();
|
||||||
|
build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void build() {
|
public void build() {
|
||||||
// weapons
|
// weapons
|
||||||
items.add(new Dager());
|
items.add(new Dagger());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
package me.unurled.raxen.components.items.custom.weapon;
|
|
||||||
|
|
||||||
import de.tr7zw.nbtapi.NBTItem;
|
|
||||||
import lombok.Getter;
|
|
||||||
import me.unurled.raxen.Raxen;
|
|
||||||
import me.unurled.raxen.components.items.custom.Item;
|
|
||||||
import net.kyori.adventure.text.Component;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
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 me.unurled.raxen.components.items.NBT.*;
|
|
||||||
import static me.unurled.raxen.utils.Utils.colorTextComp;
|
|
||||||
|
|
||||||
public class Dager implements Item {
|
|
||||||
@Getter
|
|
||||||
ItemStack dager;
|
|
||||||
|
|
||||||
public void buildItem() {
|
|
||||||
dager = new ItemStack(Material.IRON_SWORD);
|
|
||||||
ItemMeta itm = dager.getItemMeta();
|
|
||||||
itm.displayName(colorTextComp("<aqua>Dager"));
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void registerItem(Raxen main) {
|
|
||||||
main.getManager().getItemManager().registerItem(dager);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
package me.unurled.raxen.components.items.custom.weapon;
|
||||||
|
|
||||||
|
import de.tr7zw.nbtapi.NBTItem;
|
||||||
|
import lombok.Getter;
|
||||||
|
import me.unurled.raxen.components.items.NBT;
|
||||||
|
import me.unurled.raxen.components.items.custom.Item;
|
||||||
|
import me.unurled.raxen.components.items.custom.ItemClass;
|
||||||
|
import me.unurled.raxen.components.items.custom.ItemTypes;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
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 me.unurled.raxen.utils.Utils.colorTextComp;
|
||||||
|
|
||||||
|
public class Dagger extends Item {
|
||||||
|
@Getter
|
||||||
|
ItemStack item;
|
||||||
|
|
||||||
|
String NAME = "Dager";
|
||||||
|
String ID = "DAGER";
|
||||||
|
|
||||||
|
ItemClass ITEM_CLASS = ItemClass.F;
|
||||||
|
ItemTypes ITEM_TYPES = ItemTypes.WEAPON;
|
||||||
|
|
||||||
|
public ItemStack buildItem() {
|
||||||
|
item = new ItemStack(Material.IRON_SWORD);
|
||||||
|
ItemMeta itm = item.getItemMeta();
|
||||||
|
itm.displayName(colorTextComp("<aqua>" + this.NAME));
|
||||||
|
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);
|
||||||
|
item.setItemMeta(itm);
|
||||||
|
NBTItem nbti = new NBTItem(item);
|
||||||
|
nbti.setString(NBT.ID, ID);
|
||||||
|
nbti.setInteger(NBT.SPEED, 100);
|
||||||
|
nbti.setInteger(NBT.STRENGTH, 50);
|
||||||
|
nbti.setString(NBT.CUSTOM_ABILITY, "throwing_dager");
|
||||||
|
nbti.setDouble(NBT.DROP_RATE, 50.0);
|
||||||
|
item = nbti.getItem();
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ package me.unurled.raxen.listener.player;
|
||||||
|
|
||||||
import de.tr7zw.nbtapi.NBTItem;
|
import de.tr7zw.nbtapi.NBTItem;
|
||||||
import me.unurled.raxen.Raxen;
|
import me.unurled.raxen.Raxen;
|
||||||
|
import me.unurled.raxen.components.entity.Attributes.Attribute;
|
||||||
import me.unurled.raxen.components.entity.player.PlayerUtils;
|
import me.unurled.raxen.components.entity.player.PlayerUtils;
|
||||||
import me.unurled.raxen.components.entity.player.attributes.Attributes;
|
import me.unurled.raxen.components.entity.player.attributes.Attributes;
|
||||||
import me.unurled.raxen.manager.entity.PlayerManager;
|
import me.unurled.raxen.manager.entity.PlayerManager;
|
||||||
|
@ -14,6 +15,10 @@ import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerItemHeldEvent;
|
import org.bukkit.event.player.PlayerItemHeldEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
|
||||||
|
import static me.unurled.raxen.utils.Utils.debug;
|
||||||
|
|
||||||
public class ItemHandEvent implements Listener {
|
public class ItemHandEvent implements Listener {
|
||||||
|
|
||||||
private Raxen main;
|
private Raxen main;
|
||||||
|
@ -36,25 +41,66 @@ public class ItemHandEvent implements Listener {
|
||||||
ItemStack newItem = player.getInventory().getItem(e.getNewSlot());
|
ItemStack newItem = player.getInventory().getItem(e.getNewSlot());
|
||||||
if(oldItem != null && oldItem.getType() != Material.AIR) {
|
if(oldItem != null && oldItem.getType() != Material.AIR) {
|
||||||
NBTItem nbti = new NBTItem(oldItem);
|
NBTItem nbti = new NBTItem(oldItem);
|
||||||
if(nbti.hasKey("SPEED")) {
|
for (String s : Attributes.getNameList()) {
|
||||||
|
if (nbti.hasKey(s.toUpperCase())) {
|
||||||
|
java.lang.reflect.Method method = null;
|
||||||
|
try {
|
||||||
|
method = pm.getClass().getMethod("getItem" + s);
|
||||||
|
} catch (SecurityException | NoSuchMethodException exception) {
|
||||||
|
|
||||||
|
}
|
||||||
|
if (method != null) {
|
||||||
|
me.unurled.raxen.components.entity.Attributes.Attribute attribute = null;
|
||||||
|
try {
|
||||||
|
attribute = (Attribute) method.invoke(pm, null);
|
||||||
|
} catch (InvocationTargetException | IllegalAccessException exception) {
|
||||||
|
|
||||||
|
}
|
||||||
|
if (attribute != null) {
|
||||||
|
attribute.remove(player, nbti.getInteger(s.toUpperCase()));
|
||||||
|
debug("removed " + s + " for player " + player.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*if(nbti.hasKey("SPEED")) {
|
||||||
pm.getItemSpeed().remove(player, nbti.getInteger("SPEED"));
|
pm.getItemSpeed().remove(player, nbti.getInteger("SPEED"));
|
||||||
}
|
}
|
||||||
if(nbti.hasKey("HEALTH")) {
|
if(nbti.hasKey("HEALTH")) {
|
||||||
pm.getItemHealth().remove(player, nbti.getInteger("HEALTH"));
|
pm.getItemHealth().remove(player, nbti.getInteger("HEALTH"));
|
||||||
|
|
||||||
}
|
}
|
||||||
if(nbti.hasKey("DEFENSE")) {
|
if(nbti.hasKey("DEFENSE")) {
|
||||||
pm.getItemDefense().remove(player, nbti.getInteger("DEFENSE"));
|
pm.getItemDefense().remove(player, nbti.getInteger("DEFENSE"));
|
||||||
|
|
||||||
}
|
}
|
||||||
if(nbti.hasKey("STRENGTH")) {
|
if(nbti.hasKey("STRENGTH")) {
|
||||||
pm.getItemStrength().remove(player, nbti.getInteger("STRENGTH"));
|
pm.getItemStrength().remove(player, nbti.getInteger("STRENGTH"));
|
||||||
|
}*/
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(newItem != null && newItem.getType() != Material.AIR) {
|
if(newItem != null && newItem.getType() != Material.AIR) {
|
||||||
NBTItem nbti = new NBTItem(newItem);
|
NBTItem nbti = new NBTItem(newItem);
|
||||||
if(nbti.hasKey("SPEED")) {
|
for (String s : Attributes.getNameList()) {
|
||||||
|
if (nbti.hasKey(s.toUpperCase())) {
|
||||||
|
java.lang.reflect.Method method = null;
|
||||||
|
try {
|
||||||
|
method = pm.getClass().getMethod("getItem" + s);
|
||||||
|
} catch (SecurityException | NoSuchMethodException exception) {
|
||||||
|
|
||||||
|
}
|
||||||
|
if (method != null) {
|
||||||
|
me.unurled.raxen.components.entity.Attributes.Attribute attribute = null;
|
||||||
|
try {
|
||||||
|
attribute = (Attribute) method.invoke(pm, null);
|
||||||
|
} catch (InvocationTargetException | IllegalAccessException exception) {
|
||||||
|
|
||||||
|
}
|
||||||
|
if (attribute != null) {
|
||||||
|
attribute.add(player, nbti.getInteger(s.toUpperCase()));
|
||||||
|
debug("add " + s + " for player " + player.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* if(nbti.hasKey("SPEED")) {
|
||||||
pm.getItemSpeed().add(player, nbti.getInteger("SPEED"));
|
pm.getItemSpeed().add(player, nbti.getInteger("SPEED"));
|
||||||
}
|
}
|
||||||
if(nbti.hasKey("HEALTH")) {
|
if(nbti.hasKey("HEALTH")) {
|
||||||
|
@ -67,8 +113,7 @@ public class ItemHandEvent implements Listener {
|
||||||
}
|
}
|
||||||
if(nbti.hasKey("STRENGTH")) {
|
if(nbti.hasKey("STRENGTH")) {
|
||||||
pm.getItemStrength().add(player, nbti.getInteger("STRENGTH"));
|
pm.getItemStrength().add(player, nbti.getInteger("STRENGTH"));
|
||||||
|
}*/
|
||||||
}
|
|
||||||
}
|
}
|
||||||
PlayerUtils.updateSkills(main, player);
|
PlayerUtils.updateSkills(main, player);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package me.unurled.raxen.listener.player;
|
package me.unurled.raxen.listener.player;
|
||||||
|
|
||||||
import me.unurled.raxen.Raxen;
|
import me.unurled.raxen.Raxen;
|
||||||
|
import me.unurled.raxen.components.entity.player.PlayerUtils;
|
||||||
import me.unurled.raxen.components.entity.player.Scoreboard;
|
import me.unurled.raxen.components.entity.player.Scoreboard;
|
||||||
import me.unurled.raxen.components.resourcepack.ResourcePack;
|
import me.unurled.raxen.components.resourcepack.ResourcePack;
|
||||||
import me.unurled.raxen.config.PlayerConfig;
|
import me.unurled.raxen.config.PlayerConfig;
|
||||||
|
@ -38,6 +39,7 @@ public class JoinEvent implements Listener {
|
||||||
resourcePack.join(player);
|
resourcePack.join(player);
|
||||||
playerManager.getRaxenPlayer(player).isRaxenPlayer(true);
|
playerManager.getRaxenPlayer(player).isRaxenPlayer(true);
|
||||||
playerManager.registerActionBar(player);
|
playerManager.registerActionBar(player);
|
||||||
|
PlayerUtils.updateSkills(main, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package me.unurled.raxen.listener.player;
|
package me.unurled.raxen.listener.player;
|
||||||
|
|
||||||
import me.unurled.raxen.Raxen;
|
import me.unurled.raxen.Raxen;
|
||||||
|
import me.unurled.raxen.components.entity.player.PlayerUtils;
|
||||||
import me.unurled.raxen.config.PlayerConfig;
|
import me.unurled.raxen.config.PlayerConfig;
|
||||||
import me.unurled.raxen.manager.entity.PlayerManager;
|
import me.unurled.raxen.manager.entity.PlayerManager;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class ItemManager {
|
||||||
private void registerItem() {
|
private void registerItem() {
|
||||||
me.unurled.raxen.components.items.custom.List lisst = new me.unurled.raxen.components.items.custom.List(main);
|
me.unurled.raxen.components.items.custom.List lisst = new me.unurled.raxen.components.items.custom.List(main);
|
||||||
for (Item items : lisst.getItems()) {
|
for (Item items : lisst.getItems()) {
|
||||||
items.registerItem(main);
|
registerItem(items.getItem());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import me.unurled.raxen.components.entity.other.EntityNamespacedKey;
|
||||||
import me.unurled.raxen.components.entity.player.RaxenPlayer;
|
import me.unurled.raxen.components.entity.player.RaxenPlayer;
|
||||||
import me.unurled.raxen.components.entity.player.classes.Class;
|
import me.unurled.raxen.components.entity.player.classes.Class;
|
||||||
import me.unurled.raxen.components.entity.player.classes.Classes;
|
import me.unurled.raxen.components.entity.player.classes.Classes;
|
||||||
import net.kyori.adventure.text.Component;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
@ -19,12 +18,12 @@ import static me.unurled.raxen.utils.Utils.*;
|
||||||
|
|
||||||
public class PlayerManager {
|
public class PlayerManager {
|
||||||
|
|
||||||
private Raxen main;
|
private final Raxen main;
|
||||||
private HashMap<UUID, BukkitTask> actionBar = new HashMap<>();
|
private final HashMap<UUID, BukkitTask> actionBar = new HashMap<>();
|
||||||
// TODO: player classes
|
// TODO: player classes
|
||||||
private HashMap<String, Class> classes = new HashMap<>();
|
private final HashMap<String, Class> classes = new HashMap<>();
|
||||||
@Getter
|
@Getter
|
||||||
private HashMap<String, me.unurled.raxen.components.entity.Attributes.Attribute> attribute = new HashMap<>();
|
private final HashMap<String, me.unurled.raxen.components.entity.Attributes.Attribute> attribute = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
private Classes classesRegister;
|
private Classes classesRegister;
|
||||||
|
|
17
src/main/java/me/unurled/raxen/utils/EntityUtils.java
Normal file
17
src/main/java/me/unurled/raxen/utils/EntityUtils.java
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
package me.unurled.raxen.utils;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class EntityUtils {
|
||||||
|
|
||||||
|
public void setSkin(Entity e) {
|
||||||
|
if (e instanceof Player) {
|
||||||
|
|
||||||
|
}
|
||||||
|
// Bukkit.getWorld("aa").spawn(new Location(Bukkit.getWorld("aa"), 0, 0, 0), new CraftPlayer())
|
||||||
|
}
|
||||||
|
}
|
108
src/main/java/me/unurled/raxen/utils/RayTrace.java
Normal file
108
src/main/java/me/unurled/raxen/utils/RayTrace.java
Normal file
|
@ -0,0 +1,108 @@
|
||||||
|
package me.unurled.raxen.utils;
|
||||||
|
|
||||||
|
import org.bukkit.Effect;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.util.BoundingBox;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class RayTrace {
|
||||||
|
|
||||||
|
//origin = start position
|
||||||
|
//direction = direction in which the raytrace will go
|
||||||
|
Vector origin, direction;
|
||||||
|
|
||||||
|
public RayTrace(Vector origin, Vector direction) {
|
||||||
|
this.origin = origin;
|
||||||
|
this.direction = direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
//get a point on the raytrace at X blocks away
|
||||||
|
public Vector getPostion(double blocksAway) {
|
||||||
|
return origin.clone().add(direction.clone().multiply(blocksAway));
|
||||||
|
}
|
||||||
|
|
||||||
|
//checks if a position is on contained within the position
|
||||||
|
public boolean isOnLine(Vector position) {
|
||||||
|
double t = (position.getX() - origin.getX()) / direction.getX();
|
||||||
|
;
|
||||||
|
if (position.getBlockY() == origin.getY() + (t * direction.getY()) && position.getBlockZ() == origin.getZ() + (t * direction.getZ())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//get all postions on a raytrace
|
||||||
|
public ArrayList<Vector> traverse(double blocksAway, double accuracy) {
|
||||||
|
ArrayList<Vector> positions = new ArrayList<>();
|
||||||
|
for (double d = 0; d <= blocksAway; d += accuracy) {
|
||||||
|
positions.add(getPostion(d));
|
||||||
|
}
|
||||||
|
return positions;
|
||||||
|
}
|
||||||
|
|
||||||
|
//intersection detection for current raytrace with return
|
||||||
|
public Vector positionOfIntersection(Vector min, Vector max, double blocksAway, double accuracy) {
|
||||||
|
ArrayList<Vector> positions = traverse(blocksAway, accuracy);
|
||||||
|
for (Vector position : positions) {
|
||||||
|
if (intersects(position, min, max)) {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//intersection detection for current raytrace
|
||||||
|
public boolean intersects(Vector min, Vector max, double blocksAway, double accuracy) {
|
||||||
|
ArrayList<Vector> positions = traverse(blocksAway, accuracy);
|
||||||
|
for (Vector position : positions) {
|
||||||
|
if (intersects(position, min, max)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//bounding box instead of vector
|
||||||
|
public Vector positionOfIntersection(BoundingBox boundingBox, double blocksAway, double accuracy) {
|
||||||
|
ArrayList<Vector> positions = traverse(blocksAway, accuracy);
|
||||||
|
for (Vector position : positions) {
|
||||||
|
if (intersects(position, boundingBox.getMin(), boundingBox.getMax())) {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//bounding box instead of vector
|
||||||
|
public boolean intersects(BoundingBox boundingBox, double blocksAway, double accuracy) {
|
||||||
|
ArrayList<Vector> positions = traverse(blocksAway, accuracy);
|
||||||
|
for (Vector position : positions) {
|
||||||
|
if (intersects(position, boundingBox.getMin(), boundingBox.getMax())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//general intersection detection
|
||||||
|
public static boolean intersects(Vector position, Vector min, Vector max) {
|
||||||
|
if (position.getX() < min.getX() || position.getX() > max.getX()) {
|
||||||
|
return false;
|
||||||
|
} else if (position.getY() < min.getY() || position.getY() > max.getY()) {
|
||||||
|
return false;
|
||||||
|
} else if (position.getZ() < min.getZ() || position.getZ() > max.getZ()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//debug / effects
|
||||||
|
public void highlight(World world, double blocksAway, double accuracy){
|
||||||
|
for(Vector position : traverse(blocksAway,accuracy)){
|
||||||
|
world.playEffect(position.toLocation(world), Effect.BOW_FIRE,0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -98,18 +98,40 @@ public class Utils {
|
||||||
* @return a String
|
* @return a String
|
||||||
*/
|
*/
|
||||||
public static String textCompToString(TextComponent comp) {
|
public static String textCompToString(TextComponent comp) {
|
||||||
MiniMessage minimessage = MiniMessage.builder()
|
/* MiniMessage minimessage = MiniMessage.builder()
|
||||||
.tags(TagResolver.builder()
|
.tags(TagResolver.builder()
|
||||||
.resolver(StandardTags.color())
|
.resolver(StandardTags.color())
|
||||||
.resolver(StandardTags.decorations())
|
.resolver(StandardTags.decorations())
|
||||||
.resolver(StandardTags.reset())
|
.resolver(StandardTags.reset())
|
||||||
.build()
|
.build()
|
||||||
)
|
)
|
||||||
.build();
|
.build(); */
|
||||||
return ChatColor.translateAlternateColorCodes('&', LegacyComponentSerializer.legacyAmpersand()
|
return ChatColor.translateAlternateColorCodes('&', LegacyComponentSerializer.legacyAmpersand()
|
||||||
.serialize(comp));
|
.serialize(comp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* transform a text-component to a string
|
||||||
|
* @param comp a string
|
||||||
|
* @return a String
|
||||||
|
*/
|
||||||
|
public static String textCompToString(Component comp) {
|
||||||
|
/* MiniMessage minimessage = MiniMessage.builder()
|
||||||
|
.tags(TagResolver.builder()
|
||||||
|
.resolver(StandardTags.color())
|
||||||
|
.resolver(StandardTags.decorations())
|
||||||
|
.resolver(StandardTags.reset())
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
.build(); */
|
||||||
|
return ChatColor.translateAlternateColorCodes('§', LegacyComponentSerializer.legacyAmpersand()
|
||||||
|
.serialize(comp));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void comp(Component comp) {
|
||||||
|
LegacyComponentSerializer.legacyAmpersand().serialize(comp);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strips all color from a string.
|
* Strips all color from a string.
|
||||||
* @param string the string that wants to be decolored.
|
* @param string the string that wants to be decolored.
|
||||||
|
|
Loading…
Reference in a new issue