Fix issue where preset groups wouldn't set the 'arrows' style properly

This commit is contained in:
Esophose 2019-12-09 12:10:48 -07:00
parent 77457f26c0
commit 6b6d5d739c
2 changed files with 15 additions and 2 deletions

View file

@ -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()) {

View file

@ -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
*