electrodynamics/electrical/src/main/scala/resonantinduction/electrical/CommonProxy.java

71 lines
2.2 KiB
Java
Raw Normal View History

2014-01-09 16:08:22 +01:00
package resonantinduction.electrical;
2013-08-02 02:48:07 +02:00
2014-01-11 04:04:30 +01:00
import java.awt.Color;
2013-08-02 02:48:07 +02:00
import net.minecraft.entity.player.EntityPlayer;
2013-08-04 01:43:10 +02:00
import net.minecraft.tileentity.TileEntity;
2013-08-02 02:48:07 +02:00
import net.minecraft.world.World;
2014-01-13 14:35:46 +01:00
import resonantinduction.electrical.encoder.TileEncoder;
import resonantinduction.electrical.encoder.gui.ContainerEncoder;
2014-01-09 16:08:22 +01:00
import resonantinduction.electrical.multimeter.ContainerMultimeter;
import resonantinduction.electrical.multimeter.PartMultimeter;
import universalelectricity.api.vector.Vector3;
2014-01-27 15:09:56 +01:00
import calclavia.lib.prefab.ProxyBase;
2014-01-10 09:00:46 +01:00
import codechicken.multipart.TMultiPart;
import codechicken.multipart.TileMultipart;
2013-08-02 02:48:07 +02:00
2014-01-09 16:08:22 +01:00
public class CommonProxy extends ProxyBase
2013-08-02 02:48:07 +02:00
{
@Override
2013-12-23 09:51:24 +01:00
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
2013-08-02 02:48:07 +02:00
{
2013-08-04 01:43:10 +02:00
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
2013-12-23 09:51:24 +01:00
if (tileEntity instanceof TileMultipart)
2013-08-04 01:43:10 +02:00
{
2013-12-23 09:51:24 +01:00
TMultiPart part = ((TileMultipart) tileEntity).partMap(id);
if (part instanceof PartMultimeter)
{
return new ContainerMultimeter(player.inventory, ((PartMultimeter) part));
}
2014-01-19 14:03:03 +01:00
}
else if (tileEntity instanceof TileEncoder)
2014-01-13 14:35:46 +01:00
{
return new ContainerEncoder(player.inventory, (TileEncoder) tileEntity);
2013-08-04 01:43:10 +02:00
}
2013-08-05 19:36:31 +02:00
2013-08-02 02:48:07 +02:00
return null;
}
public void renderElectricShock(World world, Vector3 start, Vector3 target, float r, float g, float b, boolean split)
2013-08-02 04:19:01 +02:00
{
}
public void renderElectricShock(World world, Vector3 start, Vector3 target, float r, float g, float b)
{
this.renderElectricShock(world, start, target, r, g, b, true);
}
2014-01-11 04:04:30 +01:00
public void renderElectricShock(World world, Vector3 start, Vector3 target, Color color)
2013-08-04 19:01:54 +02:00
{
2014-01-11 04:04:30 +01:00
this.renderElectricShock(world, start, target, color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f);
2013-08-04 19:01:54 +02:00
}
2014-01-11 04:04:30 +01:00
public void renderElectricShock(World world, Vector3 start, Vector3 target, Color color, boolean split)
{
2014-01-11 04:04:30 +01:00
this.renderElectricShock(world, start, target, color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, split);
}
2013-08-02 05:55:07 +02:00
public void renderElectricShock(World world, Vector3 start, Vector3 target)
{
2013-08-08 18:36:18 +02:00
this.renderElectricShock(world, start, target, true);
}
public void renderElectricShock(World world, Vector3 start, Vector3 target, boolean b)
{
this.renderElectricShock(world, start, target, 0.55f, 0.7f, 1f, b);
2013-08-02 05:55:07 +02:00
}
2013-08-02 02:48:07 +02:00
}