mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Did the requested changes.
This commit is contained in:
parent
64a1b247b4
commit
07d837299f
@ -1,5 +1,14 @@
|
||||
package io.github.thebusybiscuit.slimefun4.core.attributes;
|
||||
|
||||
/**
|
||||
* Represents the {@link ProtectionType} that a {@link CustomProtection}
|
||||
* prevents the damage from.
|
||||
*
|
||||
* @author Linox
|
||||
*
|
||||
* @see CustomProtection
|
||||
*
|
||||
*/
|
||||
public enum ProtectionType {
|
||||
|
||||
RADIATION,
|
||||
|
@ -1,20 +1,32 @@
|
||||
package io.github.thebusybiscuit.slimefun4.implementation.items.armor;
|
||||
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
|
||||
import io.github.thebusybiscuit.slimefun4.core.attributes.CustomProtection;
|
||||
import io.github.thebusybiscuit.slimefun4.core.attributes.ProtectionType;
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
|
||||
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
|
||||
import me.mrCookieSlime.Slimefun.Objects.Category;
|
||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
/**
|
||||
* Represents 1 {@link SlimefunArmorPiece} of the Hazmat armor set.
|
||||
* One of the very few utilisations of {@link CustomProtection}.
|
||||
*
|
||||
* @author Linox
|
||||
*
|
||||
* @see SlimefunArmorPiece
|
||||
* @see CustomProtection
|
||||
*
|
||||
*/
|
||||
public class HazmatArmorPiece extends SlimefunArmorPiece implements CustomProtection {
|
||||
|
||||
private final ProtectionType[] types;
|
||||
|
||||
public HazmatArmorPiece(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, PotionEffect[] effects, String setID) {
|
||||
super(category, item, recipeType, recipe, effects, setID);
|
||||
public HazmatArmorPiece(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, PotionEffect[] effects) {
|
||||
super(category, item, recipeType, recipe, effects, new NamespacedKey(SlimefunPlugin.instance, "hazmat_suit"));
|
||||
|
||||
types = new ProtectionType[] {ProtectionType.BEES, ProtectionType.RADIATION};
|
||||
}
|
||||
|
@ -22,10 +22,9 @@ public class SlimefunArmorPiece extends SlimefunItem {
|
||||
this.effects = effects == null ? new PotionEffect[0] : effects;
|
||||
}
|
||||
|
||||
public SlimefunArmorPiece(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, PotionEffect[] effects, String setId) {
|
||||
public SlimefunArmorPiece(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, PotionEffect[] effects, NamespacedKey setId) {
|
||||
this(category, item, recipeType, recipe, effects);
|
||||
|
||||
this.id = new NamespacedKey(SlimefunPlugin.instance, setId);
|
||||
this.id = setId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user