diff --git a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergy.java b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergy.java index 2264ae41..8854ad6f 100644 --- a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergy.java +++ b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergy.java @@ -164,12 +164,18 @@ public abstract class TileEntityAbstractEnergy extends TileEntityAbstractInterfa return new Object[] { getEnergyStored(), getMaxEnergyStored() }; } - public String getStatus() { - if (getMaxEnergyStored() != 0) { - return getBlockType().getLocalizedName() + String.format(" energy level is %.0f/%.0f EU.", convertInternalToEU(getEnergyStored()), convertInternalToEU(getMaxEnergyStored())); - } else { - return getBlockType().getLocalizedName(); + public String getEnergyStatus() { + if (getMaxEnergyStored() == 0) { + return ""; } + return String.format("\nEnergy level is %1$.0f/%2$.0f EU.", + convertInternalToEU(getEnergyStored()), + convertInternalToEU(getMaxEnergyStored())); + } + + public String getStatus() { + return getBlockType().getLocalizedName() + + getEnergyStatus(); } // OpenComputer callback methods diff --git a/src/main/java/cr0s/warpdrive/block/energy/TileEntityIC2reactorLaserMonitor.java b/src/main/java/cr0s/warpdrive/block/energy/TileEntityIC2reactorLaserMonitor.java index 4cf216ab..14fcb8ac 100644 --- a/src/main/java/cr0s/warpdrive/block/energy/TileEntityIC2reactorLaserMonitor.java +++ b/src/main/java/cr0s/warpdrive/block/energy/TileEntityIC2reactorLaserMonitor.java @@ -181,7 +181,7 @@ public class TileEntityIC2reactorLaserMonitor extends TileEntityAbstractEnergy { public String getStatus() { Set reactors = findReactors(); return getBlockType().getLocalizedName() - + String.format("\nEnergy level is %.0f/%.0f EU.", convertInternalToEU(getEnergyStored()), convertInternalToEU(getMaxEnergyStored())) + + getEnergyStatus() + "\n" + ((reactors == null || reactors.size() == 0) ? "No reactor found!" : reactors.size() + " reactor(s) connected."); } diff --git a/src/main/java/cr0s/warpdrive/block/movement/BlockShipCore.java b/src/main/java/cr0s/warpdrive/block/movement/BlockShipCore.java index 74eeec56..8fdcc0e0 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/BlockShipCore.java +++ b/src/main/java/cr0s/warpdrive/block/movement/BlockShipCore.java @@ -81,15 +81,15 @@ public class BlockShipCore extends BlockContainer { * Called upon block activation (right click on the block.) */ @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) { if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { return false; } - if (par5EntityPlayer.getHeldItem() == null) { - TileEntity te = par1World.getTileEntity(par2, par3, par4); - if (te != null && te instanceof TileEntityShipCore) { - WarpDrive.addChatMessage(par5EntityPlayer, ((TileEntityShipCore)te).getStatus()); + if (entityPlayer.getHeldItem() == null) { + TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity != null && tileEntity instanceof TileEntityShipCore) { + WarpDrive.addChatMessage(entityPlayer, ((TileEntityShipCore)tileEntity).getStatus()); return true; } } diff --git a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java index c63fb70d..89ef65e8 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java +++ b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java @@ -23,7 +23,6 @@ import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.util.ForgeDirection; import cpw.mods.fml.common.FMLCommonHandler; import cr0s.warpdrive.EntityJump; -import cr0s.warpdrive.LocalProfiler; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.block.TileEntityAbstractEnergy; import cr0s.warpdrive.config.WarpDriveConfig; @@ -377,15 +376,15 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy { } isolationBlocksCount = newCount; if (isolationBlocksCount >= WarpDriveConfig.RADAR_MIN_ISOLATION_BLOCKS) { - isolationRate = WarpDriveConfig.RADAR_MIN_ISOLATION_EFFECT + isolationRate = Math.min(1.0, WarpDriveConfig.RADAR_MIN_ISOLATION_EFFECT + (isolationBlocksCount - WarpDriveConfig.RADAR_MIN_ISOLATION_BLOCKS) // bonus blocks * (WarpDriveConfig.RADAR_MAX_ISOLATION_EFFECT - WarpDriveConfig.RADAR_MIN_ISOLATION_EFFECT) - / (WarpDriveConfig.RADAR_MAX_ISOLATION_BLOCKS - WarpDriveConfig.RADAR_MIN_ISOLATION_BLOCKS); + / (WarpDriveConfig.RADAR_MAX_ISOLATION_BLOCKS - WarpDriveConfig.RADAR_MIN_ISOLATION_BLOCKS)); } else { isolationRate = 0.0D; } if (WarpDriveConfig.LOGGING_JUMPBLOCKS) { - WarpDrive.logger.info(this + " Isolation updated to " + isolationBlocksCount + " (" + String.format("%.1f", isolationRate * 100) + "%)"); + WarpDrive.logger.info(this + " Isolation updated to " + isolationBlocksCount + " (" + String.format("%.1f", isolationRate * 100.0) + "%)"); } } @@ -988,13 +987,10 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy { @Override public String getStatus() { - return getBlockType().getLocalizedName() - + String.format(" '%s' energy level is %.0f/%.0f EU.", - shipName, - convertInternalToEU(getEnergyStored()), - convertInternalToEU(getMaxEnergyStored())) - + ((cooldownTime > 0) ? ("\n" + (cooldownTime / 20) + " s left of cooldown.") - : ((isolationBlocksCount > 0) ? ("\n" + isolationBlocksCount + " active isolation blocks") : "")); + return getBlockType().getLocalizedName() + " '" + shipName + "'" + + getEnergyStatus() + + ((cooldownTime > 0) ? String.format("\n%1$d s left of cooldown.", cooldownTime / 20) : "" + + ((isolationBlocksCount > 0) ? String.format("\n%1$d active isolation blocks providing %2$2.1f%% absorption.", isolationBlocksCount, isolationRate * 100.0) : "")); } public static int calculateRequiredEnergy(ShipCoreMode shipCoreMode, int shipVolume, int jumpDistance) { diff --git a/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporter.java b/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporter.java index 4a659960..0d0dda74 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporter.java +++ b/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporter.java @@ -79,10 +79,7 @@ public class TileEntityTransporter extends TileEntityAbstractEnergy implements I @Override public String getStatus() { return getBlockType().getLocalizedName() - + String.format("Energy level is %.0f/%.0f EU.", - convertInternalToEU(getEnergyStored()), - convertInternalToEU(getMaxEnergyStored()) - ) + + getEnergyStatus() + String.format("\nSource: %.0f %.0f %.0f", sourceVec.x, sourceVec.y, diff --git a/src/main/java/cr0s/warpdrive/config/Recipes.java b/src/main/java/cr0s/warpdrive/config/Recipes.java index c8cc2c65..79c98592 100644 --- a/src/main/java/cr0s/warpdrive/config/Recipes.java +++ b/src/main/java/cr0s/warpdrive/config/Recipes.java @@ -868,18 +868,18 @@ public class Recipes { // Warp isolation is 1 EV Machine casing (Ti), 8 Iridium reinforced plate // or 1 Nether star, 8 diamond - String oreDiamondOrReinforcedIridiumPlate = "gemDiamond"; + String oreEmeraldOrReinforcedIridiumPlate = "gemEmerald"; if (OreDictionary.doesOreNameExist("plateAlloyIridium") && !OreDictionary.getOres("plateAlloyIridium").isEmpty()) {// IndustricalCraft2 and Gregtech - oreDiamondOrReinforcedIridiumPlate = "plateAlloyIridium"; + oreEmeraldOrReinforcedIridiumPlate = "plateAlloyIridium"; } else if (WarpDriveConfig.isEnderIOloaded) {// EnderIO ItemStack itemStackFranckNZombie = WarpDriveConfig.getModItemStack("EnderIO", "itemFrankenSkull", 2); OreDictionary.registerOre("plateAlloyIridium", itemStackFranckNZombie); - oreDiamondOrReinforcedIridiumPlate = "plateAlloyIridium"; + oreEmeraldOrReinforcedIridiumPlate = "plateAlloyIridium"; } else if (WarpDriveConfig.isThermalExpansionLoaded) { - oreDiamondOrReinforcedIridiumPlate = "ingotLumium"; + oreEmeraldOrReinforcedIridiumPlate = "ingotLumium"; } GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(WarpDrive.blockWarpIsolation), false, "iii", "imi", "iii", - 'i', oreDiamondOrReinforcedIridiumPlate, + 'i', oreEmeraldOrReinforcedIridiumPlate, 'm', itemMachineCasingEV)); // Air generator is 1 power interface, 4 activated carbon, 1 motor, 1 MV Machine casing, 2 tanks @@ -1115,7 +1115,7 @@ public class Recipes { } GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(WarpDrive.blockCloakingCoil), false, "iti", "cmc", "iti", 't', oreEmeraldOrTitaniumPlate, - 'i', oreDiamondOrReinforcedIridiumPlate, + 'i', oreEmeraldOrReinforcedIridiumPlate, 'c', itemStackGoldIngotOrCoil, 'm', itemMachineCasingEV )); diff --git a/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java b/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java index d6a411c1..604676d5 100644 --- a/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java +++ b/src/main/java/cr0s/warpdrive/config/WarpDriveConfig.java @@ -180,7 +180,7 @@ public class WarpDriveConfig { public static int RADAR_MAX_ENERGY_STORED = 100000000; // 100kk eU public static int RADAR_MAX_ISOLATION_RANGE = 2; public static int RADAR_MIN_ISOLATION_BLOCKS = 5; - public static int RADAR_MAX_ISOLATION_BLOCKS = 132; + public static int RADAR_MAX_ISOLATION_BLOCKS = 60; public static double RADAR_MIN_ISOLATION_EFFECT = 0.12; public static double RADAR_MAX_ISOLATION_EFFECT = 1.00; @@ -647,8 +647,8 @@ public class WarpDriveConfig { RADAR_MIN_ISOLATION_BLOCKS = clamp(0, 20, config.get("radar", "min_isolation_blocks", RADAR_MIN_ISOLATION_BLOCKS, "number of isolation blocks required to get some isolation (0 to 20)").getInt()); - RADAR_MAX_ISOLATION_BLOCKS = clamp(5, 100, - config.get("radar", "max_isolation_blocks", RADAR_MAX_ISOLATION_BLOCKS, "number of isolation blocks required to reach maximum effect (5 to 100)").getInt()); + RADAR_MAX_ISOLATION_BLOCKS = clamp(5, 94, + config.get("radar", "max_isolation_blocks", RADAR_MAX_ISOLATION_BLOCKS, "number of isolation blocks required to reach maximum effect (5 to 94)").getInt()); RADAR_MIN_ISOLATION_EFFECT = clamp(0.01D, 0.95D, config.get("radar", "min_isolation_effect", RADAR_MIN_ISOLATION_EFFECT, "isolation effect achieved with min number of isolation blocks (0.01 to 0.95)").getDouble(0.12D)); diff --git a/wiki/Isolation_max.png b/wiki/Isolation_max.png new file mode 100644 index 00000000..0041bb60 Binary files /dev/null and b/wiki/Isolation_max.png differ diff --git a/wiki/Isolation_min.png b/wiki/Isolation_min.png new file mode 100644 index 00000000..cca14a2a Binary files /dev/null and b/wiki/Isolation_min.png differ