Working on Extended Aura nodes

This commit is contained in:
HellFirePvP committed 2015-10-23 19:54:21 +02:00
1 parent 10e7c3bd01
commit fe546b4828
4 files changed
+28 -9

No files matched your search

@@ -1,6 +1,10 @@
package makeo.gadomancy.client.renderers.tile;
import makeo.gadomancy.common.blocks.tiles.TileExtendedNode;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import thaumcraft.client.renderers.tile.TileNodeRenderer;
/**
@@ -8,13 +12,22 @@ import thaumcraft.client.renderers.tile.TileNodeRenderer;
* Gadomancy is Open Source and distributed under the
* GNU LESSER GENERAL PUBLIC LICENSE
* for more read the LICENSE file
* <p/>
*
* Created by HellFirePvP @ 22.10.2015 19:44
*/
public class RenderTileExtendedNode extends TileNodeRenderer {
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) {
super.renderTileEntityAt(tile, x, y, z, partialTicks);
if(!(tile instanceof TileExtendedNode)) return;
TileExtendedNode node = (TileExtendedNode) tile;
EntityLivingBase renderView = Minecraft.getMinecraft().renderViewEntity;
renderView.posX += node.xMoved;
renderView.posY += node.yMoved;
renderView.posZ += node.zMoved;
super.renderTileEntityAt(tile, 0, 0, 0, partialTicks);
renderView.posX -= node.xMoved;
renderView.posY -= node.yMoved;
renderView.posZ -= node.zMoved;
}
}
@@ -14,11 +14,6 @@ import net.minecraft.world.World;
*/
public class BlockNode extends thaumcraft.common.blocks.BlockAiry {
@Override
public String getUnlocalizedName() {
return super.getUnlocalizedName();
}
@Override
public TileEntity createTileEntity(World world, int metadata) {
if(metadata == 0) return new TileExtendedNode();
@@ -3,6 +3,8 @@ package makeo.gadomancy.common.blocks.tiles;
import net.minecraft.nbt.NBTTagCompound;
import thaumcraft.common.tiles.TileNode;
import java.util.Random;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
@@ -13,7 +15,15 @@ import thaumcraft.common.tiles.TileNode;
*/
public class TileExtendedNode extends TileNode {
private boolean growing = false;
public boolean growing = false;
public double xMoved, yMoved, zMoved;
public TileExtendedNode() {
this.xMoved = 0.5;
this.yMoved = 0.5;
this.zMoved = 0.5;
this.growing = new Random().nextBoolean();
}
@Override
public void updateEntity() {
@@ -20,6 +20,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.config.ConfigBlocks;
import thaumcraft.common.tiles.TileInfusionMatrix;
@@ -60,7 +61,7 @@ public class RegisteredBlocks {
blockArcaneDropper = registerBlock(new BlockArcaneDropper());
blockInfusionClaw = registerBlock(new BlockInfusionClaw());
blockRemoteJar = registerBlock(new BlockRemoteJar(), ItemBlockRemoteJar.class);
blockNode = (BlockNode) new BlockNode().setBlockName("blockAiry");
blockNode = (BlockNode) new BlockNode().setBlockName("blockAiry").setCreativeTab(Thaumcraft.tabTC);
}
private static <T extends Block> T registerBlock(String name, T block) {