コード例 #1
0
 protected void writePowerToReciever(ShaftPowerReceiver sp) {
   if (sp.isReceiving() && sp.canReadFromBlock(xCoord, yCoord, zCoord)) {
     sp.setOmega(omega);
     sp.setTorque(torque);
     sp.setPower(omega * torque);
   } else {
     sp.setOmega(0);
     sp.setTorque(0);
     sp.setPower(0);
   }
 }
コード例 #2
0
 protected void writeToPowerReceiverAt(World world, int x, int y, int z, int om, int tq) {
   TileEntity te = world.getBlockTileEntity(x, y, z);
   if (te instanceof ShaftPowerReceiver) {
     ShaftPowerReceiver sp = (ShaftPowerReceiver) te;
     if (sp.isReceiving() && sp.canReadFromBlock(xCoord, yCoord, zCoord)) {
       sp.setOmega(om);
       sp.setTorque(tq);
       sp.setPower(om * tq);
     } else {
       sp.setOmega(0);
       sp.setTorque(0);
       sp.setPower(0);
     }
   }
 }