Fixed a couple cloaking crashes

This commit is contained in:
LemADEC 2015-08-30 02:08:16 +02:00
parent 39937f1267
commit c2d2746868
2 changed files with 4 additions and 3 deletions

View file

@ -116,7 +116,7 @@ public class CloakManager {
}
public void removeCloakedArea(final int dimensionId, final int coreX, final int coreY, final int coreZ) {
int index = 0;
int index = -1;
for (int i = 0; i < cloaks.size(); i++) {
CloakedArea area = cloaks.get(i);
if ( area.dimensionId == dimensionId
@ -133,7 +133,9 @@ public class CloakManager {
}
}
cloaks.remove(index);
if (index != -1) {
cloaks.remove(index);
}
}
public CloakedArea getCloakedArea(World worldObj, int x, int y, int z) {

View file

@ -112,7 +112,6 @@ public class CloakedArea {
}
// Sending only if field changes: sets up or collapsing
@SideOnly(Side.SERVER)
public void sendCloakPacketToPlayersEx(final boolean decloak) {
if (WarpDriveConfig.LOGGING_CLOAKING) {
WarpDrive.logger.info("sendCloakPacketToPlayersEx " + decloak);