cn.nukkit.item.enchantment.EnchantmentList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powernukkit Show documentation
Show all versions of powernukkit Show documentation
A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.
package cn.nukkit.item.enchantment;
/**
* @author Nukkit Project Team
*/
public class EnchantmentList {
private final EnchantmentEntry[] enchantments;
public EnchantmentList(int size) {
this.enchantments = new EnchantmentEntry[size];
}
/**
* @param slot The index of enchantment.
* @param entry The given enchantment entry.
* @return {@link EnchantmentList}
*/
public EnchantmentList setSlot(int slot, EnchantmentEntry entry) {
enchantments[slot] = entry;
return this;
}
public EnchantmentEntry getSlot(int slot) {
return enchantments[slot];
}
public int getSize() {
return enchantments.length;
}
}