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 RenderBlocks renderBlocks;
|
||||||
private final RenderItem renderItem;
|
private final RenderItem renderItem;
|
||||||
|
|
||||||
private RenderItemOverlayTile()
|
public RenderItemOverlayTile()
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
renderItem = ((RenderItem) RenderManager.instance.getEntityClassRenderObject(EntityItem.class));
|
renderItem = ((RenderItem) RenderManager.instance.getEntityClassRenderObject(EntityItem.class));
|
||||||
|
@ -111,7 +111,7 @@ public abstract class RenderItemOverlayTile extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
continue;
|
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(renderText, direction, 0.02f, x, y - 0.35f, z);
|
||||||
RenderUtility.renderText(amount, direction, 0.02f, x, y - 0.15f, 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);
|
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(renderText, direction, 0.02f, x, y - 0.35f, z);
|
||||||
RenderUtility.renderText(amount, direction, 0.02f, x, y - 0.15f, 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);
|
this.setupLight(tile, direction.offsetX, direction.offsetZ);
|
||||||
|
|
|
@ -7,6 +7,7 @@ import net.minecraftforge.client.MinecraftForgeClient;
|
||||||
import resonantinduction.core.render.RenderRIItem;
|
import resonantinduction.core.render.RenderRIItem;
|
||||||
import resonantinduction.electrical.battery.RenderBattery;
|
import resonantinduction.electrical.battery.RenderBattery;
|
||||||
import resonantinduction.electrical.battery.TileBattery;
|
import resonantinduction.electrical.battery.TileBattery;
|
||||||
|
import resonantinduction.electrical.charger.TileCharger;
|
||||||
import resonantinduction.electrical.encoder.TileEncoder;
|
import resonantinduction.electrical.encoder.TileEncoder;
|
||||||
import resonantinduction.electrical.encoder.gui.GuiEncoderInventory;
|
import resonantinduction.electrical.encoder.gui.GuiEncoderInventory;
|
||||||
import resonantinduction.electrical.generator.solar.RenderSolarPanel;
|
import resonantinduction.electrical.generator.solar.RenderSolarPanel;
|
||||||
|
@ -18,6 +19,7 @@ import resonantinduction.electrical.multimeter.PartMultimeter;
|
||||||
import resonantinduction.electrical.render.FXElectricBolt;
|
import resonantinduction.electrical.render.FXElectricBolt;
|
||||||
import resonantinduction.electrical.tesla.RenderTesla;
|
import resonantinduction.electrical.tesla.RenderTesla;
|
||||||
import resonantinduction.electrical.tesla.TileTesla;
|
import resonantinduction.electrical.tesla.TileTesla;
|
||||||
|
import resonantinduction.mechanical.belt.RenderCharger;
|
||||||
import universalelectricity.api.vector.Vector3;
|
import universalelectricity.api.vector.Vector3;
|
||||||
import codechicken.multipart.TMultiPart;
|
import codechicken.multipart.TMultiPart;
|
||||||
import codechicken.multipart.TileMultipart;
|
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.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
/**
|
/** @author Calclavia */
|
||||||
* @author Calclavia
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class ClientProxy extends CommonProxy
|
public class ClientProxy extends CommonProxy
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void preInit()
|
public void preInit()
|
||||||
{
|
{
|
||||||
MinecraftForgeClient.registerItemRenderer(Electrical.blockBattery.blockID, RenderRIItem.INSTANCE);
|
MinecraftForgeClient.registerItemRenderer(Electrical.blockBattery.blockID, RenderRIItem.INSTANCE);
|
||||||
MinecraftForgeClient.registerItemRenderer(Electrical.itemMultimeter.itemID, RenderRIItem.INSTANCE);
|
MinecraftForgeClient.registerItemRenderer(Electrical.itemMultimeter.itemID, RenderRIItem.INSTANCE);
|
||||||
MinecraftForgeClient.registerItemRenderer(Electrical.itemTransformer.itemID, RenderRIItem.INSTANCE);
|
MinecraftForgeClient.registerItemRenderer(Electrical.itemTransformer.itemID, RenderRIItem.INSTANCE);
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTesla.class, new RenderTesla());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileTesla.class, new RenderTesla());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileLevitator.class, new RenderLevitator());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileLevitator.class, new RenderLevitator());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileBattery.class, new RenderBattery());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileBattery.class, new RenderBattery());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileSolarPanel.class, new RenderSolarPanel());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileSolarPanel.class, new RenderSolarPanel());
|
||||||
}
|
ClientRegistry.bindTileEntitySpecialRenderer(TileCharger.class, new RenderCharger());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postInit()
|
public void postInit()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
|
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
|
||||||
{
|
{
|
||||||
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||||
|
|
||||||
if (tileEntity instanceof TileMultipart)
|
if (tileEntity instanceof TileMultipart)
|
||||||
{
|
{
|
||||||
TMultiPart part = ((TileMultipart) tileEntity).partMap(id);
|
TMultiPart part = ((TileMultipart) tileEntity).partMap(id);
|
||||||
|
|
||||||
if (part instanceof PartMultimeter)
|
if (part instanceof PartMultimeter)
|
||||||
{
|
{
|
||||||
return new GuiMultimeter(player.inventory, (PartMultimeter) part);
|
return new GuiMultimeter(player.inventory, (PartMultimeter) part);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (tileEntity instanceof TileEncoder)
|
else if (tileEntity instanceof TileEncoder)
|
||||||
{
|
{
|
||||||
return new GuiEncoderInventory(player.inventory, (TileEncoder) tileEntity);
|
return new GuiEncoderInventory(player.inventory, (TileEncoder) tileEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderElectricShock(World world, Vector3 start, Vector3 target, float r, float g, float b, boolean split)
|
public void renderElectricShock(World world, Vector3 start, Vector3 target, float r, float g, float b, boolean split)
|
||||||
{
|
{
|
||||||
if (world.isRemote)
|
if (world.isRemote)
|
||||||
{
|
{
|
||||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXElectricBolt(world, start, target, split).setColor(r, g, b));
|
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)
|
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…
Add table
Reference in a new issue