Got generator working
This commit is contained in:
parent
11aa32154c
commit
b6f2d3c503
4 changed files with 41 additions and 39 deletions
|
@ -20,6 +20,7 @@ public class TileGenerator extends TileElectrical implements IMechanical
|
||||||
public TileGenerator()
|
public TileGenerator()
|
||||||
{
|
{
|
||||||
energy = new EnergyStorageHandler(10000);
|
energy = new EnergyStorageHandler(10000);
|
||||||
|
this.ioMap = 728;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -41,13 +42,13 @@ public class TileGenerator extends TileElectrical implements IMechanical
|
||||||
|
|
||||||
private boolean isFunctioning()
|
private boolean isFunctioning()
|
||||||
{
|
{
|
||||||
return this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPower(long torque, float speed)
|
public void setPower(long torque, float speed)
|
||||||
{
|
{
|
||||||
|
this.power = (long) Math.abs(torque * speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class RenderReleaseValve extends TileEntitySpecialRenderer
|
||||||
public static ModelReleaseValve valve = new ModelReleaseValve();
|
public static ModelReleaseValve valve = new ModelReleaseValve();
|
||||||
private TileEntity[] ents = new TileEntity[6];
|
private TileEntity[] ents = new TileEntity[6];
|
||||||
|
|
||||||
public static final ResourceLocation VALVE_TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "ReleaseValve.png");
|
public static final ResourceLocation VALVE_TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "releaseValve.png");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileEntity te, double d, double d1, double d2, float f)
|
public void renderTileEntityAt(TileEntity te, double d, double d1, double d2, float f)
|
||||||
|
|
|
@ -99,9 +99,9 @@ public class PartGear extends JCuboidPart implements JNormalOcclusion, TFacePart
|
||||||
((PartGear) part).torque = torque;
|
((PartGear) part).torque = torque;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(tile instanceof IMechanical)
|
else if (tile instanceof IMechanical)
|
||||||
{
|
{
|
||||||
((IMechanical)tile).setPower(torque, angularVelocity);
|
((IMechanical) tile).setPower(torque, angularVelocity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Look for gears outside this block space, the relative UP, DOWN, LEFT, RIGHT */
|
/** Look for gears outside this block space, the relative UP, DOWN, LEFT, RIGHT */
|
||||||
|
@ -149,6 +149,7 @@ public class PartGear extends JCuboidPart implements JNormalOcclusion, TFacePart
|
||||||
if (player.isSneaking())
|
if (player.isSneaking())
|
||||||
{
|
{
|
||||||
this.torque += 10;
|
this.torque += 10;
|
||||||
|
this.angularVelocity += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Before Width: | Height: | Size: 771 B After Width: | Height: | Size: 771 B |
Loading…
Reference in a new issue