mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-02-22 14:41:48 +01:00
!New API methods
This commit is contained in:
parent
d43a19e816
commit
8f2562d6df
@ -26,15 +26,15 @@ public class GemstoneData {
|
||||
private final String name;
|
||||
|
||||
/*
|
||||
* This constructor is not really performance friendly. It should only
|
||||
* be used when applying gem stones to keep max performance.
|
||||
* This constructor is not really performance friendly. It should only be
|
||||
* used when applying gem stones to keep max performance.
|
||||
*/
|
||||
public GemstoneData(JsonObject object) {
|
||||
object.getAsJsonObject("Stats").entrySet()
|
||||
.forEach(entry -> this.stats.put(MMOItems.plugin.getStats().get(entry.getKey()), entry.getValue().getAsDouble()));
|
||||
object.getAsJsonArray("Abilities").forEach(element -> this.abilities.add(new AbilityData(element.getAsJsonObject())));
|
||||
object.getAsJsonObject("Effects").entrySet().forEach(
|
||||
entry -> this.effects.add(new PotionEffectData(PotionEffectType.getByName(entry.getKey()), entry.getValue().getAsInt())));
|
||||
object.getAsJsonObject("Effects").entrySet()
|
||||
.forEach(entry -> this.effects.add(new PotionEffectData(PotionEffectType.getByName(entry.getKey()), entry.getValue().getAsInt())));
|
||||
name = object.get("Name").getAsString();
|
||||
|
||||
// if (object.has("Particles"))
|
||||
@ -54,6 +54,18 @@ public class GemstoneData {
|
||||
name = MMOUtils.getDisplayName(nbtItem.getItem());
|
||||
}
|
||||
|
||||
public void addAbility(AbilityData ability) {
|
||||
abilities.add(ability);
|
||||
}
|
||||
|
||||
public void addPermanentEffect(PotionEffectData effect) {
|
||||
effects.add(effect);
|
||||
}
|
||||
|
||||
public void setStat(ItemStat stat, double value) {
|
||||
stats.put(stat, value);
|
||||
}
|
||||
|
||||
// public boolean hasParticle() {
|
||||
// return particle != null;
|
||||
// }
|
||||
|
Loading…
Reference in New Issue
Block a user