Added the Corporea Crystal Cube. Doesn't do anything yet.

This commit is contained in:
Lizbeth Rika committed 2015-04-30 16:27:12 +01:00
1 parent 79c87cce76
commit 0b58cf8c2a
11 files changed
+180 -3

No files matched your search

@@ -78,6 +78,7 @@ import vazkii.botania.client.render.item.RenderTransparentItem;
import vazkii.botania.client.render.tile.RenderTileAlfPortal;
import vazkii.botania.client.render.tile.RenderTileAltar;
import vazkii.botania.client.render.tile.RenderTileBrewery;
import vazkii.botania.client.render.tile.RenderTileCorporeaCrystalCube;
import vazkii.botania.client.render.tile.RenderTileCorporeaIndex;
import vazkii.botania.client.render.tile.RenderTileEnchanter;
import vazkii.botania.client.render.tile.RenderTileFloatingFlower;
@@ -106,6 +107,7 @@ import vazkii.botania.common.block.tile.TileSpawnerClaw;
import vazkii.botania.common.block.tile.TileStarfield;
import vazkii.botania.common.block.tile.TileTerraPlate;
import vazkii.botania.common.block.tile.TileTinyPotato;
import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube;
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
import vazkii.botania.common.block.tile.mana.TilePool;
import vazkii.botania.common.block.tile.mana.TilePrism;
@@ -179,6 +181,7 @@ public class ClientProxy extends CommonProxy {
LibRenderIDs.idCorporeaIndex = RenderingRegistry.getNextAvailableRenderId();
LibRenderIDs.idPump = RenderingRegistry.getNextAvailableRenderId();
LibRenderIDs.idDoubleFlower = RenderingRegistry.getNextAvailableRenderId();
LibRenderIDs.idCorporeaCrystalCybe = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new RenderAltar());
RenderingRegistry.registerBlockHandler(new RenderSpecialFlower(LibRenderIDs.idSpecialFlower));
@@ -226,6 +229,7 @@ public class ClientProxy extends CommonProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TilePrism.class, new RenderTilePrism());
ClientRegistry.bindTileEntitySpecialRenderer(TileCorporeaIndex.class, new RenderTileCorporeaIndex());
ClientRegistry.bindTileEntitySpecialRenderer(TilePump.class, new RenderTilePump());
ClientRegistry.bindTileEntitySpecialRenderer(TileCorporeaCrystalCube.class, new RenderTileCorporeaCrystalCube());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySkull.class, new RenderTileSkullOverride());
@@ -24,5 +24,6 @@ public final class LibRenderIDs {
public static int idCorporeaIndex = -1;
public static int idPump = -1;
public static int idDoubleFlower = -1;
public static int idCorporeaCrystalCybe = -1;
}
@@ -110,6 +110,7 @@ public final class LibResources {
public static final String MODEL_MINI_ISLAND_MYCEL = PREFIX_MODEL + "miniIslandMycelium.png";
public static final String MODEL_MINI_ISLAND_SNOW = PREFIX_MODEL + "miniIslandSnow.png";
public static final String MODEL_PINK_WITHER = PREFIX_MODEL + "pinkWither.png";
public static final String MODEL_CRYSTAL_CUBE = PREFIX_MODEL + "crystalCube.png";
public static final String MISC_PARTICLES = PREFIX_MISC + "particles.png";
public static final String MISC_WISP_LARGE = PREFIX_MISC + "wispLarge.png";
@@ -34,11 +34,15 @@ public class ModelCrystalCube extends ModelBase {
this.base1.addChild(this.base2);
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
this.cube.render(f5);
public void renderBase() {
float f5 = 1F / 16F;
this.base1.render(f5);
}
public void renderCube() {
float f5 = 1F / 16F;
this.cube.render(f5);
}
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x;
@@ -0,0 +1,64 @@
/**
* 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 the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [Apr 30, 2015, 4:10:14 PM (GMT)]
*/
package vazkii.botania.client.render.tile;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.api.mana.IPoolOverlayProvider;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelCrystalCube;
import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube;
import vazkii.botania.common.block.tile.mana.TilePool;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer {
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_CRYSTAL_CUBE);
ModelCrystalCube model = new ModelCrystalCube();
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
TileCorporeaCrystalCube cube = (TileCorporeaCrystalCube) tileentity;
double time = ClientTickHandler.ticksInGame + f;
double worldTicks = tileentity.getWorldObj() == null ? 0 : time;
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
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);
model.renderBase();
GL11.glTranslatef(0F, (float) Math.sin(worldTicks / 20.0) * 0.05F, 0F);
GL11.glColor4f(1F, 1F, 1F, 0.7F);
model.renderCube();
GL11.glColor3f(1F, 1F, 1F);
GL11.glScalef(1F, -1F, -1F);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
}
@@ -20,6 +20,7 @@ import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.subtile.SubTileEntity;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.block.corporea.BlockCorporeaCrystalCube;
import vazkii.botania.common.block.corporea.BlockCorporeaFunnel;
import vazkii.botania.common.block.corporea.BlockCorporeaIndex;
import vazkii.botania.common.block.corporea.BlockCorporeaInterceptor;
@@ -221,6 +222,7 @@ public final class ModBlocks {
public static Block fakeAir;
public static Block blazeBlock;
public static Block corporeaInterceptor;
public static Block corporeaCrystalCube;
public static void init() {
flower = new BlockModFlower();
@@ -290,6 +292,7 @@ public final class ModBlocks {
fakeAir = new BlockFakeAir();
blazeBlock = new BlockBlaze();
corporeaInterceptor = new BlockCorporeaInterceptor();
corporeaCrystalCube = new BlockCorporeaCrystalCube();
ModFluffBlocks.init();
@@ -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 the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [Apr 30, 2015, 3:56:19 PM (GMT)]
*/
package vazkii.botania.common.block.corporea;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.corporea.TileCorporeaBase;
import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube;
import vazkii.botania.common.lib.LibBlockNames;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class BlockCorporeaCrystalCube extends BlockCorporeaBase {
public BlockCorporeaCrystalCube() {
super(Material.iron, LibBlockNames.CORPOREA_CRYSTAL_CUBE);
setHardness(5.5F);
setStepSound(soundTypeMetal);
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public int getRenderType() {
return LibRenderIDs.idCorporeaCrystalCybe;
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
// NO-OP
}
@Override
public IIcon getIcon(int side, int meta) {
return ModBlocks.storage.getIcon(0, 2);
}
@Override
public TileCorporeaBase createNewTileEntity(World world, int meta) {
return new TileCorporeaCrystalCube();
}
}
@@ -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 the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [Apr 30, 2015, 3:57:57 PM (GMT)]
*/
package vazkii.botania.common.block.tile.corporea;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.lib.LibBlockNames;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class TileCorporeaCrystalCube extends TileCorporeaBase {
@Override
public int getSizeInventory() {
return 1;
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
return false;
}
@Override
public String getInventoryName() {
return LibBlockNames.CORPOREA_CRYSTAL_CUBE;
}
}
@@ -238,6 +238,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addBlock(ModBlocks.corporeaIndex);
addBlock(ModBlocks.corporeaFunnel);
addBlock(ModBlocks.corporeaInterceptor);
addBlock(ModBlocks.corporeaCrystalCube);
// FLUFF
@@ -82,6 +82,7 @@ public final class LibBlockNames {
public static final String FAKE_AIR = "fakeAir";
public static final String BLAZE_BLOCK = "blazeBlock";
public static final String CORPOREA_INTERCEPTOR = "corporeaInterceptor";
public static final String CORPOREA_CRYSTAL_CUBE = "corporeaCrystalCube";
public static final String SUBTILE_PUREDAISY = "puredaisy";
public static final String SUBTILE_MANASTAR = "manastar";