Example #1
0
 @Override
 public int getCurrentStrength(int cons, int ch) {
   return ch != 0
       ? -1
       : ((RedPowerLib.mapRotToCon(5, super.Rotation) & cons) > 0
           ? this.PowerVal2
           : ((RedPowerLib.mapRotToCon(10, super.Rotation) & cons) > 0 ? this.PowerVal1 : -1));
 }
Example #2
0
  @Override
  public int getPoweringMask(int ch) {
    if (ch != 0) {
      return 0;
    } else {
      int tr = 0;
      if (this.PowerVal1 > 0) {
        tr |= RedPowerLib.mapRotToCon(10, super.Rotation);
      }

      if (this.PowerVal2 > 0) {
        tr |= RedPowerLib.mapRotToCon(5, super.Rotation);
      }

      return tr;
    }
  }
Example #3
0
 @Override
 public void onBlockNeighborChange(Block bl) {
   if (!this.tryDropBlock()) {
     RedPowerLib.updateCurrent(super.worldObj, super.xCoord, super.yCoord, super.zCoord);
     if (super.SubId != 0) {
       if (!this.isTickRunnable()) {
         this.updatePowerState();
       }
     }
   }
 }
Example #4
0
 @Override
 public int scanPoweringStrength(int cons, int ch) {
   if (ch != 0) {
     return 0;
   } else {
     int r1 = RedPowerLib.mapRotToCon(5, super.Rotation);
     int r2 = RedPowerLib.mapRotToCon(10, super.Rotation);
     return (r1 & cons) > 0
         ? (super.Powered
             ? 255
             : (RedPowerLib.isPowered(
                     super.worldObj, super.xCoord, super.yCoord, super.zCoord, r1 & cons, 0)
                 ? 255
                 : 0))
         : ((r2 & cons) > 0
             ? (RedPowerLib.isPowered(
                     super.worldObj, super.xCoord, super.yCoord, super.zCoord, r2 & cons, 0)
                 ? 255
                 : 0)
             : 0);
   }
 }
Example #5
0
 @Override
 public void updateCurrentStrength() {
   this.PowerVal2 =
       (short)
           RedPowerLib.updateBlockCurrentStrength(
               super.worldObj,
               this,
               super.xCoord,
               super.yCoord,
               super.zCoord,
               RedPowerLib.mapRotToCon(5, super.Rotation),
               1);
   this.PowerVal1 =
       (short)
           RedPowerLib.updateBlockCurrentStrength(
               super.worldObj,
               this,
               super.xCoord,
               super.yCoord,
               super.zCoord,
               RedPowerLib.mapRotToCon(10, super.Rotation),
               1);
   CoreLib.markBlockDirty(super.worldObj, super.xCoord, super.yCoord, super.zCoord);
 }
Example #6
0
 @Override
 public int getConnectionMask() {
   return RedPowerLib.mapRotToCon(15, super.Rotation);
 }
Example #7
0
 @Override
 public boolean isBlockWeakPoweringTo(int l) {
   return RedPowerLib.isSearching()
       ? false
       : (this.getPoweringMask(0) & RedPowerLib.getConDirMask(l ^ 1)) > 0;
 }
Example #8
0
 public int getTopwireMask() {
   return RedPowerLib.mapRotToCon(5, super.Rotation);
 }