Added ability to inverse generator

This commit is contained in:
Calclavia 2014-01-15 21:52:06 +08:00
parent b6f2d3c503
commit 21e10e1af2
47 changed files with 17 additions and 3 deletions

View file

@ -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)
{ {

View file

@ -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()
{ {

View file

@ -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;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1,018 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 945 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 957 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 658 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 966 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B