mirror of
https://github.com/TotalFreedomMC/PlayerParticles.git
synced 2025-07-05 13:31:24 +00:00
Fix groups not overwriting
This commit is contained in:
parent
0826bbf31c
commit
48eca45e6a
1 changed files with 2 additions and 5 deletions
|
@ -489,7 +489,7 @@ public final class PlayerParticlesAPI {
|
||||||
//region Manage Player Particle Groups
|
//region Manage Player Particle Groups
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves a particle group to a player
|
* Saves a particle group to a player or edits an existing one
|
||||||
*
|
*
|
||||||
* @param player The player to save to
|
* @param player The player to save to
|
||||||
* @param particleGroup The particle group to save
|
* @param particleGroup The particle group to save
|
||||||
|
@ -507,16 +507,13 @@ public final class PlayerParticlesAPI {
|
||||||
if (pplayer == null)
|
if (pplayer == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (pplayer.getParticleGroups().containsKey(particleGroup.getName().toLowerCase()))
|
|
||||||
throw new IllegalArgumentException("A group already exists with the name " + particleGroup);
|
|
||||||
|
|
||||||
pplayer.getParticleGroups().put(particleGroup.getName().toLowerCase(), particleGroup);
|
pplayer.getParticleGroups().put(particleGroup.getName().toLowerCase(), particleGroup);
|
||||||
dataManager.saveParticleGroup(player.getUniqueId(), particleGroup);
|
dataManager.saveParticleGroup(player.getUniqueId(), particleGroup);
|
||||||
return particleGroup;
|
return particleGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves a particle group to a player
|
* Saves a particle group to a player or edits an existing one
|
||||||
*
|
*
|
||||||
* @param player The player to save to
|
* @param player The player to save to
|
||||||
* @param groupName The name of the group to save
|
* @param groupName The name of the group to save
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue