Added lore and name for display item to config
This commit is contained in:
parent
a8667e84e3
commit
0bff66ad1f
|
|
@ -48,6 +48,8 @@ public class ParticleConfig extends AbstractConfig {
|
|||
aPartType = APartType.valueOf(cs.getString("part-type"));
|
||||
particleSet = new ParticleSet(
|
||||
getAParticle(cs),
|
||||
cs.getString("name"),
|
||||
cs.getStringList("lore"),
|
||||
cs.getInt("frame-delay"),
|
||||
cs.getInt("repeat"),
|
||||
cs.getInt("repeat-delay"),
|
||||
|
|
@ -97,6 +99,8 @@ public class ParticleConfig extends AbstractConfig {
|
|||
cs.getString("particle");
|
||||
ConfigurationSection color = cs.getConfigurationSection("color");
|
||||
ParticleBuilder particle = new ParticleBuilder(Particle.valueOf(cs.getString("particle")));
|
||||
// Class<?> dataType = particle.particle().getDataType();
|
||||
// Logger.warning(dataType.getSimpleName());
|
||||
particle.extra(cs.getDouble("extra"));
|
||||
if (color != null) {
|
||||
particle = particle.color(color.getInt("r"), color.getInt("g"), color.getInt("b"));
|
||||
|
|
|
|||
|
|
@ -7,14 +7,16 @@ import com.alttd.frameSpawners.FrameSpawnerPlayer;
|
|||
import com.alttd.storage.PlayerSettings;
|
||||
import com.alttd.util.Logger;
|
||||
import de.myzelyam.api.vanish.VanishAPI;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ParticleSet {
|
||||
|
||||
|
|
@ -25,7 +27,8 @@ public class ParticleSet {
|
|||
private final String permission;
|
||||
private final ItemStack itemStack;
|
||||
|
||||
public ParticleSet(List<Frame> frames, int frameDelay, int repeat, int repeatDelay, APartType aPartType, String uniqueId, String permission, ItemStack itemStack) {
|
||||
public ParticleSet(List<Frame> frames, String name, List<String> lore, int frameDelay, int repeat, int repeatDelay, APartType aPartType, String uniqueId, String permission, ItemStack itemStack) {
|
||||
MiniMessage miniMessage = MiniMessage.miniMessage();
|
||||
this.frames = frames;
|
||||
this.frameDelay = frameDelay;
|
||||
this.repeat = repeat;
|
||||
|
|
@ -33,6 +36,10 @@ public class ParticleSet {
|
|||
this.aPartType = aPartType;
|
||||
this.uniqueId = uniqueId;
|
||||
this.permission = permission;
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
itemMeta.displayName(miniMessage.deserialize(name));
|
||||
itemMeta.lore(lore.stream().map(miniMessage::deserialize).collect(Collectors.toList()));
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
this.itemStack = itemStack;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user