Merge remote-tracking branch 'origin/master' into TDK

This commit is contained in:
LemADEC 2014-09-02 00:43:03 +02:00
commit 3b218f6503
5 changed files with 47 additions and 29 deletions

View file

@ -170,12 +170,12 @@ function ShowInfo()
Show("Core:")
Show(" x, y, z = "..X..", "..Y..", "..Z)
local energy = warp.get_energy_level()
local energyMax = 1000000
if warpcore.get_energy_max ~= nil then
energyMax = warpcore.get_energy_max()
local energyMax = 100000000
if warp.get_energy_max ~= nil then
energyMax = warp.get_energy_max()
if energyMax == nil then energyMax = 1 end
end
Show(" Energy = "..math.floor(energy / 1000000).." % ("..energy.."EU)")
Show(" Energy = "..math.floor(energy / energyMax).." % ("..energy.."EU)")
Show(" Attached players = "..warp.get_attached_players())
Show("Dimensions:")
Show(" Front, Right, Up = "..GFront..", "..GRight..", "..GUp)

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;
}