-added pillars for Manipulator

-added rendering for Manipulator
-replaced old field headers
-added textures for Manipulator and Pillars
This commit is contained in:
makeo committed 2015-10-27 18:29:34 +01:00
1 parent 8e147dde09
commit 241b64564e
21 files changed
+369 -41

No files matched your search

@@ -8,25 +8,16 @@ import makeo.gadomancy.client.events.RenderEventHandler;
import makeo.gadomancy.client.events.ResourceReloadListener;
import makeo.gadomancy.client.gui.InfusionClawGui;
import makeo.gadomancy.client.renderers.block.BlockExtendedNodeJarRenderer;
import makeo.gadomancy.client.renderers.block.BlockNodeManipulatorRenderer;
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.ItemJarExtendedNodeRenderer;
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.RenderTileExtendedNodeJar;
import makeo.gadomancy.client.renderers.tile.RenderTileInfusionClaw;
import makeo.gadomancy.client.renderers.tile.RenderTileRemoteJar;
import makeo.gadomancy.client.renderers.tile.RenderTileStickyJar;
import makeo.gadomancy.client.renderers.tile.*;
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.TileExtendedNodeJar;
import makeo.gadomancy.common.blocks.tiles.TileInfusionClaw;
import makeo.gadomancy.common.blocks.tiles.TileRemoteJar;
import makeo.gadomancy.common.blocks.tiles.TileStickyJar;
import makeo.gadomancy.common.blocks.tiles.*;
import makeo.gadomancy.common.registration.RegisteredBlocks;
import makeo.gadomancy.common.registration.RegisteredItems;
import makeo.gadomancy.common.utils.Injector;
@@ -87,6 +78,9 @@ public class ClientProxy extends CommonProxy {
RenderTileExtendedNodeJar nodeJarRenderer = new RenderTileExtendedNodeJar();
ClientRegistry.bindTileEntitySpecialRenderer(TileExtendedNodeJar.class, nodeJarRenderer);
ClientRegistry.bindTileEntitySpecialRenderer(TileNodeManipulator.class, new RenderTileNodeManipulator());
ClientRegistry.bindTileEntitySpecialRenderer(TileManipulatorPillar.class, new RenderTileManipulatorPillar());
//Items
TileArcaneDropper fakeTile = new TileArcaneDropper();
fakeTile.blockMetadata = 8 | ForgeDirection.SOUTH.ordinal();
@@ -102,6 +96,7 @@ public class ClientProxy extends CommonProxy {
//Blocks
RegisteredBlocks.rendererTransparentBlock = registerBlockRenderer(new RenderBlockTransparent());
RegisteredBlocks.rendererExtendedNodeJarBlock = registerBlockRenderer(new BlockExtendedNodeJarRenderer());
RegisteredBlocks.rendererNodeManipulator = registerBlockRenderer(new BlockNodeManipulatorRenderer());
}
@Override
@@ -0,0 +1,49 @@
package makeo.gadomancy.client.renderers.block;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import makeo.gadomancy.common.registration.RegisteredBlocks;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import thaumcraft.client.renderers.block.BlockStoneDeviceRenderer;
/**
* 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 makeo @ 27.10.2015 13:46
*/
public class BlockNodeManipulatorRenderer implements ISimpleBlockRenderingHandler {
public static final BlockStoneDeviceRenderer PARENT_RENDERER = new BlockStoneDeviceRenderer();
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
GL11.glPushMatrix();
GL11.glTranslatef(0, -0.1f, 0);
GL11.glScalef(0.85f, 0.85f, 0.85f);
PARENT_RENDERER.renderInventoryBlock(block, 5, modelId, renderer);
GL11.glTranslatef(0, 1f, 0);
PARENT_RENDERER.renderInventoryBlock(block, 8, modelId, renderer);
GL11.glPopMatrix();
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
return PARENT_RENDERER.renderWorldBlock(world, x, y, z, block, modelId, renderer);
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
}
@Override
public int getRenderId() {
return RegisteredBlocks.rendererNodeManipulator;
}
}
@@ -5,9 +5,12 @@ import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.entity.player.EntityPlayer;
/**
* User: makeo
* Date: 09.07.2015
* Time: 02:34
* 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 makeo @ 09.07.2015 02:34
*/
public class PlayerCameraRenderer extends EntityRenderer {
private final Minecraft minecraft;
@@ -0,0 +1,37 @@
package makeo.gadomancy.client.renderers.tile;
import makeo.gadomancy.common.utils.Injector;
import makeo.gadomancy.common.utils.SimpleResourceLocation;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import thaumcraft.client.lib.UtilsFX;
import thaumcraft.client.renderers.tile.TileInfusionPillarRenderer;
import java.util.Map;
/**
* 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 makeo @ 27.10.2015 13:23
*/
public class RenderTileManipulatorPillar extends TileInfusionPillarRenderer {
private static final String TC_TEXTURE = "textures/models/pillar.png";
private static final ResourceLocation TEXTURE = new SimpleResourceLocation("models/manipulator_pillar.png");
private static final Map<String, ResourceLocation> BOUND_TEXTURES = new Injector(UtilsFX.class).getField("boundTextures");
@Override
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) {
ResourceLocation originalTexture = BOUND_TEXTURES.get(TC_TEXTURE);
BOUND_TEXTURES.put(TC_TEXTURE, TEXTURE);
super.renderTileEntityAt(par1TileEntity, par2, par4, par6, par8);
if(originalTexture != null) {
BOUND_TEXTURES.put(TC_TEXTURE, originalTexture);
} else {
BOUND_TEXTURES.remove(TC_TEXTURE);
}
}
}
@@ -0,0 +1,32 @@
package makeo.gadomancy.client.renderers.tile;
import makeo.gadomancy.client.renderers.block.BlockNodeManipulatorRenderer;
import makeo.gadomancy.common.registration.RegisteredBlocks;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
/**
* 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 makeo @ 27.10.2015 15:19
*/
public class RenderTileNodeManipulator extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partitalTicks) {
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glTranslatef(0.5f, 1.5f, 0.5f);
bindTexture(TextureMap.locationBlocksTexture);
BlockNodeManipulatorRenderer.PARENT_RENDERER.renderInventoryBlock(RegisteredBlocks.blockNodeManipulator, 8, 0, RenderBlocks.getInstance());
GL11.glPopMatrix();
}
}
@@ -6,9 +6,12 @@ import thaumcraft.common.entities.golems.EntityGolemBase;
import thaumcraft.common.entities.golems.EnumGolemType;
/**
* User: makeo
* Date: 05.07.2015
* Time: 15:47
* 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 makeo @ 05.07.2015 15:47
*/
public class FakeEntityGolemBase extends EntityGolemBase {
private EntityGolemBase golem;
@@ -17,9 +17,12 @@ import java.util.List;
import java.util.Map;
/**
* User: makeo
* Date: 04.07.2015
* Time: 02:38
* 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 makeo @ 04.07.2015 02:38
*/
@SideOnly(Side.CLIENT)
public class TransformationHelper {
@@ -1,6 +1,8 @@
package makeo.gadomancy.common.blocks;
import makeo.gadomancy.common.Gadomancy;
import makeo.gadomancy.common.blocks.tiles.TileNodeManipulator;
import makeo.gadomancy.common.registration.RegisteredBlocks;
import makeo.gadomancy.common.registration.RegisteredItems;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -32,9 +34,14 @@ public class BlockNodeManipulator extends BlockStoneDevice {
@Override
public void registerBlockIcons(IIconRegister ir) {
super.registerBlockIcons(ir);
//iconPedestal[0]
//iconWandPedestal[0]
//iconWandPedestal[1]
iconPedestal[1] = ir.registerIcon(Gadomancy.MODID + ":manipulator_bot");
iconWandPedestal[0] = ir.registerIcon(Gadomancy.MODID + ":manipulator_side");
iconWandPedestal[1] = ir.registerIcon(Gadomancy.MODID + ":manipulator_top");
iconWandPedestalFocus[0] = ir.registerIcon(Gadomancy.MODID + ":manipulator_focus_side");
iconWandPedestalFocus[1] = ir.registerIcon(Gadomancy.MODID + ":manipulator_focus_top");
iconWandPedestalFocus[2] = ir.registerIcon(Gadomancy.MODID + ":manipulator_focus_bot");
}
@Override
@@ -71,4 +78,9 @@ public class BlockNodeManipulator extends BlockStoneDevice {
//TODO DO!
return super.onBlockActivated(world, x, y, z, player, side, par7, par8, par9);
}
@Override
public int getRenderType() {
return RegisteredBlocks.rendererNodeManipulator;
}
}
@@ -0,0 +1,140 @@
package makeo.gadomancy.common.blocks;
import makeo.gadomancy.common.blocks.tiles.TileManipulatorPillar;
import makeo.gadomancy.common.registration.RegisteredItems;
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.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import thaumcraft.common.config.ConfigBlocks;
import java.util.List;
import java.util.Random;
/**
* 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 makeo @ 27.10.2015 13:16
*/
public class BlockStoneMachine extends Block {
public BlockStoneMachine() {
super(Material.rock);
setHardness(3.0F);
setResistance(25.0F);
setStepSound(Block.soundTypeStone);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
setCreativeTab(RegisteredItems.creativeTab);
}
private IIcon pillarIcon;
@Override
public void registerBlockIcons(IIconRegister ir) {
pillarIcon = ir.registerIcon("thaumcraft:es_1");
}
@Override
public IIcon getIcon(int side, int metadata) {
if(metadata == 11 || metadata == 15) {
return pillarIcon;
}
return super.getIcon(side, metadata);
}
@Override
public boolean hasTileEntity(int metadata) {
return metadata == 15;
}
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
list.add(new ItemStack(item, 1, 15));
list.add(new ItemStack(item, 1, 11));
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
int metadata = world.getBlockMetadata(x, y, z);
if(metadata == 11 || metadata == 15) {
return new ItemStack(getItemDropped(metadata, null, 0), 1, damageDropped(metadata));
}
return super.getPickBlock(target, world, x, y, z, player);
}
@Override
public TileEntity createTileEntity(World world, int metadata) {
if(metadata == 15) {
return new TileManipulatorPillar();
}
return null;
}
@Override
public Item getItemDropped(int metadata, Random random, int fortune) {
if(metadata == 11 || metadata == 15) {
return Item.getItemFromBlock(ConfigBlocks.blockCosmeticSolid);
}
return super.getItemDropped(metadata, random, fortune);
}
@Override
public int damageDropped(int metadata) {
return metadata == 0 ? 15 : metadata == 1 ? 11 : metadata;
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
int metadata = world.getBlockMetadata(x, y, z);
if(metadata == 15) {
if(world.getBlock(x, y + 1, z) != this || world.getBlockMetadata(x, y, z) != 1) {
dropBlockAsItem(world, x, y, z, metadata, 0);
world.setBlockToAir(x, y, z);
}
} else if(metadata == 11) {
if(world.getBlock(x, y - 1, z) != this || world.getBlockMetadata(x, y, z) != 0) {
dropBlockAsItem(world, x, y, z, metadata, 0);
world.setBlockToAir(x, y, z);
}
}
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
int metadata = world.getBlockMetadata(x, y, z);
if(metadata == 15) {
setBlockBounds(0, 0, 0, 1, 0.5f, 1);
} else if(metadata == 11) {
setBlockBounds(0.0F, -1.0F, 0.0F, 1.0F, -0.5F, 1.0F);
}
super.setBlockBoundsBasedOnState(world, x, y, z);
}
public boolean isOpaqueCube()
/* 97: */ {
/* 98: 96 */ return false;
/* 99: */ }
public boolean renderAsNormalBlock()
/* 102: */ {
/* 103:102 */ return false;
/* 104: */ }
@Override
public int getRenderType() {
return -1;
}
}
@@ -0,0 +1,15 @@
package makeo.gadomancy.common.blocks.tiles;
import thaumcraft.common.tiles.TileInfusionPillar;
/**
* 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 makeo @ 27.10.2015 13:21
*/
public class TileManipulatorPillar extends TileInfusionPillar {
}
@@ -0,0 +1,41 @@
package makeo.gadomancy.common.items;
import makeo.gadomancy.common.blocks.BlockStoneMachine;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBrewingStand;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
/**
* 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 makeo @ 27.10.2015 17:05
*/
public class ItemBlockStoneMachine extends ItemBlock {
public ItemBlockStoneMachine(Block block) {
super(block);
}
@Override
public IIcon getIconFromDamage(int metadata) {
if(metadata == 11 || metadata == 15) {
return this.field_150939_a.getIcon(0, metadata);
}
return super.getIconFromDamage(metadata);
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return getUnlocalizedName() + "." + stack.getItemDamage();
}
@Override
public int getMetadata(int metadata) {
return metadata;
}
}
@@ -8,9 +8,12 @@ import io.netty.buffer.ByteBuf;
import makeo.gadomancy.client.transformation.TransformationHelper;
/**
* User: makeo
* Date: 03.07.2015
* Time: 21:42
* 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 makeo @ 03.07.2015 21:42
*/
public class PacketAbortTransform implements IMessage, IMessageHandler<PacketAbortTransform, IMessage> {
private int entityId;
@@ -2,21 +2,10 @@ package makeo.gadomancy.common.registration;
import cpw.mods.fml.common.registry.GameRegistry;
import makeo.gadomancy.api.ClickBehavior;
import makeo.gadomancy.common.blocks.BlockArcaneDropper;
import makeo.gadomancy.common.blocks.BlockExtendedNodeJar;
import makeo.gadomancy.common.blocks.BlockInfusionClaw;
import makeo.gadomancy.common.blocks.BlockNode;
import makeo.gadomancy.common.blocks.BlockNodeManipulator;
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.TileExtendedNodeJar;
import makeo.gadomancy.common.blocks.tiles.TileInfusionClaw;
import makeo.gadomancy.common.blocks.tiles.TileNodeManipulator;
import makeo.gadomancy.common.blocks.tiles.TileRemoteJar;
import makeo.gadomancy.common.blocks.tiles.TileStickyJar;
import makeo.gadomancy.common.blocks.*;
import makeo.gadomancy.common.blocks.tiles.*;
import makeo.gadomancy.common.items.ItemBlockRemoteJar;
import makeo.gadomancy.common.items.ItemBlockStoneMachine;
import makeo.gadomancy.common.items.ItemNodeManipulator;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
@@ -43,6 +32,7 @@ public class RegisteredBlocks {
public static int rendererTransparentBlock;
public static int rendererExtendedNodeJarBlock;
public static int rendererNodeManipulator;
public static BlockStickyJar blockStickyJar;
public static BlockArcaneDropper blockArcaneDropper;
@@ -51,6 +41,7 @@ public class RegisteredBlocks {
public static BlockNode blockNode;
public static BlockExtendedNodeJar blockExtendedNodeJar;
public static BlockNodeManipulator blockNodeManipulator;
public static BlockStoneMachine blockStoneMachine;
public static void init() {
registerBlocks();
@@ -70,6 +61,7 @@ public class RegisteredBlocks {
blockNode = (BlockNode) new BlockNode().setBlockName("blockAiry");
blockExtendedNodeJar = registerBlock(new BlockExtendedNodeJar());
blockNodeManipulator = registerBlock(new BlockNodeManipulator(), ItemNodeManipulator.class);
blockStoneMachine = registerBlock(new BlockStoneMachine(), ItemBlockStoneMachine.class);
}
private static <T extends Block> T registerBlock(String name, T block) {
@@ -103,6 +95,7 @@ public class RegisteredBlocks {
registerTile(TileExtendedNode.class);
registerTile(TileExtendedNodeJar.class);
registerTile(TileNodeManipulator.class);
registerTile(TileManipulatorPillar.class);
}
private static void registerTile(Class<? extends TileEntity> tile, String name) {