Fixed cloak requiring reboot when resizing it
Added explicit error logs
This commit is contained in:
parent
d0d4387dd1
commit
f7baa1c33e
1 changed files with 8 additions and 9 deletions
|
@ -89,9 +89,6 @@ public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
||||||
|
|
||||||
updateTicks--;
|
updateTicks--;
|
||||||
if (updateTicks <= 0) {
|
if (updateTicks <= 0) {
|
||||||
if (WarpDriveConfig.LOGGING_CLOAKING) {
|
|
||||||
WarpDrive.logger.info(this + " Updating cloaking state...");
|
|
||||||
}
|
|
||||||
updateTicks = ((tier == 1) ? 20 : (tier == 2) ? 10 : 20) * WarpDriveConfig.CLOAKING_FIELD_REFRESH_INTERVAL_SECONDS; // resetting timer
|
updateTicks = ((tier == 1) ? 20 : (tier == 2) ? 10 : 20) * WarpDriveConfig.CLOAKING_FIELD_REFRESH_INTERVAL_SECONDS; // resetting timer
|
||||||
|
|
||||||
isRefreshNeeded = validateAssembly();
|
isRefreshNeeded = validateAssembly();
|
||||||
|
@ -133,9 +130,7 @@ public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
||||||
if (area != null) {
|
if (area != null) {
|
||||||
area.sendCloakPacketToPlayersEx(false); // re-cloak field
|
area.sendCloakPacketToPlayersEx(false); // re-cloak field
|
||||||
} else {
|
} else {
|
||||||
if (WarpDriveConfig.LOGGING_CLOAKING) {
|
WarpDrive.logger.error("getCloakedArea1 returned null for " + worldObj + " " + xCoord + "," + yCoord + "," + zCoord);
|
||||||
WarpDrive.logger.info("getCloakedArea1 returned null for " + worldObj + " " + xCoord + "," + yCoord + "," + zCoord);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {// enabled, not cloaking and not able to
|
} else {// enabled, not cloaking and not able to
|
||||||
|
@ -154,15 +149,19 @@ public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
||||||
|
|
||||||
} else {// enabled, cloaking and valid
|
} else {// enabled, cloaking and valid
|
||||||
if (hasEnoughPower) {// enabled, cloaking and able to
|
if (hasEnoughPower) {// enabled, cloaking and able to
|
||||||
|
if (isRefreshNeeded) {
|
||||||
|
WarpDrive.cloaks.updateCloakedArea(worldObj,
|
||||||
|
worldObj.provider.dimensionId, xCoord, yCoord, zCoord, tier,
|
||||||
|
minX, minY, minZ, maxX, maxY, maxZ);
|
||||||
|
}
|
||||||
|
|
||||||
// IDLE
|
// IDLE
|
||||||
// Refresh the field (workaround to re-synchronize players since client may 'eat up' the packets)
|
// Refresh the field (workaround to re-synchronize players since client may 'eat up' the packets)
|
||||||
final CloakedArea area = WarpDrive.cloaks.getCloakedArea(worldObj, xCoord, yCoord, zCoord);
|
final CloakedArea area = WarpDrive.cloaks.getCloakedArea(worldObj, xCoord, yCoord, zCoord);
|
||||||
if (area != null) {
|
if (area != null) {
|
||||||
area.sendCloakPacketToPlayersEx(false); // re-cloak field
|
area.sendCloakPacketToPlayersEx(false); // re-cloak field
|
||||||
} else {
|
} else {
|
||||||
if (WarpDriveConfig.LOGGING_CLOAKING) {
|
WarpDrive.logger.error("getCloakedArea2 returned null for " + worldObj + " " + xCoord + "," + yCoord + "," + zCoord);
|
||||||
WarpDrive.logger.info("getCloakedArea2 returned null for " + worldObj + " " + xCoord + "," + yCoord + "," + zCoord);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
setCoilsState(true);
|
setCoilsState(true);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue