mirror of
https://github.com/TotalFreedomMC/PlayerParticles.git
synced 2024-12-31 20:02:12 +00:00
Fix issue where preset groups wouldn't set the 'arrows' style properly
This commit is contained in:
parent
77457f26c0
commit
6b6d5d739c
2 changed files with 15 additions and 2 deletions
|
@ -49,8 +49,11 @@ public class GuiInventoryLoadPresetGroups extends GuiInventory {
|
|||
GuiActionButton groupButton = new GuiActionButton(index, group.getGuiIcon(), LangManager.getText(Lang.GUI_COLOR_ICON_NAME) + group.getDisplayName(), lore, (button, isShiftClick) -> {
|
||||
ParticleGroup activeGroup = pplayer.getActiveParticleGroup();
|
||||
activeGroup.getParticles().clear();
|
||||
for (ParticlePair particle : particles)
|
||||
activeGroup.getParticles().add(particle.clone());
|
||||
for (ParticlePair particle : particles) {
|
||||
ParticlePair clonedParticle = particle.clone();
|
||||
clonedParticle.setOwner(pplayer);
|
||||
activeGroup.getParticles().add(clonedParticle);
|
||||
}
|
||||
DataManager.saveParticleGroup(pplayer.getUniqueId(), activeGroup);
|
||||
|
||||
if (PSetting.GUI_CLOSE_AFTER_GROUP_SELECTED.getBoolean()) {
|
||||
|
|
|
@ -44,6 +44,16 @@ public class ParticlePair {
|
|||
this.setNoteColor(noteColor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the particle's owner if it hasn't been set yet
|
||||
*
|
||||
* @param pplayer The new owner
|
||||
*/
|
||||
public void setOwner(PPlayer pplayer) {
|
||||
if (this.ownerUUID == null)
|
||||
this.ownerUUID = pplayer.getUniqueId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the player's particle effect
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue