Refactored tooltip handling
This commit is contained in:
parent
a78529a11d
commit
4f7f866571
18 changed files with 91 additions and 82 deletions
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
|
import cr0s.warpdrive.block.*;
|
||||||
import cr0s.warpdrive.block.forcefield.*;
|
import cr0s.warpdrive.block.forcefield.*;
|
||||||
import cr0s.warpdrive.block.hull.BlockHullStairs;
|
import cr0s.warpdrive.block.hull.BlockHullStairs;
|
||||||
import cr0s.warpdrive.item.*;
|
import cr0s.warpdrive.item.*;
|
||||||
|
@ -46,15 +47,6 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
import cr0s.warpdrive.block.BlockAirGenerator;
|
|
||||||
import cr0s.warpdrive.block.BlockChunkLoader;
|
|
||||||
import cr0s.warpdrive.block.BlockLaser;
|
|
||||||
import cr0s.warpdrive.block.BlockLaserMedium;
|
|
||||||
import cr0s.warpdrive.block.TileEntityAbstractChunkLoading;
|
|
||||||
import cr0s.warpdrive.block.TileEntityAirGenerator;
|
|
||||||
import cr0s.warpdrive.block.TileEntityChunkLoader;
|
|
||||||
import cr0s.warpdrive.block.TileEntityLaser;
|
|
||||||
import cr0s.warpdrive.block.TileEntityLaserMedium;
|
|
||||||
import cr0s.warpdrive.block.building.BlockShipScanner;
|
import cr0s.warpdrive.block.building.BlockShipScanner;
|
||||||
import cr0s.warpdrive.block.building.TileEntityShipScanner;
|
import cr0s.warpdrive.block.building.TileEntityShipScanner;
|
||||||
import cr0s.warpdrive.block.collection.BlockLaserTreeFarm;
|
import cr0s.warpdrive.block.collection.BlockLaserTreeFarm;
|
||||||
|
@ -248,158 +240,158 @@ public class WarpDrive implements LoadingCallback {
|
||||||
// CORE CONTROLLER
|
// CORE CONTROLLER
|
||||||
blockShipController = new BlockShipController();
|
blockShipController = new BlockShipController();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockShipController, "blockShipController");
|
GameRegistry.registerBlock(blockShipController, ItemBlockAbstractBase.class, "blockShipController");
|
||||||
GameRegistry.registerTileEntity(TileEntityShipController.class, MODID + ":blockShipController");
|
GameRegistry.registerTileEntity(TileEntityShipController.class, MODID + ":blockShipController");
|
||||||
|
|
||||||
// SHIP CORE
|
// SHIP CORE
|
||||||
blockShipCore = new BlockShipCore();
|
blockShipCore = new BlockShipCore();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockShipCore, "blockShipCore");
|
GameRegistry.registerBlock(blockShipCore, ItemBlockAbstractBase.class, "blockShipCore");
|
||||||
GameRegistry.registerTileEntity(TileEntityShipCore.class, MODID + ":blockShipCore");
|
GameRegistry.registerTileEntity(TileEntityShipCore.class, MODID + ":blockShipCore");
|
||||||
|
|
||||||
// RADAR
|
// RADAR
|
||||||
blockRadar = new BlockRadar();
|
blockRadar = new BlockRadar();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockRadar, "blockRadar");
|
GameRegistry.registerBlock(blockRadar, ItemBlockAbstractBase.class, "blockRadar");
|
||||||
GameRegistry.registerTileEntity(TileEntityRadar.class, MODID + ":blockRadar");
|
GameRegistry.registerTileEntity(TileEntityRadar.class, MODID + ":blockRadar");
|
||||||
|
|
||||||
// WARP ISOLATION
|
// WARP ISOLATION
|
||||||
blockWarpIsolation = new BlockWarpIsolation();
|
blockWarpIsolation = new BlockWarpIsolation();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockWarpIsolation, "blockWarpIsolation");
|
GameRegistry.registerBlock(blockWarpIsolation, ItemBlockAbstractBase.class, "blockWarpIsolation");
|
||||||
|
|
||||||
// AIR GENERATOR
|
// AIR GENERATOR
|
||||||
blockAirGenerator = new BlockAirGenerator();
|
blockAirGenerator = new BlockAirGenerator();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockAirGenerator, "blockAirGenerator");
|
GameRegistry.registerBlock(blockAirGenerator, ItemBlockAbstractBase.class, "blockAirGenerator");
|
||||||
GameRegistry.registerTileEntity(TileEntityAirGenerator.class, MODID + ":blockAirGenerator");
|
GameRegistry.registerTileEntity(TileEntityAirGenerator.class, MODID + ":blockAirGenerator");
|
||||||
|
|
||||||
// AIR BLOCK
|
// AIR BLOCK
|
||||||
blockAir = new BlockAir();
|
blockAir = new BlockAir();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockAir, "blockAir");
|
GameRegistry.registerBlock(blockAir, ItemBlockAbstractBase.class, "blockAir");
|
||||||
|
|
||||||
// GAS BLOCK
|
// GAS BLOCK
|
||||||
blockGas = new BlockGas();
|
blockGas = new BlockGas();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockGas, "blockGas");
|
GameRegistry.registerBlock(blockGas, ItemBlockAbstractBase.class, "blockGas");
|
||||||
|
|
||||||
// LASER EMITTER
|
// LASER EMITTER
|
||||||
blockLaser = new BlockLaser();
|
blockLaser = new BlockLaser();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockLaser, "blockLaser");
|
GameRegistry.registerBlock(blockLaser, ItemBlockAbstractBase.class, "blockLaser");
|
||||||
GameRegistry.registerTileEntity(TileEntityLaser.class, MODID + ":blockLaser");
|
GameRegistry.registerTileEntity(TileEntityLaser.class, MODID + ":blockLaser");
|
||||||
|
|
||||||
// LASER EMITTER WITH CAMERA
|
// LASER EMITTER WITH CAMERA
|
||||||
blockLaserCamera = new BlockLaserCamera();
|
blockLaserCamera = new BlockLaserCamera();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockLaserCamera, "blockLaserCamera");
|
GameRegistry.registerBlock(blockLaserCamera, ItemBlockAbstractBase.class, "blockLaserCamera");
|
||||||
GameRegistry.registerTileEntity(TileEntityLaserCamera.class, MODID + ":blockLaserCamera");
|
GameRegistry.registerTileEntity(TileEntityLaserCamera.class, MODID + ":blockLaserCamera");
|
||||||
|
|
||||||
// LASER EMITTER WITH CAMERA
|
// LASER EMITTER WITH CAMERA
|
||||||
blockWeaponController = new BlockWeaponController();
|
blockWeaponController = new BlockWeaponController();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockWeaponController, "blockWeaponController");
|
GameRegistry.registerBlock(blockWeaponController, ItemBlockAbstractBase.class, "blockWeaponController");
|
||||||
GameRegistry.registerTileEntity(TileEntityWeaponController.class, MODID + ":blockWeaponController");
|
GameRegistry.registerTileEntity(TileEntityWeaponController.class, MODID + ":blockWeaponController");
|
||||||
|
|
||||||
// CAMERA
|
// CAMERA
|
||||||
blockCamera = new BlockCamera();
|
blockCamera = new BlockCamera();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockCamera, "blockCamera");
|
GameRegistry.registerBlock(blockCamera, ItemBlockAbstractBase.class, "blockCamera");
|
||||||
GameRegistry.registerTileEntity(TileEntityCamera.class, MODID + ":blockCamera");
|
GameRegistry.registerTileEntity(TileEntityCamera.class, MODID + ":blockCamera");
|
||||||
|
|
||||||
// MONITOR
|
// MONITOR
|
||||||
blockMonitor = new BlockMonitor();
|
blockMonitor = new BlockMonitor();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockMonitor, "blockMonitor");
|
GameRegistry.registerBlock(blockMonitor, ItemBlockAbstractBase.class, "blockMonitor");
|
||||||
GameRegistry.registerTileEntity(TileEntityMonitor.class, MODID + ":blockMonitor");
|
GameRegistry.registerTileEntity(TileEntityMonitor.class, MODID + ":blockMonitor");
|
||||||
|
|
||||||
// MINING LASER
|
// MINING LASER
|
||||||
blockMiningLaser = new BlockMiningLaser();
|
blockMiningLaser = new BlockMiningLaser();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockMiningLaser, "blockMiningLaser");
|
GameRegistry.registerBlock(blockMiningLaser, ItemBlockAbstractBase.class, "blockMiningLaser");
|
||||||
GameRegistry.registerTileEntity(TileEntityMiningLaser.class, MODID + ":blockMiningLaser");
|
GameRegistry.registerTileEntity(TileEntityMiningLaser.class, MODID + ":blockMiningLaser");
|
||||||
|
|
||||||
// LASER TREE FARM
|
// LASER TREE FARM
|
||||||
blockLaserTreeFarm = new BlockLaserTreeFarm();
|
blockLaserTreeFarm = new BlockLaserTreeFarm();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockLaserTreeFarm, "blockLaserTreeFarm");
|
GameRegistry.registerBlock(blockLaserTreeFarm, ItemBlockAbstractBase.class, "blockLaserTreeFarm");
|
||||||
GameRegistry.registerTileEntity(TileEntityLaserTreeFarm.class, MODID + ":blockLaserTreeFarm");
|
GameRegistry.registerTileEntity(TileEntityLaserTreeFarm.class, MODID + ":blockLaserTreeFarm");
|
||||||
|
|
||||||
// LASER MEDIUM
|
// LASER MEDIUM
|
||||||
blockLaserMedium = new BlockLaserMedium();
|
blockLaserMedium = new BlockLaserMedium();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockLaserMedium, "blockLaserMedium");
|
GameRegistry.registerBlock(blockLaserMedium, ItemBlockAbstractBase.class, "blockLaserMedium");
|
||||||
GameRegistry.registerTileEntity(TileEntityLaserMedium.class, MODID + ":blockLaserMedium");
|
GameRegistry.registerTileEntity(TileEntityLaserMedium.class, MODID + ":blockLaserMedium");
|
||||||
|
|
||||||
// LIFT
|
// LIFT
|
||||||
blockLift = new BlockLift();
|
blockLift = new BlockLift();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockLift, "blockLift");
|
GameRegistry.registerBlock(blockLift, ItemBlockAbstractBase.class, "blockLift");
|
||||||
GameRegistry.registerTileEntity(TileEntityLift.class, MODID + ":blockLift");
|
GameRegistry.registerTileEntity(TileEntityLift.class, MODID + ":blockLift");
|
||||||
|
|
||||||
// IRIDIUM BLOCK
|
// IRIDIUM BLOCK
|
||||||
blockIridium = new BlockIridium();
|
blockIridium = new BlockIridium();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockIridium, "blockIridium");
|
GameRegistry.registerBlock(blockIridium, ItemBlockAbstractBase.class, "blockIridium");
|
||||||
|
|
||||||
// HIGHLY ADVANCED MACHINE BLOCK
|
// HIGHLY ADVANCED MACHINE BLOCK
|
||||||
blockHighlyAdvancedMachine = new BlockHighlyAdvancedMachine();
|
blockHighlyAdvancedMachine = new BlockHighlyAdvancedMachine();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockHighlyAdvancedMachine, "blockHighlyAdvancedMachine");
|
GameRegistry.registerBlock(blockHighlyAdvancedMachine, ItemBlockAbstractBase.class, "blockHighlyAdvancedMachine");
|
||||||
|
|
||||||
// SHIP SCANNER
|
// SHIP SCANNER
|
||||||
blockShipScanner = new BlockShipScanner();
|
blockShipScanner = new BlockShipScanner();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockShipScanner, "blockShipScanner");
|
GameRegistry.registerBlock(blockShipScanner, ItemBlockAbstractBase.class, "blockShipScanner");
|
||||||
GameRegistry.registerTileEntity(TileEntityShipScanner.class, MODID + ":blockShipScanner");
|
GameRegistry.registerTileEntity(TileEntityShipScanner.class, MODID + ":blockShipScanner");
|
||||||
|
|
||||||
// CLOAKING DEVICE CORE
|
// CLOAKING DEVICE CORE
|
||||||
blockCloakingCore = new BlockCloakingCore();
|
blockCloakingCore = new BlockCloakingCore();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockCloakingCore, "blockCloakingCore");
|
GameRegistry.registerBlock(blockCloakingCore, ItemBlockAbstractBase.class, "blockCloakingCore");
|
||||||
GameRegistry.registerTileEntity(TileEntityCloakingCore.class, MODID + ":blockCloakingCore");
|
GameRegistry.registerTileEntity(TileEntityCloakingCore.class, MODID + ":blockCloakingCore");
|
||||||
|
|
||||||
// CLOAKING DEVICE COIL
|
// CLOAKING DEVICE COIL
|
||||||
blockCloakingCoil = new BlockCloakingCoil();
|
blockCloakingCoil = new BlockCloakingCoil();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockCloakingCoil, "blockCloakingCoil");
|
GameRegistry.registerBlock(blockCloakingCoil, ItemBlockAbstractBase.class, "blockCloakingCoil");
|
||||||
|
|
||||||
// TRANSPORTER
|
// TRANSPORTER
|
||||||
blockTransporter = new BlockTransporter();
|
blockTransporter = new BlockTransporter();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockTransporter, "blockTransporter");
|
GameRegistry.registerBlock(blockTransporter, ItemBlockAbstractBase.class, "blockTransporter");
|
||||||
GameRegistry.registerTileEntity(TileEntityTransporter.class, MODID + ":blockTransporter");
|
GameRegistry.registerTileEntity(TileEntityTransporter.class, MODID + ":blockTransporter");
|
||||||
|
|
||||||
// IC2 REACTOR LASER MONITOR
|
// IC2 REACTOR LASER MONITOR
|
||||||
if (WarpDriveConfig.isIndustrialCraft2Loaded) {
|
if (WarpDriveConfig.isIndustrialCraft2Loaded) {
|
||||||
blockIC2reactorLaserMonitor = new BlockIC2reactorLaserMonitor();
|
blockIC2reactorLaserMonitor = new BlockIC2reactorLaserMonitor();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockIC2reactorLaserMonitor, "blockIC2reactorLaserMonitor");
|
GameRegistry.registerBlock(blockIC2reactorLaserMonitor, ItemBlockAbstractBase.class, "blockIC2reactorLaserMonitor");
|
||||||
GameRegistry.registerTileEntity(TileEntityIC2reactorLaserMonitor.class, MODID + ":blockIC2reactorLaserMonitor");
|
GameRegistry.registerTileEntity(TileEntityIC2reactorLaserMonitor.class, MODID + ":blockIC2reactorLaserMonitor");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TRANSPORT BEACON
|
// TRANSPORT BEACON
|
||||||
blockTransportBeacon = new BlockTransportBeacon();
|
blockTransportBeacon = new BlockTransportBeacon();
|
||||||
|
|
||||||
GameRegistry.registerBlock(blockTransportBeacon, "blockTransportBeacon");
|
GameRegistry.registerBlock(blockTransportBeacon, ItemBlockAbstractBase.class, "blockTransportBeacon");
|
||||||
|
|
||||||
// POWER REACTOR, LASER, STORE
|
// POWER REACTOR, LASER, STORE
|
||||||
blockEnanReactorCore = new BlockEnanReactorCore();
|
blockEnanReactorCore = new BlockEnanReactorCore();
|
||||||
GameRegistry.registerBlock(blockEnanReactorCore, "blockEnanReactorCore");
|
GameRegistry.registerBlock(blockEnanReactorCore, ItemBlockAbstractBase.class, "blockEnanReactorCore");
|
||||||
GameRegistry.registerTileEntity(TileEntityEnanReactorCore.class, MODID + ":blockEnanReactorCore");
|
GameRegistry.registerTileEntity(TileEntityEnanReactorCore.class, MODID + ":blockEnanReactorCore");
|
||||||
|
|
||||||
blockEnanReactorLaser = new BlockEnanReactorLaser();
|
blockEnanReactorLaser = new BlockEnanReactorLaser();
|
||||||
GameRegistry.registerBlock(blockEnanReactorLaser, "blockEnanReactorLaser");
|
GameRegistry.registerBlock(blockEnanReactorLaser, ItemBlockAbstractBase.class, "blockEnanReactorLaser");
|
||||||
GameRegistry.registerTileEntity(TileEntityEnanReactorLaser.class, MODID + ":blockEnanReactorLaser");
|
GameRegistry.registerTileEntity(TileEntityEnanReactorLaser.class, MODID + ":blockEnanReactorLaser");
|
||||||
|
|
||||||
blockEnergyBank = new BlockEnergyBank();
|
blockEnergyBank = new BlockEnergyBank();
|
||||||
GameRegistry.registerBlock(blockEnergyBank, "blockEnergyBank");
|
GameRegistry.registerBlock(blockEnergyBank, ItemBlockAbstractBase.class, "blockEnergyBank");
|
||||||
GameRegistry.registerTileEntity(TileEntityEnergyBank.class, MODID + ":blockEnergyBank");
|
GameRegistry.registerTileEntity(TileEntityEnergyBank.class, MODID + ":blockEnergyBank");
|
||||||
|
|
||||||
// CHUNK LOADER
|
// CHUNK LOADER
|
||||||
blockChunkLoader = new BlockChunkLoader();
|
blockChunkLoader = new BlockChunkLoader();
|
||||||
GameRegistry.registerBlock(blockChunkLoader, "blockChunkLoader");
|
GameRegistry.registerBlock(blockChunkLoader, ItemBlockAbstractBase.class, "blockChunkLoader");
|
||||||
GameRegistry.registerTileEntity(TileEntityChunkLoader.class, MODID + ":blockChunkLoader");
|
GameRegistry.registerTileEntity(TileEntityChunkLoader.class, MODID + ":blockChunkLoader");
|
||||||
|
|
||||||
// FORCE FIELD BLOCKS
|
// FORCE FIELD BLOCKS
|
||||||
|
@ -410,7 +402,7 @@ public class WarpDrive implements LoadingCallback {
|
||||||
int index = tier - 1;
|
int index = tier - 1;
|
||||||
// FORCE FIELD
|
// FORCE FIELD
|
||||||
blockForceFields[index] = new BlockForceField(tier);
|
blockForceFields[index] = new BlockForceField(tier);
|
||||||
GameRegistry.registerBlock(blockForceFields[index], "blockForceField" + tier);
|
GameRegistry.registerBlock(blockForceFields[index], ItemBlockAbstractBase.class, "blockForceField" + tier);
|
||||||
GameRegistry.registerTileEntity(TileEntityForceField.class, MODID + ":blockForceField" + tier);
|
GameRegistry.registerTileEntity(TileEntityForceField.class, MODID + ":blockForceField" + tier);
|
||||||
|
|
||||||
// FORCE FIELD PROJECTOR
|
// FORCE FIELD PROJECTOR
|
||||||
|
@ -426,7 +418,7 @@ public class WarpDrive implements LoadingCallback {
|
||||||
/* TODO
|
/* TODO
|
||||||
// SECURITY STATION
|
// SECURITY STATION
|
||||||
blockSecurityStation = new BlockSecurityStation();
|
blockSecurityStation = new BlockSecurityStation();
|
||||||
GameRegistry.registerBlock(blockSecurityStation, "blockSecurityStation");
|
GameRegistry.registerBlock(blockSecurityStation, ItemBlockAbstractBase.class, "blockSecurityStation");
|
||||||
GameRegistry.registerTileEntity(TileEntitySecurityStation.class, MODID + ":blockSecurityStation");
|
GameRegistry.registerTileEntity(TileEntitySecurityStation.class, MODID + ":blockSecurityStation");
|
||||||
*/
|
*/
|
||||||
// DECORATIVE
|
// DECORATIVE
|
||||||
|
|
|
@ -33,11 +33,11 @@ public class ItemBlockAbstractBase extends ItemBlock {
|
||||||
|
|
||||||
public String getStatus(final NBTTagCompound nbtTagCompound) {
|
public String getStatus(final NBTTagCompound nbtTagCompound) {
|
||||||
TileEntity tileEntity = field_150939_a.createTileEntity(null, 0);
|
TileEntity tileEntity = field_150939_a.createTileEntity(null, 0);
|
||||||
if (tileEntity instanceof TileEntityAbstractEnergy) {
|
if (tileEntity instanceof TileEntityAbstractBase) {
|
||||||
if (nbtTagCompound != null) {
|
if (nbtTagCompound != null) {
|
||||||
tileEntity.readFromNBT(nbtTagCompound);
|
tileEntity.readFromNBT(nbtTagCompound);
|
||||||
}
|
}
|
||||||
return ((TileEntityAbstractEnergy)tileEntity).getStatus();
|
return ((TileEntityAbstractBase)tileEntity).getStatus();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.tileentity.TileEntityChest;
|
import net.minecraft.tileentity.TileEntityChest;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
@ -335,6 +336,11 @@ public abstract class TileEntityAbstractBase extends TileEntity implements IBloc
|
||||||
return nbtTagCompound;
|
return nbtTagCompound;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// status
|
||||||
|
public String getStatus() {
|
||||||
|
return (worldObj != null ? StatCollector.translateToLocalFormatted("warpdrive.guide.prefix", getBlockType().getLocalizedName()) : "");
|
||||||
|
}
|
||||||
|
|
||||||
// upgrade system
|
// upgrade system
|
||||||
private final HashMap<Object, Integer> installedUpgrades = new HashMap<>(10);
|
private final HashMap<Object, Integer> installedUpgrades = new HashMap<>(10);
|
||||||
private final HashMap<Object, Integer> maxUpgrades = new HashMap<>(10);
|
private final HashMap<Object, Integer> maxUpgrades = new HashMap<>(10);
|
||||||
|
|
|
@ -531,10 +531,14 @@ public class TileEntityLaser extends TileEntityAbstractLaser implements IBeamFre
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return StatCollector.translateToLocalFormatted("warpdrive.guide.prefix",
|
if (worldObj == null || !worldObj.isRemote) {
|
||||||
getBlockType().getLocalizedName())
|
return super.getStatus()
|
||||||
+ getBeamFrequencyStatus();
|
+ "\n" + getBeamFrequencyStatus();
|
||||||
|
} else {
|
||||||
|
return super.getStatus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void playSoundCorrespondsEnergy(int energy) {
|
private void playSoundCorrespondsEnergy(int energy) {
|
||||||
|
|
|
@ -720,7 +720,9 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
|
||||||
return super.callMethod(computer, context, method, arguments);
|
return super.callMethod(computer, context, method, arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
|
// @TODO merge with base
|
||||||
int energy = getEnergyStored();
|
int energy = getEnergyStored();
|
||||||
String state = "IDLE (not farming)";
|
String state = "IDLE (not farming)";
|
||||||
if (currentState == STATE_IDLE) {
|
if (currentState == STATE_IDLE) {
|
||||||
|
|
|
@ -514,7 +514,9 @@ public class TileEntityMiningLaser extends TileEntityAbstractMiner {
|
||||||
return super.callMethod(computer, context, method, arguments);
|
return super.callMethod(computer, context, method, arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
|
// @TODO merge with base
|
||||||
int energy = getEnergyStored();
|
int energy = getEnergyStored();
|
||||||
String state = "IDLE (not mining)";
|
String state = "IDLE (not mining)";
|
||||||
if (currentState == STATE_IDLE) {
|
if (currentState == STATE_IDLE) {
|
||||||
|
|
|
@ -102,9 +102,9 @@ public class TileEntityCamera extends TileEntityAbstractInterfaced implements IV
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return StatCollector.translateToLocalFormatted("warpdrive.guide.prefix",
|
return super.getStatus()
|
||||||
getBlockType().getLocalizedName())
|
|
||||||
+ getVideoChannelStatus();
|
+ getVideoChannelStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -360,6 +360,10 @@ public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
|
if (worldObj == null) {
|
||||||
|
return super.getStatus();
|
||||||
|
}
|
||||||
|
|
||||||
String unlocalizedStatus;
|
String unlocalizedStatus;
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
unlocalizedStatus = "warpdrive.cloakingCore.invalidAssembly";
|
unlocalizedStatus = "warpdrive.cloakingCore.invalidAssembly";
|
||||||
|
@ -370,11 +374,10 @@ public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
||||||
} else {
|
} else {
|
||||||
unlocalizedStatus = "warpdrive.cloakingCore.cloaking";
|
unlocalizedStatus = "warpdrive.cloakingCore.cloaking";
|
||||||
}
|
}
|
||||||
return StatCollector.translateToLocalFormatted("warpdrive.guide.prefix",
|
return super.getStatus()
|
||||||
getBlockType().getLocalizedName())
|
+ "\n" + StatCollector.translateToLocalFormatted(unlocalizedStatus,
|
||||||
+ StatCollector.translateToLocalFormatted(unlocalizedStatus,
|
tier,
|
||||||
tier,
|
volume);
|
||||||
volume);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// OpenComputer callback methods
|
// OpenComputer callback methods
|
||||||
|
|
|
@ -72,7 +72,6 @@ public class TileEntityMonitor extends TileEntityAbstractInterfaced implements I
|
||||||
} else {
|
} else {
|
||||||
CameraRegistryItem camera = WarpDrive.cameras.getCameraByVideoChannel(worldObj, videoChannel);
|
CameraRegistryItem camera = WarpDrive.cameras.getCameraByVideoChannel(worldObj, videoChannel);
|
||||||
if (camera == null) {
|
if (camera == null) {
|
||||||
WarpDrive.cameras.printRegistry(worldObj);
|
|
||||||
return StatCollector.translateToLocalFormatted("warpdrive.videoChannel.statusLine.invalidOrNotLoaded", videoChannel);
|
return StatCollector.translateToLocalFormatted("warpdrive.videoChannel.statusLine.invalidOrNotLoaded", videoChannel);
|
||||||
} else if (camera.isTileEntity(this)) {
|
} else if (camera.isTileEntity(this)) {
|
||||||
return StatCollector.translateToLocalFormatted("warpdrive.videoChannel.statusLine.valid", videoChannel);
|
return StatCollector.translateToLocalFormatted("warpdrive.videoChannel.statusLine.valid", videoChannel);
|
||||||
|
@ -86,9 +85,9 @@ public class TileEntityMonitor extends TileEntityAbstractInterfaced implements I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return StatCollector.translateToLocalFormatted("warpdrive.guide.prefix",
|
return super.getStatus()
|
||||||
getBlockType().getLocalizedName())
|
|
||||||
+ getVideoChannelStatus();
|
+ getVideoChannelStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,16 +187,18 @@ public class TileEntityIC2reactorLaserMonitor extends TileEntityAbstractEnergy {
|
||||||
@Override
|
@Override
|
||||||
@Optional.Method(modid = "IC2")
|
@Optional.Method(modid = "IC2")
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
|
if (worldObj == null) {
|
||||||
|
return super.getStatus();
|
||||||
|
}
|
||||||
|
|
||||||
Set<IReactor> reactors = findReactors();
|
Set<IReactor> reactors = findReactors();
|
||||||
if (reactors != null && !reactors.isEmpty()) {
|
if (reactors != null && !reactors.isEmpty()) {
|
||||||
return StatCollector.translateToLocalFormatted("warpdrive.guide.prefix",
|
return super.getStatus()
|
||||||
getBlockType().getLocalizedName())
|
+ StatCollector.translateToLocalFormatted("warpdrive.IC2reactorLaserMonitor.multipleReactors",
|
||||||
+ StatCollector.translateToLocalFormatted("warpdrive.IC2reactorLaserMonitor.multipleReactors",
|
reactors.size());
|
||||||
reactors.size());
|
|
||||||
} else {
|
} else {
|
||||||
return StatCollector.translateToLocalFormatted("warpdrive.guide.prefix",
|
return super.getStatus()
|
||||||
getBlockType().getLocalizedName())
|
+ StatCollector.translateToLocalFormatted("warpdrive.IC2reactorLaserMonitor.noReactor");
|
||||||
+ StatCollector.translateToLocalFormatted("warpdrive.IC2reactorLaserMonitor.noReactor");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,10 +109,9 @@ public class TileEntityAbstractForceField extends TileEntityAbstractEnergy imple
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
String strEnergyStatus = getEnergyStatus();
|
return super.getStatus()
|
||||||
return (worldObj != null ? StatCollector.translateToLocalFormatted("warpdrive.guide.prefix", getBlockType().getLocalizedName()) : "")
|
|
||||||
+ (strEnergyStatus.isEmpty() ? "" : "\n" + strEnergyStatus)
|
|
||||||
+ "\n" + getBeamFrequencyStatus();
|
+ "\n" + getBeamFrequencyStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -864,6 +864,7 @@ public class TileEntityForceFieldProjector extends TileEntityAbstractForceField
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return super.getStatus()
|
return super.getStatus()
|
||||||
+ "\n" + getShapeStatus()
|
+ "\n" + getShapeStatus()
|
||||||
|
|
|
@ -260,9 +260,9 @@ public class TileEntityShipController extends TileEntityAbstractInterfaced {
|
||||||
getAttachedPlayersList());
|
getAttachedPlayersList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return StatCollector.translateToLocalFormatted("warpdrive.guide.prefix",
|
return super.getStatus()
|
||||||
getBlockType().getLocalizedName())
|
|
||||||
+ StatCollector.translateToLocalFormatted("warpdrive.ship.attachedPlayers",
|
+ StatCollector.translateToLocalFormatted("warpdrive.ship.attachedPlayers",
|
||||||
getAttachedPlayersList());
|
getAttachedPlayersList());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1016,9 +1016,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return StatCollector.translateToLocalFormatted("warpdrive.guide.prefix",
|
return super.getStatus()
|
||||||
getBlockType().getLocalizedName())
|
|
||||||
+ "\n" + getEnergyStatus()
|
|
||||||
+ ((cooldownTime > 0) ? "\n" + StatCollector.translateToLocalFormatted("warpdrive.ship.statusLine.cooling", cooldownTime / 20) : "")
|
+ ((cooldownTime > 0) ? "\n" + StatCollector.translateToLocalFormatted("warpdrive.ship.statusLine.cooling", cooldownTime / 20) : "")
|
||||||
+ ((isolationBlocksCount > 0) ? "\n" + StatCollector.translateToLocalFormatted("warpdrive.ship.statusLine.isolation", isolationBlocksCount, isolationRate * 100.0) : "");
|
+ ((isolationBlocksCount > 0) ? "\n" + StatCollector.translateToLocalFormatted("warpdrive.ship.statusLine.isolation", isolationBlocksCount, isolationRate * 100.0) : "");
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,9 +76,7 @@ public class TileEntityTransporter extends TileEntityAbstractEnergy implements I
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return StatCollector.translateToLocalFormatted("warpdrive.guide.prefix",
|
return super.getStatus()
|
||||||
getBlockType().getLocalizedName())
|
|
||||||
+ "\n" + getEnergyStatus()
|
|
||||||
+ "\n" + StatCollector.translateToLocalFormatted("warpdrive.transporter.status",
|
+ "\n" + StatCollector.translateToLocalFormatted("warpdrive.transporter.status",
|
||||||
sourceVec.x, sourceVec.y, sourceVec.z,
|
sourceVec.x, sourceVec.y, sourceVec.z,
|
||||||
destVec.x, destVec.y, destVec.z);
|
destVec.x, destVec.y, destVec.z);
|
||||||
|
|
|
@ -104,9 +104,12 @@ public class TileEntityLaserCamera extends TileEntityLaser implements IVideoChan
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return StatCollector.translateToLocalFormatted("warpdrive.guide.prefix",
|
if (worldObj == null || worldObj.isRemote) {
|
||||||
getBlockType().getLocalizedName())
|
return super.getStatus()
|
||||||
+ (worldObj.isRemote ? getVideoChannelStatus() : getBeamFrequencyStatus());
|
+ "\n" + getVideoChannelStatus();
|
||||||
|
} else {
|
||||||
|
return super.getStatus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,12 +21,7 @@ public class TileEntityWeaponController extends TileEntityAbstractInterfaced {
|
||||||
public void updateEntity() {
|
public void updateEntity() {
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStatus() {
|
|
||||||
return StatCollector.translateToLocalFormatted("warpdrive.guide.prefix",
|
|
||||||
getBlockType().getLocalizedName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound tag) {
|
public void readFromNBT(NBTTagCompound tag) {
|
||||||
super.readFromNBT(tag);
|
super.readFromNBT(tag);
|
||||||
|
|
|
@ -17,6 +17,9 @@ public class CamerasRegistry {
|
||||||
}
|
}
|
||||||
|
|
||||||
public CameraRegistryItem getCameraByVideoChannel(World world, int videoChannel) {
|
public CameraRegistryItem getCameraByVideoChannel(World world, int videoChannel) {
|
||||||
|
if (world == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
CameraRegistryItem cam;
|
CameraRegistryItem cam;
|
||||||
for (Iterator<CameraRegistryItem> it = registry.iterator(); it.hasNext();) {
|
for (Iterator<CameraRegistryItem> it = registry.iterator(); it.hasNext();) {
|
||||||
cam = it.next();
|
cam = it.next();
|
||||||
|
@ -107,7 +110,6 @@ public class CamerasRegistry {
|
||||||
|
|
||||||
public void updateInRegistry(World world, ChunkPosition position, int videoChannel, EnumCameraType enumCameraType) {
|
public void updateInRegistry(World world, ChunkPosition position, int videoChannel, EnumCameraType enumCameraType) {
|
||||||
CameraRegistryItem cam = new CameraRegistryItem(world, position, videoChannel, enumCameraType);
|
CameraRegistryItem cam = new CameraRegistryItem(world, position, videoChannel, enumCameraType);
|
||||||
// WarpDrive.debugPrint("updateInRegistry " + cam.position.x + ", " + cam.position.y + ", " + cam.position.z);
|
|
||||||
removeDeadCams(world);
|
removeDeadCams(world);
|
||||||
|
|
||||||
if (isCamAlive(world, cam)) {
|
if (isCamAlive(world, cam)) {
|
||||||
|
@ -135,6 +137,9 @@ public class CamerasRegistry {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void printRegistry(World world) {
|
public void printRegistry(World world) {
|
||||||
|
if (world == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
WarpDrive.logger.info("Cameras registry for dimension " + world.provider.dimensionId + ":");
|
WarpDrive.logger.info("Cameras registry for dimension " + world.provider.dimensionId + ":");
|
||||||
|
|
||||||
for (CameraRegistryItem cam : registry) {
|
for (CameraRegistryItem cam : registry) {
|
||||||
|
|
Loading…
Reference in a new issue