Move Reagents to their own items
This commit is contained in:
parent
c58e29eeea
commit
59a9394f99
13 changed files with 298 additions and 263 deletions
|
@ -2,7 +2,7 @@ package WayofTime.bloodmagic.item;
|
|||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.item.types.IEnumItem;
|
||||
import WayofTime.bloodmagic.item.types.ISubItem;
|
||||
import com.google.common.collect.Lists;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -15,7 +15,7 @@ import org.apache.commons.lang3.tuple.Pair;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemEnum<T extends Enum<T> & IEnumItem> extends Item implements IVariantProvider {
|
||||
public class ItemEnum<T extends Enum<T> & ISubItem> extends Item implements IVariantProvider {
|
||||
|
||||
protected final T[] types;
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
|||
import WayofTime.bloodmagic.client.IMeshProvider;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.item.types.ComponentType;
|
||||
import WayofTime.bloodmagic.item.types.ReagentType;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerRepairing;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeElytra;
|
||||
|
@ -97,7 +98,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) {
|
||||
return ItemStack.areItemsEqual(repair, ComponentType.REAGENT_BINDING.getStack());
|
||||
return ItemStack.areItemsEqual(repair, ReagentType.REAGENT_BINDING.getStack());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,27 +6,9 @@ import net.minecraft.item.ItemStack;
|
|||
import javax.annotation.Nonnull;
|
||||
import java.util.Locale;
|
||||
|
||||
public enum ComponentType implements IEnumItem {
|
||||
public enum ComponentType implements ISubItem {
|
||||
|
||||
REAGENT_WATER,
|
||||
REAGENT_LAVA,
|
||||
REAGENT_AIR,
|
||||
REAGENT_FASTMINER,
|
||||
REAGENT_VOID,
|
||||
REAGENT_GROWTH,
|
||||
REAGENT_AFFINITY,
|
||||
REAGENT_SIGHT,
|
||||
REAGENT_BINDING,
|
||||
REAGENT_SUPPRESSION,
|
||||
COMPONENT_FRAME_PART,
|
||||
REAGENT_BLOODLIGHT,
|
||||
REAGENT_MAGNETISM,
|
||||
REAGENT_HASTE,
|
||||
REAGENT_COMPRESSION,
|
||||
REAGENT_BRIDGE,
|
||||
REAGENT_SEVERANCE,
|
||||
REAGENT_TELEPOSITION,
|
||||
REAGENT_TRANSPOSITION,
|
||||
FRAME_PART,
|
||||
SAND_IRON,
|
||||
SAND_GOLD,
|
||||
SAND_COAL,
|
||||
|
@ -35,27 +17,16 @@ public enum ComponentType implements IEnumItem {
|
|||
SALTPETER,
|
||||
NEURO_TOXIN,
|
||||
ANTISEPTIC,
|
||||
REAGENT_HOLDING,
|
||||
CATALYST_LENGTH_1,
|
||||
CATALYST_POWER_1,
|
||||
REAGENT_CLAW,
|
||||
REAGENT_BOUNCE,
|
||||
REAGENT_FROST,
|
||||
;
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getInternalName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
return getStack(1);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getStack(int count) {
|
||||
|
|
|
@ -4,13 +4,15 @@ import net.minecraft.item.ItemStack;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface IEnumItem {
|
||||
public interface ISubItem {
|
||||
|
||||
@Nonnull
|
||||
String getInternalName();
|
||||
|
||||
@Nonnull
|
||||
ItemStack getStack();
|
||||
default ItemStack getStack() {
|
||||
return getStack(1);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
ItemStack getStack(int count);
|
|
@ -0,0 +1,46 @@
|
|||
package WayofTime.bloodmagic.item.types;
|
||||
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Locale;
|
||||
|
||||
public enum ReagentType implements ISubItem {
|
||||
|
||||
REAGENT_WATER,
|
||||
REAGENT_LAVA,
|
||||
REAGENT_AIR,
|
||||
REAGENT_FASTMINER,
|
||||
REAGENT_VOID,
|
||||
REAGENT_GROWTH,
|
||||
REAGENT_AFFINITY,
|
||||
REAGENT_SIGHT,
|
||||
REAGENT_BINDING,
|
||||
REAGENT_SUPPRESSION,
|
||||
REAGENT_BLOODLIGHT,
|
||||
REAGENT_MAGNETISM,
|
||||
REAGENT_HASTE,
|
||||
REAGENT_COMPRESSION,
|
||||
REAGENT_BRIDGE,
|
||||
REAGENT_SEVERANCE,
|
||||
REAGENT_TELEPOSITION,
|
||||
REAGENT_TRANSPOSITION,
|
||||
REAGENT_CLAW,
|
||||
REAGENT_BOUNCE,
|
||||
REAGENT_FROST,
|
||||
REAGENT_HOLDING,
|
||||
;
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getInternalName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getStack(int count) {
|
||||
return new ItemStack(RegistrarBloodMagicItems.COMPONENT, count, ordinal());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue