From 7ec27febc691d5bf660a2931c6b1a7452a49061b Mon Sep 17 00:00:00 2001 From: Nicholas Ignoffo Date: Fri, 23 Mar 2018 16:42:18 -0700 Subject: [PATCH] Apply same model to all alchemic vials --- .../bloodmagic/core/RegistrarBloodMagicItems.java | 1 - .../bloodmagic/item/ItemAlchemicVial.java | 15 ++++++--------- .../{AlchemicTypes.java => AlchemicVialType.java} | 15 ++++----------- .../WayofTime/bloodmagic/proxy/ClientProxy.java | 4 ++-- 4 files changed, 12 insertions(+), 23 deletions(-) rename src/main/java/WayofTime/bloodmagic/item/types/{AlchemicTypes.java => AlchemicVialType.java} (73%) diff --git a/src/main/java/WayofTime/bloodmagic/core/RegistrarBloodMagicItems.java b/src/main/java/WayofTime/bloodmagic/core/RegistrarBloodMagicItems.java index 0d9abfe8..caa674b9 100644 --- a/src/main/java/WayofTime/bloodmagic/core/RegistrarBloodMagicItems.java +++ b/src/main/java/WayofTime/bloodmagic/core/RegistrarBloodMagicItems.java @@ -16,7 +16,6 @@ import WayofTime.bloodmagic.item.routing.ItemNodeRouter; import WayofTime.bloodmagic.item.routing.ItemRouterFilter; import WayofTime.bloodmagic.item.sigil.*; import WayofTime.bloodmagic.item.soul.*; -import WayofTime.bloodmagic.item.types.AlchemicTypes; import WayofTime.bloodmagic.item.types.ComponentTypes; import WayofTime.bloodmagic.item.types.ShardType; diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemAlchemicVial.java b/src/main/java/WayofTime/bloodmagic/item/ItemAlchemicVial.java index 520bbcb6..bd75cd4a 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemAlchemicVial.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemAlchemicVial.java @@ -1,22 +1,19 @@ package WayofTime.bloodmagic.item; +import WayofTime.bloodmagic.item.types.AlchemicVialType; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; -import javax.annotation.Nonnull; - -import WayofTime.bloodmagic.item.types.AlchemicTypes; -import WayofTime.bloodmagic.item.types.ISubItem; - -public class ItemAlchemicVial & ISubItem> extends ItemEnum.Variant +public class ItemAlchemicVial extends ItemEnum.Variant { public ItemAlchemicVial() { - super((Class) AlchemicTypes.class, "alchemic_vial"); + super(AlchemicVialType.class, "alchemic_vial"); } @Override - public void gatherVariants(@Nonnull Int2ObjectMap variants) + public void gatherVariants(Int2ObjectMap variants) { - variants.put(0, "type=normal"); + for (AlchemicVialType type : types) + variants.put(type.ordinal(), "type=normal"); } } \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/item/types/AlchemicTypes.java b/src/main/java/WayofTime/bloodmagic/item/types/AlchemicVialType.java similarity index 73% rename from src/main/java/WayofTime/bloodmagic/item/types/AlchemicTypes.java rename to src/main/java/WayofTime/bloodmagic/item/types/AlchemicVialType.java index 35498ea0..db637b99 100644 --- a/src/main/java/WayofTime/bloodmagic/item/types/AlchemicTypes.java +++ b/src/main/java/WayofTime/bloodmagic/item/types/AlchemicVialType.java @@ -6,13 +6,13 @@ import net.minecraft.item.ItemStack; import javax.annotation.Nonnull; import java.util.Locale; -public enum AlchemicTypes implements ISubItem +public enum AlchemicVialType implements ISubItem { BASE(0x2e35ff); final int potionColour; - AlchemicTypes(int colour1) + AlchemicVialType(int colour1) { potionColour = colour1; } @@ -24,13 +24,6 @@ public enum AlchemicTypes implements ISubItem return name().toLowerCase(Locale.ROOT); } - @Nonnull - @Override - public ItemStack getStack() - { - return getStack(1); - } - @Nonnull @Override public ItemStack getStack(int count) @@ -49,11 +42,11 @@ public enum AlchemicTypes implements ISubItem public static int getColourForLayer(int variant, int layer) { - if (variant >= AlchemicTypes.values().length) + if (variant >= AlchemicVialType.values().length) { return -1; } - return AlchemicTypes.values()[variant].getColourForLayer(layer); + return AlchemicVialType.values()[variant].getColourForLayer(layer); } } diff --git a/src/main/java/WayofTime/bloodmagic/proxy/ClientProxy.java b/src/main/java/WayofTime/bloodmagic/proxy/ClientProxy.java index b6cc9e64..87256a18 100644 --- a/src/main/java/WayofTime/bloodmagic/proxy/ClientProxy.java +++ b/src/main/java/WayofTime/bloodmagic/proxy/ClientProxy.java @@ -13,7 +13,7 @@ import WayofTime.bloodmagic.entity.projectile.EntityBloodLight; import WayofTime.bloodmagic.entity.projectile.EntityMeteor; import WayofTime.bloodmagic.entity.projectile.EntitySentientArrow; import WayofTime.bloodmagic.entity.projectile.EntitySoulSnare; -import WayofTime.bloodmagic.item.types.AlchemicTypes; +import WayofTime.bloodmagic.item.types.AlchemicVialType; import WayofTime.bloodmagic.soul.DemonWillHolder; import WayofTime.bloodmagic.tile.*; import WayofTime.bloodmagic.tile.routing.TileRoutingNode; @@ -123,7 +123,7 @@ public class ClientProxy extends CommonProxy int variant = stack.getMetadata(); - return AlchemicTypes.getColourForLayer(variant, tintIndex); + return AlchemicVialType.getColourForLayer(variant, tintIndex); }, RegistrarBloodMagicItems.ALCHEMIC_VIAL); addElytraLayer();