Flatten vial/flask

This commit is contained in:
Vincent Lee committed 2017-12-11 12:20:15 -06:00
1 parent cf3ab8d337
commit 68583d03d3
19 files changed
+45 -68

No files matched your search

@@ -28,7 +28,7 @@ public class BreweryRecipeWrapper implements IRecipeWrapper {
@SuppressWarnings("unchecked")
public BreweryRecipeWrapper(RecipeBrew recipeBrew) {
ImmutableList.Builder<List<ItemStack>> builder = ImmutableList.builder();
builder.add(ImmutableList.of(new ItemStack(ModItems.vial, 1, 0), new ItemStack(ModItems.vial, 1, 1)));
builder.add(ImmutableList.of(new ItemStack(ModItems.vial), new ItemStack(ModItems.flask)));
for(Object o : recipeBrew.getInputs()) {
if(o instanceof ItemStack) {
builder.add(ImmutableList.of((ItemStack) o));
@@ -39,7 +39,7 @@ public class BreweryRecipeWrapper implements IRecipeWrapper {
}
input = builder.build();
output = ImmutableList.of(recipeBrew.getOutput(new ItemStack(ModItems.vial)).copy(), recipeBrew.getOutput(new ItemStack(ModItems.vial, 1, 1)).copy());
output = ImmutableList.of(recipeBrew.getOutput(new ItemStack(ModItems.vial)).copy(), recipeBrew.getOutput(new ItemStack(ModItems.flask)).copy());
}
@Override
@@ -160,6 +160,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addBlock(ModBlocks.terraPlate);
addBlock(ModBlocks.brewery);
addItem(ModItems.vial);
addItem(ModItems.flask);
addItem(ModItems.brewVial);
addItem(ModItems.brewFlask);
addBlock(ModBlocks.incensePlate);
@@ -561,8 +561,8 @@ public final class ModCraftingRecipes {
recipeCraftCrate = path("opencrate_1");
recipesPatterns = allOfGroup("craftpattern");
recipeBrewery = ModBlocks.brewery.getRegistryName();
recipeVial = path("vial_0");
recipeFlask = path("vial_1");
recipeVial = ModItems.vial.getRegistryName();
recipeFlask = ModItems.flask.getRegistryName();
recipeIncenseStick = ModItems.incenseStick.getRegistryName();
recipeIncensePlate = ModBlocks.incensePlate.getRegistryName();
recipeHourglass = ModBlocks.hourglass.getRegistryName();
@@ -21,7 +21,14 @@ public class FlattenItems implements IFixableData {
// support ancient prismarine from 1.7
return "minecraft:prismarine_shard";
} else {
return LibMisc.MOD_ID + ":" + LibItemNames.MANA_RESOURCE_NAMES[i].toLowerCase(Locale.ROOT);
return LibMisc.MOD_ID + ":" + LibItemNames.MANA_RESOURCE_NAMES[i % LibItemNames.MANA_RESOURCE_NAMES.length].toLowerCase(Locale.ROOT);
}
});
LOOKUP.put("botania:vial", i -> {
if (i == 1) {
return LibMisc.MOD_ID + ":" + LibItemNames.FLASK;
} else {
return LibMisc.MOD_ID + ":" + LibItemNames.VIAL;
}
});
}
@@ -205,7 +205,8 @@ public final class ModItems {
public static final Item diviningRod = new ItemDiviningRod();
public static final Item gravityRod = new ItemGravityRod();
public static final Item manaInkwell = new ItemManaInkwell();
public static final Item vial = new ItemVial();
public static final Item vial = new ItemVial(LibItemNames.VIAL);
public static final Item flask = new ItemVial(LibItemNames.FLASK);
public static final Item brewVial = new ItemBrewVial();
public static final Item brewFlask = new ItemBrewFlask();
public static final Item bloodPendant = new ItemBloodPendant();
@@ -384,6 +385,7 @@ public final class ModItems {
r.register(gravityRod);
r.register(manaInkwell);
r.register(vial);
r.register(flask);
r.register(brewVial);
r.register(brewFlask);
r.register(bloodPendant);
@@ -490,8 +492,8 @@ public final class ModItems {
OreDictionary.registerOre(LibOreDict.MANAWEAVE_CLOTH, new ItemStack(manaweaveCloth));
OreDictionary.registerOre(LibOreDict.MANA_POWDER, new ItemStack(manaPowder));
OreDictionary.registerOre(LibOreDict.VIAL, new ItemStack(vial, 1, 0));
OreDictionary.registerOre(LibOreDict.FLASK, new ItemStack(vial, 1, 1));
OreDictionary.registerOre(LibOreDict.VIAL, new ItemStack(vial));
OreDictionary.registerOre(LibOreDict.FLASK, new ItemStack(flask));
BotaniaAPI.blackListItemFromLoonium(lexicon);
BotaniaAPI.blackListItemFromLoonium(overgrowthSeed);
@@ -17,7 +17,7 @@ import vazkii.botania.common.lib.LibItemNames;
public class ItemBrewFlask extends ItemBrewBase {
public ItemBrewFlask() {
super(LibItemNames.BREW_FLASK, 6, 24, new ItemStack(ModItems.vial, 1, 1));
super(LibItemNames.BREW_FLASK, 6, 24, new ItemStack(ModItems.flask));
}
}
@@ -10,63 +10,31 @@
*/
package vazkii.botania.common.item.brew;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import vazkii.botania.api.brew.Brew;
import vazkii.botania.api.brew.IBrewContainer;
import vazkii.botania.common.item.ItemMod;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibItemNames;
import javax.annotation.Nonnull;
public class ItemVial extends ItemMod implements IBrewContainer {
public ItemVial() {
this(LibItemNames.VIAL);
}
public ItemVial(String name) {
super(name);
setHasSubtypes(true);
}
@Override
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> list) {
if(isInCreativeTab(tab)) {
for(int i = 0; i < 2; i++)
list.add(new ItemStack(this, 1, i));
}
}
@Nonnull
@Override
public String getUnlocalizedName(ItemStack par1ItemStack) {
return super.getUnlocalizedName(par1ItemStack) + par1ItemStack.getItemDamage();
}
@Override
public ItemStack getItemForBrew(Brew brew, ItemStack stack) {
ItemStack brewStack = new ItemStack(stack.getItemDamage() == 1 ? ModItems.brewFlask : ModItems.brewVial);
ItemStack brewStack = new ItemStack(this == ModItems.flask ? ModItems.brewFlask : ModItems.brewVial);
ItemBrewBase.setBrew(brewStack, brew);
return brewStack;
}
@Override
public int getManaCost(Brew brew, ItemStack stack) {
return brew.getManaCost() * (stack.getItemDamage() + 1);
if (this == ModItems.flask) {
return brew.getManaCost() * 2;
} else {
return brew.getManaCost();
}
}
@SideOnly(Side.CLIENT)
@Override
public void registerModels() {
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation("botania:vial", "inventory"));
ModelLoader.setCustomModelResourceLocation(this, 1, new ModelResourceLocation("botania:flask", "inventory"));
}
}
@@ -61,7 +61,7 @@ public class PageBrew extends PageRecipe implements ITwoNamedPage {
ItemStack book = PlayerHelper.getFirstHeldItemClass(Minecraft.getMinecraft().player, ILexicon.class);
if(book != null && ((ILexicon) book.getItem()).isKnowledgeUnlocked(book, BotaniaAPI.elvenKnowledge)) {
renderItemAtLinePos(gui, 20, 2, y + 12, recipe.getOutput(new ItemStack(ModItems.vial)));
renderItemAtLinePos(gui, 20, 3, y + 12, recipe.getOutput(new ItemStack(ModItems.vial, 1, 1)));
renderItemAtLinePos(gui, 20, 3, y + 12, recipe.getOutput(new ItemStack(ModItems.flask)));
} else renderItemAtLinePos(gui, 0, -1, y + 12, recipe.getOutput(new ItemStack(ModItems.vial)));
int i = 0;
@@ -1470,8 +1470,8 @@ item.botania:diviningRod.name=Rod of the Plentiful Mantle
item.botania:gravityRod.name=Rod of the Shaded Mesa
item.botania:regenIvy.name=Timeless Ivy
item.botania:manaInkwell.name=Botanurgist's Inkwell
item.botania:vial0.name=Managlass Vial
item.botania:vial1.name=Alfglass Flask
item.botania:vial.name=Managlass Vial
item.botania:flask.name=Alfglass Flask
item.botania:brewVial.name=Vial of %s (%s)
item.botania:brewFlask.name=Flask of %s (%s)
item.botania:bloodPendant.name=Tainted Blood Pendant
@@ -1230,8 +1230,8 @@ item.botania:diviningRod.name=Vara de manto abundante
item.botania:gravityRod.name=Vara de mesa sombría
item.botania:regenIvy.name=Hiedra eterna
item.botania:manaInkwell.name=Tintero del Botanurgista
item.botania:vial0.name=Vial de manacristal
item.botania:vial1.name=Matraz de alfcristal
item.botania:vial.name=Vial de manacristal
item.botania:flask.name=Matraz de alfcristal
item.botania:brewVial.name=Vial de %s (%s)
item.botania:brewFlask.name=Matraz de %s (%s)
item.botania:bloodPendant.name=Colgante de sangre corrupta
@@ -1092,8 +1092,8 @@ item.botania:diviningRod.name=Bâton du manteau abondant
item.botania:gravityRod.name=Bâton de la mesa hachurée
item.botania:regenIvy.name=Lierre éternel
item.botania:manaInkwell.name=Encrier du botanurgiste
item.botania:vial0.name=Fiole en verre de mana
item.botania:vial1.name=Flasque en verre elfique
item.botania:vial.name=Fiole en verre de mana
item.botania:flask.name=Flasque en verre elfique
item.botania:brewVial.name=Fiole de %s (%s)
item.botania:brewFlask.name=Flasque de %s (%s)
item.botania:bloodPendant.name=Pendentif de sang infecté
@@ -1255,8 +1255,8 @@ item.botania:diviningRod.name=豊富なマントルの杖
item.botania:gravityRod.name=暗がりのメサの杖
item.botania:regenIvy.name=永遠のツタ
item.botania:manaInkwell.name=植物魔法学者のインク瓶
item.botania:vial0.name=マナガラスの小瓶
item.botania:vial1.name=アルフガラスのフラスコ
item.botania:vial.name=マナガラスの小瓶
item.botania:flask.name=アルフガラスのフラスコ
item.botania:brewVial.name=%s (%s) の小瓶
item.botania:brewFlask.name=%s (%s) のフラスコ
item.botania:bloodPendant.name=汚染された血のペンダント
@@ -1191,8 +1191,8 @@ item.botania:diviningRod.name=나눗셈의 막대
item.botania:gravityRod.name=블랙메사의 막대
item.botania:regenIvy.name=시간을 초월한 아이비
item.botania:manaInkwell.name=식물학자의 잉크 통
item.botania:vial0.name=마나유리병
item.botania:vial1.name=엘프유리 플라스트
item.botania:vial.name=마나유리병
item.botania:flask.name=엘프유리 플라스트
item.botania:brewVial.name=%s의 물약 (%s)
item.botania:brewFlask.name=%s의 물약 (%s)
item.botania:bloodPendant.name=더럽혀진 피의 펜던트
@@ -1323,8 +1323,8 @@ item.botania:diviningRod.name=Wichelroede
item.botania:gravityRod.name=Staf van het Schaduw Plateau
item.botania:regenIvy.name=Tijdloze Klimop
item.botania:manaInkwell.name=Botanisten Inktpot
item.botania:vial0.name=Flacon Managlas
item.botania:vial1.name=Flesje Elvenglas
item.botania:vial.name=Flacon Managlas
item.botania:flask.name=Flesje Elvenglas
item.botania:brewVial.name=Flacon %s (%s)
item.botania:brewFlask.name=Flesje %s (%s)
item.botania:bloodPendant.name=Bedorven Bloed Hanger
@@ -1473,8 +1473,8 @@ item.botania:diviningRod.name=Cajado do Manto Pleno
item.botania:gravityRod.name=Cajado da Mesa Sombria
item.botania:regenIvy.name=Hera Eterna
item.botania:manaInkwell.name=Tinteiro do Botanurgista
item.botania:vial0.name=Frasco Pequeno
item.botania:vial1.name=Frasco de Vidro Élfico
item.botania:vial.name=Frasco Pequeno
item.botania:flask.name=Frasco de Vidro Élfico
item.botania:brewVial.name=Frasco Pequeno de %s (%s)
item.botania:brewFlask.name=Frasco de %s (%s)
item.botania:bloodPendant.name=Pingente de Sangue
@@ -1470,8 +1470,8 @@ item.botania:diviningRod.name=占矿法杖
item.botania:gravityRod.name=黑山法杖
item.botania:regenIvy.name=永恒常春藤
item.botania:manaInkwell.name=植物学家的笔墨
item.botania:vial0.name=魔法玻璃小瓶
item.botania:vial1.name=精灵玻璃烧瓶
item.botania:vial.name=魔法玻璃小瓶
item.botania:flask.name=精灵玻璃烧瓶
item.botania:brewVial.name=装有%s (%s)的小瓶
item.botania:brewFlask.name=装有%s (%s)的烧瓶
item.botania:bloodPendant.name=污血吊坠
@@ -1436,8 +1436,8 @@ item.botania:diviningRod.name=占礦法杖
item.botania:gravityRod.name=黑山法杖
item.botania:regenIvy.name=永恆常春籐
item.botania:manaInkwell.name=植物學家的筆墨
item.botania:vial0.name=瑪那玻璃小瓶
item.botania:vial1.name=精靈玻璃燒瓶
item.botania:vial.name=瑪那玻璃小瓶
item.botania:flask.name=精靈玻璃燒瓶
item.botania:brewVial.name=裝有%s (%s)的小瓶
item.botania:brewFlask.name=裝有%s (%s)的燒瓶
item.botania:bloodPendant.name=污血吊墜
@@ -1,7 +1,6 @@
{
"result": {
"item": "botania:vial",
"data": 1,
"item": "botania:flask",
"count": 3
},
"pattern": [