Got items to render in the charger
This commit is contained in:
parent
bbe840e49f
commit
c643397864
3 changed files with 51 additions and 51 deletions
|
@ -32,7 +32,7 @@ public abstract class RenderItemOverlayTile extends TileEntitySpecialRenderer
|
|||
private final RenderBlocks renderBlocks;
|
||||
private final RenderItem renderItem;
|
||||
|
||||
private RenderItemOverlayTile()
|
||||
public RenderItemOverlayTile()
|
||||
{
|
||||
super();
|
||||
renderItem = ((RenderItem) RenderManager.instance.getEntityClassRenderObject(EntityItem.class));
|
||||
|
@ -93,7 +93,7 @@ public abstract class RenderItemOverlayTile extends TileEntitySpecialRenderer
|
|||
{
|
||||
renderItemOnSides(tile, itemStack, x, y, z, "No Output");
|
||||
}
|
||||
|
||||
|
||||
public void renderItemOnSides(TileEntity tile, ItemStack itemStack, double x, double y, double z, String renderText)
|
||||
{
|
||||
/** Render the Output */
|
||||
|
@ -111,7 +111,7 @@ public abstract class RenderItemOverlayTile extends TileEntitySpecialRenderer
|
|||
{
|
||||
continue;
|
||||
}
|
||||
this.renderItemOnSide(tile, renderItem, itemStack, direction, x, y, z, renderText, amount);
|
||||
this.renderItemOnSide(tile, itemStack, direction, x, y, z, renderText, amount);
|
||||
RenderUtility.renderText(renderText, direction, 0.02f, x, y - 0.35f, z);
|
||||
RenderUtility.renderText(amount, direction, 0.02f, x, y - 0.15f, z);
|
||||
}
|
||||
|
@ -129,14 +129,14 @@ public abstract class RenderItemOverlayTile extends TileEntitySpecialRenderer
|
|||
amount = Integer.toString(itemStack.stackSize);
|
||||
}
|
||||
|
||||
this.renderItemOnSide(tile, renderItem, itemStack, direction, x, y, z, renderText, amount);
|
||||
this.renderItemOnSide(tile, itemStack, direction, x, y, z, renderText, amount);
|
||||
RenderUtility.renderText(renderText, direction, 0.02f, x, y - 0.35f, z);
|
||||
RenderUtility.renderText(amount, direction, 0.02f, x, y - 0.15f, z);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderItemOnSide(TileEntity tile, RenderItem renderItem, ItemStack itemStack, ForgeDirection direction, double x, double y, double z, String renderText, String amount)
|
||||
protected void renderItemOnSide(TileEntity tile, ItemStack itemStack, ForgeDirection direction, double x, double y, double z, String renderText, String amount)
|
||||
{
|
||||
|
||||
this.setupLight(tile, direction.offsetX, direction.offsetZ);
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.minecraftforge.client.MinecraftForgeClient;
|
|||
import resonantinduction.core.render.RenderRIItem;
|
||||
import resonantinduction.electrical.battery.RenderBattery;
|
||||
import resonantinduction.electrical.battery.TileBattery;
|
||||
import resonantinduction.electrical.charger.TileCharger;
|
||||
import resonantinduction.electrical.encoder.TileEncoder;
|
||||
import resonantinduction.electrical.encoder.gui.GuiEncoderInventory;
|
||||
import resonantinduction.electrical.generator.solar.RenderSolarPanel;
|
||||
|
@ -18,6 +19,7 @@ import resonantinduction.electrical.multimeter.PartMultimeter;
|
|||
import resonantinduction.electrical.render.FXElectricBolt;
|
||||
import resonantinduction.electrical.tesla.RenderTesla;
|
||||
import resonantinduction.electrical.tesla.TileTesla;
|
||||
import resonantinduction.mechanical.belt.RenderCharger;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import codechicken.multipart.TMultiPart;
|
||||
import codechicken.multipart.TileMultipart;
|
||||
|
@ -26,58 +28,56 @@ import cpw.mods.fml.client.registry.ClientRegistry;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* @author Calclavia
|
||||
*
|
||||
*/
|
||||
/** @author Calclavia */
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
@Override
|
||||
public void preInit()
|
||||
{
|
||||
MinecraftForgeClient.registerItemRenderer(Electrical.blockBattery.blockID, RenderRIItem.INSTANCE);
|
||||
MinecraftForgeClient.registerItemRenderer(Electrical.itemMultimeter.itemID, RenderRIItem.INSTANCE);
|
||||
MinecraftForgeClient.registerItemRenderer(Electrical.itemTransformer.itemID, RenderRIItem.INSTANCE);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTesla.class, new RenderTesla());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileLevitator.class, new RenderLevitator());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileBattery.class, new RenderBattery());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileSolarPanel.class, new RenderSolarPanel());
|
||||
}
|
||||
@Override
|
||||
public void preInit()
|
||||
{
|
||||
MinecraftForgeClient.registerItemRenderer(Electrical.blockBattery.blockID, RenderRIItem.INSTANCE);
|
||||
MinecraftForgeClient.registerItemRenderer(Electrical.itemMultimeter.itemID, RenderRIItem.INSTANCE);
|
||||
MinecraftForgeClient.registerItemRenderer(Electrical.itemTransformer.itemID, RenderRIItem.INSTANCE);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTesla.class, new RenderTesla());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileLevitator.class, new RenderLevitator());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileBattery.class, new RenderBattery());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileSolarPanel.class, new RenderSolarPanel());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCharger.class, new RenderCharger());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit()
|
||||
{
|
||||
}
|
||||
@Override
|
||||
public void postInit()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||
@Override
|
||||
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity instanceof TileMultipart)
|
||||
{
|
||||
TMultiPart part = ((TileMultipart) tileEntity).partMap(id);
|
||||
if (tileEntity instanceof TileMultipart)
|
||||
{
|
||||
TMultiPart part = ((TileMultipart) tileEntity).partMap(id);
|
||||
|
||||
if (part instanceof PartMultimeter)
|
||||
{
|
||||
return new GuiMultimeter(player.inventory, (PartMultimeter) part);
|
||||
}
|
||||
}
|
||||
else if (tileEntity instanceof TileEncoder)
|
||||
{
|
||||
return new GuiEncoderInventory(player.inventory, (TileEncoder) tileEntity);
|
||||
}
|
||||
if (part instanceof PartMultimeter)
|
||||
{
|
||||
return new GuiMultimeter(player.inventory, (PartMultimeter) part);
|
||||
}
|
||||
}
|
||||
else if (tileEntity instanceof TileEncoder)
|
||||
{
|
||||
return new GuiEncoderInventory(player.inventory, (TileEncoder) tileEntity);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderElectricShock(World world, Vector3 start, Vector3 target, float r, float g, float b, boolean split)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXElectricBolt(world, start, target, split).setColor(r, g, b));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void renderElectricShock(World world, Vector3 start, Vector3 target, float r, float g, float b, boolean split)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXElectricBolt(world, start, target, split).setColor(r, g, b));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ public class RenderCharger extends RenderItemOverlayTile
|
|||
{
|
||||
if (tile instanceof TileCharger)
|
||||
{
|
||||
renderItemOnSides(tile, ((TileCharger) tile).getStackInSlot(0), x, y, z);
|
||||
this.renderItemSingleSide(tile, x, y, z, ((TileCharger)tile).getStackInSlot(0), ((TileCharger)tile).getDirection(), "IDLE");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue