Added Extended Aura Node and linked renderers to Thaumcraft

This commit is contained in:
HellFirePvP committed 2015-10-22 20:25:46 +02:00
1 parent 2be143ce02
commit ee0ab2c486
7 files changed
+136 -1

No files matched your search

@@ -9,14 +9,17 @@ import makeo.gadomancy.client.events.ResourceReloadListener;
import makeo.gadomancy.client.gui.InfusionClawGui;
import makeo.gadomancy.client.renderers.block.RenderBlockTransparent;
import makeo.gadomancy.client.renderers.entity.RenderAdditionalGolemBase;
import makeo.gadomancy.client.renderers.item.ItemExNodeRenderer;
import makeo.gadomancy.client.renderers.item.ItemRenderRemoteJar;
import makeo.gadomancy.client.renderers.item.ItemRenderTileEntity;
import makeo.gadomancy.client.renderers.tile.RenderTileArcaneDropper;
import makeo.gadomancy.client.renderers.tile.RenderTileExtendedNode;
import makeo.gadomancy.client.renderers.tile.RenderTileInfusionClaw;
import makeo.gadomancy.client.renderers.tile.RenderTileRemoteJar;
import makeo.gadomancy.client.renderers.tile.RenderTileStickyJar;
import makeo.gadomancy.common.CommonProxy;
import makeo.gadomancy.common.blocks.tiles.TileArcaneDropper;
import makeo.gadomancy.common.blocks.tiles.TileExtendedNode;
import makeo.gadomancy.common.blocks.tiles.TileInfusionClaw;
import makeo.gadomancy.common.blocks.tiles.TileRemoteJar;
import makeo.gadomancy.common.blocks.tiles.TileStickyJar;
@@ -70,6 +73,9 @@ public class ClientProxy extends CommonProxy {
RenderTileInfusionClaw renderTileInfusionClaw = new RenderTileInfusionClaw();
ClientRegistry.bindTileEntitySpecialRenderer(TileInfusionClaw.class, renderTileInfusionClaw);
RenderTileExtendedNode nodeRenderer = new RenderTileExtendedNode();
ClientRegistry.bindTileEntitySpecialRenderer(TileExtendedNode.class, nodeRenderer);
//Items
TileArcaneDropper fakeTile = new TileArcaneDropper();
fakeTile.blockMetadata = 8 | ForgeDirection.SOUTH.ordinal();
@@ -77,6 +83,8 @@ public class ClientProxy extends CommonProxy {
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RegisteredBlocks.blockInfusionClaw), new ItemRenderTileEntity(renderTileInfusionClaw, new TileInfusionClaw()));
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RegisteredBlocks.blockNode), new ItemExNodeRenderer());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RegisteredBlocks.blockRemoteJar), new ItemRenderRemoteJar(renderTileRemoteJar));
//Blocks
@@ -0,0 +1,31 @@
package makeo.gadomancy.client.renderers.item;
import makeo.gadomancy.common.registration.RegisteredBlocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import thaumcraft.client.renderers.tile.ItemNodeRenderer;
/**
* This class is part of the Gadomancy Mod
* 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 20:11
*/
public class ItemExNodeRenderer extends ItemNodeRenderer {
public ItemExNodeRenderer() {
//AspectList list = new AspectList().add(Aspect.FIRE, 100).add(Aspect.ENTROPY, 100).add(Aspect.WATER, 50);
//new Injector(this).setField("aspects", list);
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return (item != null) && (item.getItem() == Item.getItemFromBlock(RegisteredBlocks.blockNode)) && (item.getItemDamage() == 0);
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return helper != ItemRendererHelper.EQUIPPED_BLOCK;
}
}
@@ -0,0 +1,20 @@
package makeo.gadomancy.client.renderers.tile;
import net.minecraft.tileentity.TileEntity;
import thaumcraft.client.renderers.tile.TileNodeRenderer;
/**
* This class is part of the Gadomancy Mod
* 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);
}
}
@@ -0,0 +1,29 @@
package makeo.gadomancy.common.blocks;
import makeo.gadomancy.common.blocks.tiles.TileExtendedNode;
import makeo.gadomancy.common.registration.RegisteredItems;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
* GNU LESSER GENERAL PUBLIC LICENSE
* for more read the LICENSE file
*
* Created by HellFirePvP @ 22.10.2015 19:47
*/
public class BlockNode extends thaumcraft.common.blocks.BlockAiry {
//We overwrite and use the TC class for visual effects and world interact handling.
//This way our node behaves like TC ones.
public BlockNode() {
super();
setCreativeTab(RegisteredItems.creativeTab);
}
@Override
public TileEntity createTileEntity(World world, int metadata) {
return new TileExtendedNode();
}
}
@@ -0,0 +1,42 @@
package makeo.gadomancy.common.blocks.tiles;
import net.minecraft.nbt.NBTTagCompound;
import thaumcraft.common.tiles.TileNode;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
* GNU LESSER GENERAL PUBLIC LICENSE
* for more read the LICENSE file
*
* Created by HellFirePvP @ 21.10.2015 23:39
*/
public class TileExtendedNode extends TileNode {
private boolean growing = false;
@Override
public void updateEntity() {
super.updateEntity();
}
@Override
public void readCustomNBT(NBTTagCompound nbttagcompound) {
super.readCustomNBT(nbttagcompound);
NBTTagCompound compound = nbttagcompound.getCompoundTag("Gadomancy");
this.growing = compound.getBoolean("growing");
}
@Override
public void writeCustomNBT(NBTTagCompound nbttagcompound) {
super.writeCustomNBT(nbttagcompound);
NBTTagCompound compound = new NBTTagCompound();
compound.setBoolean("growing", growing);
nbttagcompound.setTag("Gadomancy", compound);
}
}
@@ -2,12 +2,13 @@ package makeo.gadomancy.common.registration;
import cpw.mods.fml.common.registry.GameRegistry;
import makeo.gadomancy.api.ClickBehavior;
import makeo.gadomancy.api.GadomancyApi;
import makeo.gadomancy.common.blocks.BlockArcaneDropper;
import makeo.gadomancy.common.blocks.BlockInfusionClaw;
import makeo.gadomancy.common.blocks.BlockNode;
import makeo.gadomancy.common.blocks.BlockRemoteJar;
import makeo.gadomancy.common.blocks.BlockStickyJar;
import makeo.gadomancy.common.blocks.tiles.TileArcaneDropper;
import makeo.gadomancy.common.blocks.tiles.TileExtendedNode;
import makeo.gadomancy.common.blocks.tiles.TileInfusionClaw;
import makeo.gadomancy.common.blocks.tiles.TileRemoteJar;
import makeo.gadomancy.common.blocks.tiles.TileStickyJar;
@@ -40,6 +41,7 @@ public class RegisteredBlocks {
public static BlockArcaneDropper blockArcaneDropper;
public static BlockInfusionClaw blockInfusionClaw;
public static BlockRemoteJar blockRemoteJar;
public static BlockNode blockNode;
public static void init() {
registerBlocks();
@@ -56,6 +58,7 @@ public class RegisteredBlocks {
blockArcaneDropper = registerBlock(new BlockArcaneDropper());
blockInfusionClaw = registerBlock(new BlockInfusionClaw());
blockRemoteJar = registerBlock(new BlockRemoteJar(), ItemBlockRemoteJar.class);
blockNode = registerBlock(new BlockNode());
}
private static <T extends Block> T registerBlock(String name, T block) {
@@ -86,6 +89,7 @@ public class RegisteredBlocks {
registerTile(TileArcaneDropper.class);
registerTile(TileInfusionClaw.class);
registerTile(TileRemoteJar.class);
registerTile(TileExtendedNode.class);
}
private static void registerTile(Class<? extends TileEntity> tile, String name) {