forked from SteamWar/SteamWar
Add Simulator to improvements
This commit is contained in:
@@ -145,62 +145,76 @@ public class SWItem {
|
||||
return item;
|
||||
}
|
||||
|
||||
private void hideAttributes() {
|
||||
if (itemMeta == null) return;
|
||||
private SWItem hideAttributes() {
|
||||
if (itemMeta == null) return this;
|
||||
for (ItemFlag flag : EnumSet.allOf(ItemFlag.class)) {
|
||||
itemMeta.addItemFlags(flag);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack getItemStack() {
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
public void setItemStack(ItemStack itemStack) {
|
||||
public SWItem setItemStack(ItemStack itemStack) {
|
||||
this.itemStack = itemStack;
|
||||
itemMeta = itemStack.getItemMeta();
|
||||
hideAttributes();
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemMeta getItemMeta() {
|
||||
return itemMeta;
|
||||
}
|
||||
|
||||
public void setItemMeta(ItemMeta itemMeta) {
|
||||
public SWItem setItemMeta(ItemMeta itemMeta) {
|
||||
this.itemMeta = itemMeta;
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
hideAttributes();
|
||||
return this;
|
||||
}
|
||||
|
||||
public InvCallback getCallback() {
|
||||
return callback;
|
||||
}
|
||||
|
||||
public void setCallback(InvCallback callback) {
|
||||
public SWItem setCallback(InvCallback callback) {
|
||||
this.callback = callback;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
public SWItem setName(String name) {
|
||||
itemMeta.setDisplayName(name);
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setLore(List<String> lore) {
|
||||
public SWItem setLore(List<String> lore) {
|
||||
itemMeta.setLore(lore);
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setLore(String... lore) {
|
||||
public SWItem setLore(String... lore) {
|
||||
itemMeta.setLore(Arrays.stream(lore).collect(Collectors.toList()));
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setEnchanted(boolean enchanted) {
|
||||
public SWItem setEnchanted(boolean enchanted) {
|
||||
if (enchanted){
|
||||
itemMeta.addEnchant(TrickyTrialsWrapper.impl.getUnbreakingEnchantment() , 10, true);
|
||||
} else {
|
||||
itemMeta.removeEnchant(TrickyTrialsWrapper.impl.getUnbreakingEnchantment());
|
||||
}
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SWItem setCustomModelData(int customModelData) {
|
||||
itemMeta.setCustomModelData(customModelData);
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user