mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Added Petal Apothecary variants craftable using the stone acquired with the Marimorphosis.
This commit is contained in:
1 parent
25447f0a25
commit
f5bcf80d7c
16 files changed
+72
-10
No files matched your search
@@ -69,6 +69,7 @@ public final class LibResources {
|
||||
public static final String ENTRY_METAMORPHIC_STONES = PREFIX_ENTRIES + "metamorphicStones.png";
|
||||
|
||||
public static final String MODEL_ALTAR = PREFIX_MODEL + "altar.png";
|
||||
public static final String MODEL_ALTAR_META = PREFIX_MODEL + "altarMeta%d.png";
|
||||
public static final String MODEL_ALTAR_MOSSY = PREFIX_MODEL + "altarMossy.png";
|
||||
public static final String MODEL_SPREADER = PREFIX_MODEL + "spreader.png";
|
||||
public static final String MODEL_SPREADER_REDSTONE = PREFIX_MODEL + "spreaderRedstone.png";
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.world.IBlockAccess;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.client.render.tile.RenderTileAltar;
|
||||
import vazkii.botania.common.block.tile.TileAltar;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
||||
@@ -28,6 +29,7 @@ public class RenderAltar implements ISimpleBlockRenderingHandler {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(-0.5F, -0.6F, -0.5F);
|
||||
GL11.glScalef(0.9F, 0.9F, 0.9F);
|
||||
RenderTileAltar.forceMeta = metadata;
|
||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileAltar(), 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -35,12 +35,24 @@ import vazkii.botania.common.block.tile.TileAltar;
|
||||
|
||||
public class RenderTileAltar extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_ALTAR);
|
||||
private static final ResourceLocation[] textures = new ResourceLocation[] {
|
||||
new ResourceLocation(LibResources.MODEL_ALTAR),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 0)),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 1)),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 2)),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 3)),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 4)),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 5)),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 6)),
|
||||
new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 7))
|
||||
};
|
||||
|
||||
private static final ResourceLocation textureMossy = new ResourceLocation(LibResources.MODEL_ALTAR_MOSSY);
|
||||
|
||||
|
||||
ModelAltar model = new ModelAltar();
|
||||
RenderItem renderItem = new RenderItem();
|
||||
|
||||
public static int forceMeta = -1;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks) {
|
||||
TileAltar altar = (TileAltar) tileentity;
|
||||
@@ -48,8 +60,8 @@ public class RenderTileAltar extends TileEntitySpecialRenderer {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(altar.isMossy ? textureMossy : texture);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(altar.isMossy ? textureMossy : textures[Math.min(textures.length - 1, forceMeta == -1 ? tileentity.getBlockMetadata() : forceMeta)]);
|
||||
|
||||
GL11.glTranslated(d0 + 0.5, d1 + 1.5, d2 + 0.5);
|
||||
GL11.glScalef(1F, -1F, -1F);
|
||||
model.render();
|
||||
@@ -151,6 +163,8 @@ public class RenderTileAltar extends TileEntitySpecialRenderer {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
|
||||
forceMeta = -1;
|
||||
}
|
||||
|
||||
public void renderIcon(int par1, int par2, IIcon par3Icon, int par4, int par5, int brightness) {
|
||||
|
||||
@@ -10,16 +10,20 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -37,6 +41,7 @@ import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.tile.TileAltar;
|
||||
import vazkii.botania.common.block.tile.TileSimpleInventory;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
|
||||
import vazkii.botania.common.item.rod.ItemWaterRod;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
@@ -62,6 +67,23 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldRegisterInNameSet() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setBlockName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str);
|
||||
return super.setBlockName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for(int i = 0; i < 9; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
|
||||
if(par5Entity instanceof EntityItem) {
|
||||
@@ -137,6 +159,11 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
private boolean isValidWaterContainer(ItemStack stack) {
|
||||
if (stack.stackSize != 1)
|
||||
return false;
|
||||
@@ -160,7 +187,7 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return Blocks.cobblestone.getIcon(par1, par2);
|
||||
return par2 == 0 ? Blocks.cobblestone.getIcon(par1, par2) : ModFluffBlocks.biomeStoneA.getIcon(par1, par2 + 7);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,7 +48,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I
|
||||
if(stack == null || item.isDead)
|
||||
return false;
|
||||
|
||||
if(!isMossy) {
|
||||
if(!isMossy && getBlockMetadata() == 0) {
|
||||
if(stack.getItem() == Item.getItemFromBlock(Blocks.vine) && !worldObj.isRemote) {
|
||||
isMossy = true;
|
||||
worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
|
||||
|
||||
@@ -254,6 +254,7 @@ public final class ModCraftingRecipes {
|
||||
public static List<IRecipe> recipe18StoneBrick;
|
||||
public static List<IRecipe> recipe18StoneChisel;
|
||||
public static IRecipe recipeBlazeBlock;
|
||||
public static List<IRecipe> recipesAltarMeta;
|
||||
|
||||
public static void init() {
|
||||
// Lexicon Recipe
|
||||
@@ -1685,6 +1686,14 @@ public final class ModCraftingRecipes {
|
||||
recipeBlazeBlock = BotaniaAPI.getLatestAddedRecipe();
|
||||
addShapelessOreDictRecipe(new ItemStack(Items.blaze_rod, 9), LibOreDict.BLAZE_BLOCK);
|
||||
|
||||
// Metamorphic Petal Apothecary Recipes
|
||||
for(int i = 0; i < 8; i++)
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.altar, 1, i + 1),
|
||||
"SSS", "SAS", "SSS",
|
||||
'S', new ItemStack(ModFluffBlocks.biomeStoneA, 1, i + 8),
|
||||
'A', new ItemStack(ModBlocks.altar));
|
||||
recipesAltarMeta = BotaniaAPI.getLatestAddedRecipes(8);
|
||||
|
||||
// Storage Block Recipes
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0),
|
||||
"III", "III", "III",
|
||||
|
||||
@@ -459,7 +459,7 @@ public final class LexiconData {
|
||||
medumone.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.medumoneRecipe));
|
||||
|
||||
marimorphosis = new BLexiconEntry(LibLexicon.FFLOWER_MARIMORPHOSIS, categoryFunctionalFlowers);
|
||||
marimorphosis.setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_METAMORPHIC_STONES), new PagePetalRecipe("2", ModPetalRecipes.marimorphosisRecipe));
|
||||
marimorphosis.setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_METAMORPHIC_STONES), new PagePetalRecipe("2", ModPetalRecipes.marimorphosisRecipe), new PageCraftingRecipe("3", ModCraftingRecipes.recipesAltarMeta));
|
||||
|
||||
bubbell = new ALexiconEntry(LibLexicon.FFLOWER_BUBBELL, categoryFunctionalFlowers);
|
||||
bubbell.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.bubbellRecipe));
|
||||
|
||||
Reference in new issue
Block a user