コード例 #1
0
 @Override
 public void setOwner(ItemPossessor newOwner) {
   final ItemPossessor prevOwner = super.owner;
   super.setOwner(newOwner);
   if (prevOwner != newOwner) {
     if (newOwner instanceof Room) circuitKey = CMLib.tech().registerElectrics(this, circuitKey);
     else {
       CMLib.tech().unregisterElectronics(this, circuitKey);
       circuitKey = null;
     }
   }
 }
コード例 #2
0
 @Override
 public void destroy() {
   if ((!destroyed) && (circuitKey != null)) {
     CMLib.tech().unregisterElectronics(this, circuitKey);
     circuitKey = null;
   }
   super.destroy();
 }