Created new totem items.
This commit is contained in:
@ -0,0 +1,20 @@
|
||||
package dev.micle.totemofreviving.item.totem;
|
||||
|
||||
import dev.micle.totemofreviving.config.Config;
|
||||
import dev.micle.totemofreviving.item.charge.DiamondChargeItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class DiamondTotemItem extends TotemItem {
|
||||
public DiamondTotemItem() {
|
||||
super(Config.Server.getDiamondTotemConfig().getDurability());
|
||||
}
|
||||
|
||||
public static String getName() {
|
||||
return "diamond_totem";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCharge(ItemStack stack) {
|
||||
return (stack.getItem() instanceof DiamondChargeItem);
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package dev.micle.totemofreviving.item.totem;
|
||||
|
||||
import dev.micle.totemofreviving.config.Config;
|
||||
import dev.micle.totemofreviving.item.charge.IronChargeItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class IronTotemItem extends TotemItem {
|
||||
public IronTotemItem() {
|
||||
super(Config.Server.getIronTotemConfig().getDurability());
|
||||
}
|
||||
|
||||
public static String getName() {
|
||||
return "iron_totem";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCharge(ItemStack stack) {
|
||||
return (stack.getItem() instanceof IronChargeItem);
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package dev.micle.totemofreviving.item.totem;
|
||||
|
||||
import dev.micle.totemofreviving.config.Config;
|
||||
import dev.micle.totemofreviving.item.charge.NetheriteChargeItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class NetheriteTotemItem extends TotemItem {
|
||||
public NetheriteTotemItem() {
|
||||
super(Config.Server.getNetheriteTotemConfig().getDurability());
|
||||
}
|
||||
|
||||
public static String getName() {
|
||||
return "netherite_totem";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCharge(ItemStack stack) {
|
||||
return (stack.getItem() instanceof NetheriteChargeItem);
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package dev.micle.totemofreviving.item;
|
||||
package dev.micle.totemofreviving.item.totem;
|
||||
|
||||
import dev.micle.totemofreviving.config.Config;
|
||||
import dev.micle.totemofreviving.item.charge.StrawChargeItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Rarity;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package dev.micle.totemofreviving.item;
|
||||
package dev.micle.totemofreviving.item.totem;
|
||||
|
||||
import dev.micle.totemofreviving.TotemOfReviving;
|
||||
import dev.micle.totemofreviving.config.Config;
|
||||
@ -236,6 +236,9 @@ public abstract class TotemItem extends Item {
|
||||
private static Config.TotemConfig getConfig(ItemStack stack) {
|
||||
Item item = stack.getItem();
|
||||
if (item instanceof StrawTotemItem) { return Config.Server.getStrawTotemConfig(); }
|
||||
if (item instanceof IronTotemItem) { return Config.Server.getIronTotemConfig(); }
|
||||
if (item instanceof DiamondTotemItem) { return Config.Server.getDiamondTotemConfig(); }
|
||||
if (item instanceof NetheriteTotemItem) { return Config.Server.getNetheriteTotemConfig(); }
|
||||
return null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user