Added package permission
This commit is contained in:
parent
0bff66ad1f
commit
8502848103
|
|
@ -56,6 +56,7 @@ public class ParticleConfig extends AbstractConfig {
|
|||
aPartType,
|
||||
cs.getString("unique-name"),
|
||||
cs.getString("permission"),
|
||||
cs.getString("package-permission"),
|
||||
new ItemStack(Material.valueOf(cs.getString("material"))));
|
||||
} catch (Exception e) {//Im lazy rn sorry
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class ChooseParticleGUI extends DefaultGUI {
|
|||
public ChooseParticleGUI(APartType aPartType, Component name, Player player) {
|
||||
super(name);
|
||||
List<ParticleSet> availableParticles = ParticleStorage.getParticleSets(aPartType).stream()
|
||||
.filter(particleSet -> player.hasPermission(particleSet.getPermission()))
|
||||
.filter(particleSet -> player.hasPermission(particleSet.getPackPermission()) || player.hasPermission(particleSet.getPermission()))
|
||||
.collect(Collectors.toList());
|
||||
PlayerSettings playerSettings = PlayerSettings.getPlayer(player.getUniqueId());
|
||||
int i = 0;
|
||||
|
|
|
|||
|
|
@ -25,9 +25,10 @@ public class ParticleSet {
|
|||
private final APartType aPartType;
|
||||
private final String uniqueId;
|
||||
private final String permission;
|
||||
private final String packPermission;
|
||||
private final 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) {
|
||||
public ParticleSet(List<Frame> frames, String name, List<String> lore, int frameDelay, int repeat, int repeatDelay, APartType aPartType, String uniqueId, String permission, String packPermission,ItemStack itemStack) {
|
||||
MiniMessage miniMessage = MiniMessage.miniMessage();
|
||||
this.frames = frames;
|
||||
this.frameDelay = frameDelay;
|
||||
|
|
@ -36,6 +37,7 @@ public class ParticleSet {
|
|||
this.aPartType = aPartType;
|
||||
this.uniqueId = uniqueId;
|
||||
this.permission = permission;
|
||||
this.packPermission = packPermission;
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
itemMeta.displayName(miniMessage.deserialize(name));
|
||||
itemMeta.lore(lore.stream().map(miniMessage::deserialize).collect(Collectors.toList()));
|
||||
|
|
@ -81,6 +83,10 @@ public class ParticleSet {
|
|||
return permission;
|
||||
}
|
||||
|
||||
public String getPackPermission() {
|
||||
return packPermission;
|
||||
}
|
||||
|
||||
public ItemStack getItemStack() {
|
||||
return itemStack;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user