This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
157 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
src/main/java/io/github/puyodead1/rpbookgui/EnchantConstructor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package io.github.puyodead1.rpbookgui; | ||
|
||
import java.util.HashMap; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
import me.randomhashtags.randompackage.addons.CustomEnchant; | ||
import me.randomhashtags.randompackage.addons.EnchantRarity; | ||
import me.randomhashtags.randompackage.api.CustomEnchants; | ||
|
||
public class EnchantConstructor { | ||
private CustomEnchant customEnchant; | ||
private EnchantRarity enchantRarity; | ||
private int enchantLevel; | ||
private ItemStack revealItem; | ||
private int success; | ||
private int destroy; | ||
|
||
private static HashMap<String, EnchantConstructor> enchants = new HashMap<String, EnchantConstructor>(); | ||
|
||
public EnchantConstructor(CustomEnchant customEnchant, EnchantRarity enchantRarity, int enchantLevel, int success, int destroy) { | ||
this.customEnchant = customEnchant; | ||
this.enchantRarity = enchantRarity; | ||
this.enchantLevel = enchantLevel; | ||
this.revealItem = CustomEnchants.getCustomEnchants().getRevealedItem(customEnchant, enchantLevel, success, destroy, true, true); | ||
this.success = success; | ||
this.destroy = destroy; | ||
|
||
enchants.put(customEnchant.getIdentifier(), this); | ||
|
||
Bukkit.broadcastMessage("EnchantConstructor added: " + customEnchant.getIdentifier() + " " + enchantLevel); | ||
} | ||
|
||
public CustomEnchant getCustomEnchant() { | ||
return customEnchant; | ||
} | ||
|
||
public void setCustomEnchant(CustomEnchant customEnchant) { | ||
this.customEnchant = customEnchant; | ||
} | ||
|
||
public EnchantRarity getEnchantRarity() { | ||
return enchantRarity; | ||
} | ||
|
||
public void setEnchantRarity(EnchantRarity enchantRarity) { | ||
this.enchantRarity = enchantRarity; | ||
} | ||
|
||
public int getEnchantLevel() { | ||
return enchantLevel; | ||
} | ||
|
||
public void setEnchantLevel(int enchantLevel) { | ||
this.enchantLevel = enchantLevel; | ||
} | ||
|
||
|
||
public ItemStack getRevealItem() { | ||
return revealItem; | ||
} | ||
|
||
public int getSuccess() { | ||
return success; | ||
} | ||
|
||
public void setSuccess(int success) { | ||
this.success = success; | ||
} | ||
|
||
public int getDestroy() { | ||
return destroy; | ||
} | ||
|
||
public void setDestroy(int destroy) { | ||
this.destroy = destroy; | ||
} | ||
|
||
public static HashMap<String, EnchantConstructor> getEnchants() { | ||
return enchants; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters