コード例 #1
0
  @Override
  public void updateEntity() {
    super.updateEntity();
    if (!worldObj.isRemote) {
      if (activated.getValue() && _redstoneAnimTimer > 0) _redstoneAnimTimer--;
      if (activated.getValue() && _redstoneAnimTimer <= 0) {
        activated.setValue(false);
      }

      sync();
    }
  }
コード例 #2
0
 public void setRedstoneSignal(boolean redstoneSignal) {
   if (redstoneSignal != _redstoneSignal) {
     _redstoneSignal = redstoneSignal;
     if (_redstoneSignal) {
       if (!worldObj.isRemote) {
         _redstoneAnimTimer = 5;
         activated.setValue(true);
         sync();
       }
       breakBlock();
     }
   }
 }
コード例 #3
0
 @SideOnly(Side.CLIENT)
 public boolean isActivated() {
   return activated.getValue();
 }