0.6.2 update to 1.20.1

This commit is contained in:
unurled 2023-06-20 13:48:19 +02:00
parent b9b0590417
commit 991ed226b8
Signed by: unurled
GPG key ID: FDBC9CBE1F82423F
5 changed files with 15 additions and 8 deletions

View file

@ -30,7 +30,7 @@ import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public class Humanoid extends Entity { public abstract class Humanoid extends Entity {
private String skin; // used to get the path to the skin 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... private UUID skinUuid; // used to get the player skin (if i do it this way...

View file

@ -33,7 +33,7 @@ import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public class Goblin extends Entity { public abstract class Goblin extends Entity {
RaxenEntity goblin; RaxenEntity goblin;

View file

@ -42,7 +42,7 @@ public class ItemBuilder {
private Set<ItemFlag> itemFlags; private Set<ItemFlag> itemFlags;
private boolean hasAttributeModifiers; private boolean hasAttributeModifiers;
private Multimap<Attribute, AttributeModifier> attributeModifiers; private Multimap<Attribute, AttributeModifier> attributeModifiers;
private List<String> lore; private List<Component> lore;
private final Map<Enchantment, Integer> enchantments; private final Map<Enchantment, Integer> enchantments;
public ItemBuilder(ItemStack it) { public ItemBuilder(ItemStack it) {
@ -90,7 +90,7 @@ public class ItemBuilder {
} }
if (itm.hasLore()) { if (itm.hasLore()) {
lore = itm.getLore(); lore = itm.lore();
} }
persistentDataContainer = itm.getPersistentDataContainer(); persistentDataContainer = itm.getPersistentDataContainer();
@ -107,7 +107,7 @@ public class ItemBuilder {
return this; return this;
} }
public void lore(List<String> lore) { public void lore(List<Component> lore) {
this.lore = lore; this.lore = lore;
} }

View file

@ -1,7 +1,9 @@
package me.unurled.raxen.components.items; package me.unurled.raxen.components.items;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import me.unurled.raxen.utils.Utils; import me.unurled.raxen.utils.Utils;
import net.kyori.adventure.text.Component;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
@ -36,7 +38,11 @@ public class ItemParser {
private ItemBuilder applyConfig(ItemBuilder item) { private ItemBuilder applyConfig(ItemBuilder item) {
if (section.contains("lore")) { if (section.contains("lore")) {
List<String> lore = section.getStringList("lore"); List<String> l = section.getStringList("lore");
List<Component> lore = new ArrayList<>();
for (int i = 0; i < l.size(); i++) {
lore.add(i, Utils.colorComp(l.get(i)));
}
item.lore(lore); item.lore(lore);
} }
@ -45,7 +51,8 @@ public class ItemParser {
} }
if (section.contains("Pack")) { if (section.contains("Pack")) {
item.modelData(section.getString("Pack.model", null), section.getInt("Pack.custom_model_data", 0)); item.modelData(section.getString("Pack.model", null),
section.getInt("Pack.custom_model_data", 0));
} }
return item; return item;
} }

View file

@ -1,7 +1,7 @@
package me.unurled.raxen.utils; package me.unurled.raxen.utils;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_19_R3.CraftRegionAccessor; import org.bukkit.craftbukkit.v1_20_R1.CraftRegionAccessor;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;