Apply same model to all alchemic vials

This commit is contained in:
Nicholas Ignoffo 2018-03-23 16:42:18 -07:00
parent cdfc77be03
commit 7ec27febc6
4 changed files with 12 additions and 23 deletions

View file

@ -16,7 +16,6 @@ import WayofTime.bloodmagic.item.routing.ItemNodeRouter;
import WayofTime.bloodmagic.item.routing.ItemRouterFilter; import WayofTime.bloodmagic.item.routing.ItemRouterFilter;
import WayofTime.bloodmagic.item.sigil.*; import WayofTime.bloodmagic.item.sigil.*;
import WayofTime.bloodmagic.item.soul.*; import WayofTime.bloodmagic.item.soul.*;
import WayofTime.bloodmagic.item.types.AlchemicTypes;
import WayofTime.bloodmagic.item.types.ComponentTypes; import WayofTime.bloodmagic.item.types.ComponentTypes;
import WayofTime.bloodmagic.item.types.ShardType; import WayofTime.bloodmagic.item.types.ShardType;

View file

@ -1,22 +1,19 @@
package WayofTime.bloodmagic.item; package WayofTime.bloodmagic.item;
import WayofTime.bloodmagic.item.types.AlchemicVialType;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import javax.annotation.Nonnull; public class ItemAlchemicVial extends ItemEnum.Variant<AlchemicVialType>
import WayofTime.bloodmagic.item.types.AlchemicTypes;
import WayofTime.bloodmagic.item.types.ISubItem;
public class ItemAlchemicVial<T extends Enum<T> & ISubItem> extends ItemEnum.Variant<T>
{ {
public ItemAlchemicVial() public ItemAlchemicVial()
{ {
super((Class<T>) AlchemicTypes.class, "alchemic_vial"); super(AlchemicVialType.class, "alchemic_vial");
} }
@Override @Override
public void gatherVariants(@Nonnull Int2ObjectMap<String> variants) public void gatherVariants(Int2ObjectMap<String> variants)
{ {
variants.put(0, "type=normal"); for (AlchemicVialType type : types)
variants.put(type.ordinal(), "type=normal");
} }
} }

View file

@ -6,13 +6,13 @@ import net.minecraft.item.ItemStack;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import java.util.Locale; import java.util.Locale;
public enum AlchemicTypes implements ISubItem public enum AlchemicVialType implements ISubItem
{ {
BASE(0x2e35ff); BASE(0x2e35ff);
final int potionColour; final int potionColour;
AlchemicTypes(int colour1) AlchemicVialType(int colour1)
{ {
potionColour = colour1; potionColour = colour1;
} }
@ -24,13 +24,6 @@ public enum AlchemicTypes implements ISubItem
return name().toLowerCase(Locale.ROOT); return name().toLowerCase(Locale.ROOT);
} }
@Nonnull
@Override
public ItemStack getStack()
{
return getStack(1);
}
@Nonnull @Nonnull
@Override @Override
public ItemStack getStack(int count) public ItemStack getStack(int count)
@ -49,11 +42,11 @@ public enum AlchemicTypes implements ISubItem
public static int getColourForLayer(int variant, int layer) public static int getColourForLayer(int variant, int layer)
{ {
if (variant >= AlchemicTypes.values().length) if (variant >= AlchemicVialType.values().length)
{ {
return -1; return -1;
} }
return AlchemicTypes.values()[variant].getColourForLayer(layer); return AlchemicVialType.values()[variant].getColourForLayer(layer);
} }
} }

View file

@ -13,7 +13,7 @@ import WayofTime.bloodmagic.entity.projectile.EntityBloodLight;
import WayofTime.bloodmagic.entity.projectile.EntityMeteor; import WayofTime.bloodmagic.entity.projectile.EntityMeteor;
import WayofTime.bloodmagic.entity.projectile.EntitySentientArrow; import WayofTime.bloodmagic.entity.projectile.EntitySentientArrow;
import WayofTime.bloodmagic.entity.projectile.EntitySoulSnare; 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.soul.DemonWillHolder;
import WayofTime.bloodmagic.tile.*; import WayofTime.bloodmagic.tile.*;
import WayofTime.bloodmagic.tile.routing.TileRoutingNode; import WayofTime.bloodmagic.tile.routing.TileRoutingNode;
@ -123,7 +123,7 @@ public class ClientProxy extends CommonProxy
int variant = stack.getMetadata(); int variant = stack.getMetadata();
return AlchemicTypes.getColourForLayer(variant, tintIndex); return AlchemicVialType.getColourForLayer(variant, tintIndex);
}, RegistrarBloodMagicItems.ALCHEMIC_VIAL); }, RegistrarBloodMagicItems.ALCHEMIC_VIAL);
addElytraLayer(); addElytraLayer();