Added ability to inverse generator
|
@ -1,5 +1,6 @@
|
||||||
package resonantinduction.electrical.generator;
|
package resonantinduction.electrical.generator;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import resonantinduction.core.prefab.block.BlockRIRotatable;
|
import resonantinduction.core.prefab.block.BlockRIRotatable;
|
||||||
|
@ -14,6 +15,19 @@ public class BlockGenerator extends BlockRIRotatable
|
||||||
super("generator");
|
super("generator");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ)
|
||||||
|
{
|
||||||
|
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||||
|
|
||||||
|
if (tileEntity instanceof TileGenerator)
|
||||||
|
{
|
||||||
|
((TileGenerator) tileEntity).isInversed = !((TileGenerator) tileEntity).isInversed;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world)
|
public TileEntity createNewTileEntity(World world)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,7 @@ public class TileGenerator extends TileElectrical implements IMechanical
|
||||||
private long power;
|
private long power;
|
||||||
|
|
||||||
/** Generator turns KE -> EE. Inverted one will turn EE -> KE. */
|
/** Generator turns KE -> EE. Inverted one will turn EE -> KE. */
|
||||||
private boolean isInversed = false;
|
public boolean isInversed = false;
|
||||||
|
|
||||||
public TileGenerator()
|
public TileGenerator()
|
||||||
{
|
{
|
||||||
|
|
|
@ -144,12 +144,12 @@ public class PartGear extends JCuboidPart implements JNormalOcclusion, TFacePart
|
||||||
@Override
|
@Override
|
||||||
public boolean activate(EntityPlayer player, MovingObjectPosition hit, ItemStack item)
|
public boolean activate(EntityPlayer player, MovingObjectPosition hit, ItemStack item)
|
||||||
{
|
{
|
||||||
System.out.println("Torque" + this.torque);
|
System.out.println("Torque" + this.torque + " Angular Velocity" + this.angularVelocity);
|
||||||
|
|
||||||
if (player.isSneaking())
|
if (player.isSneaking())
|
||||||
{
|
{
|
||||||
this.torque += 10;
|
this.torque += 10;
|
||||||
this.angularVelocity += 1;
|
this.angularVelocity += 0.1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Before Width: | Height: | Size: 479 B |
Before Width: | Height: | Size: 943 B |
Before Width: | Height: | Size: 1,018 B |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 702 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 302 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 706 B |
Before Width: | Height: | Size: 625 B |
Before Width: | Height: | Size: 945 B |
Before Width: | Height: | Size: 822 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 7 KiB |
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 706 B |
Before Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 957 B |
Before Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 643 B |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 658 B |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 966 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 177 B |
Before Width: | Height: | Size: 933 B |