Stabilisation fixes

Fixed lasercam failing to return result to Computer
Added particle booster fail safe mode on right click and jump when
invalid tile entity found
Added a few logs to investigate jump client/server desync
This commit is contained in:
LemADEC 2014-09-02 00:28:53 +02:00
parent 5c595e39b1
commit 53082abc1e
4 changed files with 43 additions and 25 deletions

View file

@ -1170,6 +1170,7 @@ public class EntityJump extends Entity
newTileEntity = TileEntity.createAndLoadEntity(oldnbt);
}
if (newTileEntity != null) {
newTileEntity.worldObj = targetWorld;
newTileEntity.validate();
@ -1179,6 +1180,10 @@ public class EntityJump extends Entity
WarpDriveConfig.forgeMultipart_tileMultipart_onChunkLoad.invoke(newTileEntity);
WarpDriveConfig.forgeMultipart_helper_sendDescPacket.invoke(null, targetWorld, newTileEntity);
}
} else {
WarpDrive.print(this + " moveBlockSimple failed to create new tile entity at " + shipBlock.x + ", " + shipBlock.y + ", " + shipBlock.z + " blockId " + shipBlock.blockID + ":" + shipBlock.blockMeta);
WarpDrive.print("NBT data was " + ((oldnbt == null) ? "null" : oldnbt.toString()));
}
}
} catch (Exception exception) {
exception.printStackTrace();

View file

@ -84,11 +84,13 @@ public class BlockParticleBooster extends BlockContainer {
return false;
}
WarpEnergyTE te = (WarpEnergyTE)par1World.getBlockTileEntity(par2, par3, par4);
if (te != null && (par5EntityPlayer.getHeldItem() == null)) {
par5EntityPlayer.addChatMessage(te.getStatus());
if (par5EntityPlayer.getHeldItem() == null) {
TileEntity te = par1World.getBlockTileEntity(par2, par3, par4);
if (te != null && te instanceof WarpEnergyTE) {
par5EntityPlayer.addChatMessage(((WarpEnergyTE) te).getStatus());
return true;
}
}
return false;
}

View file

@ -515,11 +515,20 @@ public class TileEntityLaser extends WarpTE implements IPeripheral {
case 3: // getFirstHit()
if (firstHit != null) {
try {
int blockID = worldObj.getBlockId(firstHit.blockX, firstHit.blockY, firstHit.blockZ);
int blockMeta = worldObj.getBlockMetadata(firstHit.blockX, firstHit.blockY, firstHit.blockZ);
float blockResistance = Block.blocksList[blockID].blockResistance;
float blockResistance = -2;
if (Block.blocksList[blockID] != null) {
blockResistance = Block.blocksList[blockID].blockResistance;
}
Object[] info = { firstHit.blockX, firstHit.blockY, firstHit.blockZ, blockID, blockMeta, blockResistance };
firstHit = null;
return info;
} catch (Exception e) {
e.printStackTrace();
return new Integer[] { 0, 0, 0, 0, 0, -3 };
}
} else {
return new Integer[] { 0, 0, 0, 0, 0, -1 };
}

View file

@ -234,10 +234,12 @@ public class TileEntityReactor extends WarpEnergyTE
messageToAllPlayersOnShip(reason.toString());
return;
}
WarpDrive.debugPrint("!!! makePlayersOnShipDrunk targetCooldown " + targetCooldown);
makePlayersOnShipDrunk(targetCooldown + WarpDriveConfig.WC_WARMUP_RANDOM_TICKS);
}
if (!soundPlayed && (soundThreshold > warmupTime)) {
WarpDrive.debugPrint("!!! playSoundEffect soundThreshold " + soundThreshold + " warmupTime " + warmupTime);
worldObj.playSoundEffect(xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, soundFile, 4F, 1F);
soundPlayed = true;
}