It's a tiny potato, it believes in you, you can do the thing!

This commit is contained in:
Vasco Lavos committed 2014-07-19 00:27:58 +01:00
1 parent 8d333dc418
commit c225a13404
17 files changed
+308 -7

No files matched your search

@@ -35,6 +35,7 @@ import vazkii.botania.client.render.block.RenderPool;
import vazkii.botania.client.render.block.RenderPylon;
import vazkii.botania.client.render.block.RenderSpecialFlower;
import vazkii.botania.client.render.block.RenderSpreader;
import vazkii.botania.client.render.block.RenderTinyPotato;
import vazkii.botania.client.render.entity.RenderDoppleganger;
import vazkii.botania.client.render.entity.RenderPixie;
import vazkii.botania.client.render.item.RenderLens;
@@ -47,12 +48,14 @@ import vazkii.botania.client.render.tile.RenderTilePool;
import vazkii.botania.client.render.tile.RenderTilePylon;
import vazkii.botania.client.render.tile.RenderTileRuneAltar;
import vazkii.botania.client.render.tile.RenderTileSpreader;
import vazkii.botania.client.render.tile.RenderTileTinyPotato;
import vazkii.botania.common.block.tile.TileAlfPortal;
import vazkii.botania.common.block.tile.TileAltar;
import vazkii.botania.common.block.tile.TileEnchanter;
import vazkii.botania.common.block.tile.TileMiniIsland;
import vazkii.botania.common.block.tile.TilePylon;
import vazkii.botania.common.block.tile.TileRuneAltar;
import vazkii.botania.common.block.tile.TileTinyPotato;
import vazkii.botania.common.block.tile.mana.TilePool;
import vazkii.botania.common.block.tile.mana.TileSpreader;
import vazkii.botania.common.core.handler.ConfigHandler;
@@ -100,6 +103,7 @@ public class ClientProxy extends CommonProxy {
RenderingRegistry.registerBlockHandler(new RenderPool());
RenderingRegistry.registerBlockHandler(new RenderPylon());
RenderingRegistry.registerBlockHandler(new RenderMiniIsland());
RenderingRegistry.registerBlockHandler(new RenderTinyPotato());
MinecraftForgeClient.registerItemRenderer(ModItems.lens, new RenderLens());
if(ConfigHandler.lexicon3dModel)
@@ -113,6 +117,7 @@ public class ClientProxy extends CommonProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEnchanter.class, new RenderTileEnchanter());
ClientRegistry.bindTileEntitySpecialRenderer(TileAlfPortal.class, new RenderTileAlfPortal());
ClientRegistry.bindTileEntitySpecialRenderer(TileMiniIsland.class, new RenderTileMiniIsland());
ClientRegistry.bindTileEntitySpecialRenderer(TileTinyPotato.class, new RenderTileTinyPotato());
RenderingRegistry.registerEntityRenderingHandler(EntityPixie.class, new RenderPixie());
RenderingRegistry.registerEntityRenderingHandler(EntityVineBall.class, new RenderSnowball(ModItems.vineBall));
@@ -19,5 +19,6 @@ public final class LibRenderIDs {
public static int idPool = -1;
public static int idPylon = -1;
public static int idMiniIsland = -1;
public static int idTinyPotato = -1;
}
@@ -76,6 +76,7 @@ public final class LibResources {
public static final String MODEL_ELEMENTIUM_1 = PREFIX_MODEL + "elementium1.png";
public static final String MODEL_PIXIE = PREFIX_MODEL + "pixie.png";
public static final String MODEL_MINI_ISLAND = PREFIX_MODEL + "miniIsland.png";
public static final String MODEL_TINY_POTATO = PREFIX_MODEL + "tinyPotato.png";
public static final String MODEL_CAPE = "/assets/botania/textures/model/cape.png";
@@ -0,0 +1,36 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* File Created @ [Jul 18, 2014, 7:55:34 PM (GMT)]
*/
package vazkii.botania.client.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelTinyPotato extends ModelBase {
ModelRenderer potato;
public ModelTinyPotato() {
textureWidth = 64;
textureHeight = 32;
potato = new ModelRenderer(this, 0, 0);
potato.addBox(0F, 0F, 0F, 4, 6, 4);
potato.setRotationPoint(-2F, 18F, -2F);
potato.setTextureSize(64, 32);
}
public void render() {
potato.render(1F / 16F);
}
}
@@ -0,0 +1,50 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* File Created @ [Jul 18, 2014, 11:43:37 PM (GMT)]
*/
package vazkii.botania.client.render.block;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.common.block.tile.TileTinyPotato;
import vazkii.botania.common.block.tile.mana.TileSpreader;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class RenderTinyPotato implements ISimpleBlockRenderingHandler {
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
GL11.glPushMatrix();
GL11.glTranslatef(-0.5F, 0F, -0.5F);
TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileTinyPotato(), 0.0D, 0.0D, 0.0D, 0.0F);
GL11.glPopMatrix();
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
return false;
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
}
@Override
public int getRenderId() {
return LibRenderIDs.idTinyPotato;
}
}
@@ -0,0 +1,61 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* File Created @ [Jul 18, 2014, 10:48:46 PM (GMT)]
*/
package vazkii.botania.client.render.tile;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelPool;
import vazkii.botania.client.model.ModelTinyPotato;
import vazkii.botania.common.block.tile.TileTinyPlanet;
import vazkii.botania.common.block.tile.TileTinyPotato;
import vazkii.botania.common.block.tile.mana.TilePool;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
public class RenderTileTinyPotato extends TileEntitySpecialRenderer {
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_TINY_POTATO);
private static final ModelTinyPotato model = new ModelTinyPotato();
@Override
public void renderTileEntityAt(TileEntity var1, double d0, double d1, double d2, float var8) {
TileTinyPotato potato = (TileTinyPotato) var1;
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glTranslated(d0, d1, d2);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
GL11.glScalef(1F, -1F, -1F);
int meta = potato.getWorldObj() == null ? 3 : potato.getBlockMetadata();
GL11.glRotatef(meta * 90F - 180F, 0F, 1F, 0F);
int jump = potato.jumpTicks;
float up = (float) -Math.abs(Math.sin((float) jump / 10 * Math.PI)) * 0.2F;
float rot = (float) Math.sin((float) jump / 10 * Math.PI) * 2;
GL11.glTranslatef(0F, up, 0F);
GL11.glRotatef(rot, 0F, 0F, 1F);
model.render();
GL11.glColor3f(1F, 1F, 1F);
GL11.glScalef(1F, -1F, -1F);
GL11.glPopMatrix();
}
}
@@ -0,0 +1,91 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* File Created @ [Jul 18, 2014, 7:58:08 PM (GMT)]
*/
package vazkii.botania.common.block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.common.block.tile.TileTinyPotato;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockTinyPotato extends BlockModContainer implements ILexiconable {
protected BlockTinyPotato() {
super(Material.cloth);
setHardness(0.25F);
setBlockName(LibBlockNames.TINY_POTATO);
float f = 1F / 16F * 6F;
setBlockBounds(f, 0, f, 1F - f, f, 1F - f);
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
// NO-OP
}
@Override
public IIcon getIcon(int side, int meta) {
return Blocks.hardened_clay.getIcon(0, 0);
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
if(tile instanceof TileTinyPotato)
((TileTinyPotato) tile).jump();
return true;
}
@Override
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) {
int l1 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
par1World.setBlockMetadataWithNotify(par2, par3, par4, l1, 2);
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public int getRenderType() {
return LibRenderIDs.idTinyPotato;
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileTinyPotato();
}
@Override
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
return LexiconData.tinyPotato;
}
}
@@ -90,6 +90,7 @@ import vazkii.botania.common.block.tile.TilePylon;
import vazkii.botania.common.block.tile.TileRuneAltar;
import vazkii.botania.common.block.tile.TileSpecialFlower;
import vazkii.botania.common.block.tile.TileTinyPlanet;
import vazkii.botania.common.block.tile.TileTinyPotato;
import vazkii.botania.common.block.tile.mana.TileDistributor;
import vazkii.botania.common.block.tile.mana.TileManaDetector;
import vazkii.botania.common.block.tile.mana.TileManaVoid;
@@ -138,6 +139,7 @@ public final class ModBlocks {
public static Block prismarine;
public static Block seaLamp;
public static Block miniIsland;
public static Block tinyPotato;
public static Block livingwoodStairs;
public static Block livingwoodSlab;
@@ -228,7 +230,8 @@ public final class ModBlocks {
prismarine = new BlockPrismarine();
seaLamp = new BlockSeaLamp();
miniIsland = new BlockMiniIsland();
tinyPotato = new BlockTinyPotato();
livingwoodStairs = new BlockLivingwoodStairs();
livingwoodSlab = new BlockLivingwoodSlab(false);
livingwoodSlabFull = new BlockLivingwoodSlab(true);
@@ -365,6 +368,7 @@ public final class ModBlocks {
registerTile(TileAlfPortal.class, LibBlockNames.ALF_PORTAL);
registerTile(TileBifrost.class, LibBlockNames.BIFROST);
registerTile(TileMiniIsland.class, LibBlockNames.MINI_ISLAND);
registerTile(TileTinyPotato.class, LibBlockNames.TINY_POTATO);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_PUREDAISY, SubTilePureDaisy.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_MANASTAR, SubTileManastar.class);
@@ -88,16 +88,17 @@ public class SubTileDaffomill extends SubTileFunctional {
@Override
public boolean onWanded(EntityPlayer player, ItemStack wand) {
if(player == null || player.worldObj.isRemote)
if(player == null)
return false;
if(player.isSneaking()) {
orientation = orientation == 3 ? 0 : orientation + 1;
sync();
if(!player.worldObj.isRemote) {
orientation = orientation == 3 ? 0 : orientation + 1;
sync();
}
return true;
}
else return super.onWanded(player, wand);
} else return super.onWanded(player, wand);
}
@Override
@@ -0,0 +1,36 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* File Created @ [Jul 18, 2014, 8:05:08 PM (GMT)]
*/
package vazkii.botania.common.block.tile;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class TileTinyPotato extends TileMod {
public int jumpTicks = 0;
public void jump() {
if(jumpTicks == 0)
jumpTicks = 20;
}
@Override
public void updateEntity() {
if(worldObj.rand.nextInt(100) == 0)
jump();
if(jumpTicks > 0)
jumpTicks--;
}
}
@@ -86,6 +86,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addBlock(ModBlocks.pistonRelay);
addBlock(ModBlocks.shinyFlower);
addBlock(ModBlocks.miniIsland);
addBlock(ModBlocks.tinyPotato);
addBlock(ModBlocks.unstableBlock);
addBlock(ModBlocks.manaBeacon);
addItem(ModItems.signalFlare);
@@ -35,6 +35,7 @@ public final class ModManaInfusionRecipes {
public static RecipeManaInfusion podzolSeedsRecipe;
public static List<RecipeManaInfusion> mycelSeedsRecipes;
public static RecipeManaInfusion manaQuartzRecipe;
public static RecipeManaInfusion tinyPotatoRecipe;
public static void init() {
manaPetalRecipes = new ArrayList();
@@ -57,7 +58,8 @@ public final class ModManaInfusionRecipes {
mycelSeedsRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds, 1, 2), new ItemStack(Blocks.brown_mushroom), 6500));
manaQuartzRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.quartz, 1, 1), new ItemStack(Items.quartz), 250);
tinyPotatoRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.tinyPotato), new ItemStack(Items.potato), 1337);
BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaBottle), new ItemStack(Items.glass_bottle), 5000);
}
@@ -161,6 +161,7 @@ public final class LexiconData {
public static LexiconEntry shinyFlowers;
public static LexiconEntry prismarine;
public static LexiconEntry shedding;
public static LexiconEntry tinyPotato;
public static void init() {
BotaniaAPI.addCategory(categoryBasics = new LexiconCategory(LibLexicon.CATEGORY_BASICS));
@@ -535,5 +536,8 @@ public final class LexiconData {
shedding = new BLexiconEntry(LibLexicon.MISC_SHEDDING, categoryMisc);
shedding.setLexiconPages(new PageText("0"));
tinyPotato = new BLexiconEntry(LibLexicon.MISC_TINY_POTATO, categoryMisc);
tinyPotato.setLexiconPages(new PageText("0"), new PageManaInfusionRecipe("1", ModManaInfusionRecipes.tinyPotatoRecipe));
}
}
@@ -48,6 +48,7 @@ public final class LibBlockNames {
public static final String PRISMARINE = "prismarine";
public static final String SEA_LAMP = "seaLamp";
public static final String MINI_ISLAND = "miniIsland";
public static final String TINY_POTATO = "tinyPotato";
public static final String SPECIAL_FLOWER_PREFIX = FLOWER + ".";
@@ -138,5 +138,6 @@ public final class LibLexicon {
public static final String MISC_SHINY_FLOWERS = "shinyFlowers";
public static final String MISC_PRISMARINE = "prismarine";
public static final String MISC_SHEDDING = "shedding";
public static final String MISC_TINY_POTATO = "tinyPotato";
}
+6
View File
@@ -347,6 +347,7 @@ tile.botania:miniIsland12.name=Floating Brown Flower
tile.botania:miniIsland13.name=Floating Green Flower
tile.botania:miniIsland14.name=Floating Red Flower
tile.botania:miniIsland15.name=Floating Black Flower
tile.botania:tinyPotato.name=Tiny Potato
# FLOWER NAMES
tile.botania:flower..name=Botania Flower
@@ -1365,3 +1366,8 @@ botania.page.prismarine6=Crafting the &1Sea Lantern&0
# -- NATURAL SHEDDING
botania.entry.shedding=Natural Shedding
botania.page.shedding0=The living beings that inhabit our lands don't live in a static state. It's common for pieces of their body to fall out, &1Feathers&0 on &4Chickens&0, &1Bones&0 on &4Skeletons&0, so on.<br>Even the tough &4Ghasts&0 sometimes shed a tear or the &4Villagers&0 accidently drop an &1Emerald&0 and can't pick it back up because their arms are stuck together for some reason.
# -- TINY POTATO
botania.entry.tinyPotato=Tiny Potato
botania.page.tinyPotato0=It's a tiny potato, it believes in you, you can do the thing.<br>No really, that's it, by tossing a &1Potato&0 in a &1Mana Pool&0, the potato gains a little lively essence and happy feeling. It's a lively one, giving it a right click will make it even more so!
botania.page.tinyPotato1=Put it on Kickstarter, it'll work
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB