本文整理汇总了Java中mcjty.theoneprobe.api.IProbeInfo.progress方法的典型用法代码示例。如果您正苦于以下问题:Java IProbeInfo.progress方法的具体用法?Java IProbeInfo.progress怎么用?Java IProbeInfo.progress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mcjty.theoneprobe.api.IProbeInfo
的用法示例。
在下文中一共展示了IProbeInfo.progress方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addProbeInfo
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
@Override
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
super.addProbeInfo(mode, probeInfo, player, world, blockState, data);
TileEntity te = world.getTileEntity(data.getPos());
if (te instanceof CuttingBoardTE) {
CuttingBoardTE cuttingBoardTE = (CuttingBoardTE) te;
IInterfaceHandle selectedHandle = cuttingBoardTE.getHandle(player);
if (selectedHandle != null) {
ItemStack currentStack = selectedHandle.getCurrentStack(te);
if (ItemStackTools.isValid(currentStack)) {
probeInfo.text(TextFormatting.GREEN + currentStack.getDisplayName() + " (" + ItemStackTools.getStackSize(currentStack) + ")");
}
}
int chopCounter = cuttingBoardTE.getChopCounter();
int maxChopCounter = cuttingBoardTE.getMaxChopCounter();
if (chopCounter >= 0) {
probeInfo.progress(chopCounter, maxChopCounter);
}
}
}
示例2: addProbeInfo
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
@Override
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
super.addProbeInfo(mode, probeInfo, player, world, blockState, data);
TileEntity te = world.getTileEntity(data.getPos());
if (te instanceof CookerTE) {
CookerTE cookerTE = (CookerTE) te;
IInterfaceHandle selectedHandle = cookerTE.getHandle(player);
if (selectedHandle != null) {
ItemStack currentStack = selectedHandle.getCurrentStack(te);
if (ItemStackTools.isValid(currentStack)) {
probeInfo.text(TextFormatting.GREEN + currentStack.getDisplayName() + " (" + ItemStackTools.getStackSize(currentStack) + ")");
}
}
DecimalFormat decimalFormat = new DecimalFormat("#.#");
probeInfo.text(TextFormatting.GREEN + "Filled: " + cookerTE.getFilledPercentage() + "%");
probeInfo.text(TextFormatting.GREEN + "Temperature: " + decimalFormat.format(cookerTE.getTemperature()));
int cookTime = cookerTE.getCookTime();
int maxCookTime = cookerTE.getMaxCookTime();
if (cookTime >= 0) {
probeInfo.progress(cookTime, maxCookTime);
}
}
}
示例3: addProbeInfo
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
@Override
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
super.addProbeInfo(mode, probeInfo, player, world, blockState, data);
TileEntity te = world.getTileEntity(data.getPos());
if (te instanceof PurifierTileEntity) {
probeInfo.progress(((PurifierTileEntity) te).getCoalticks(), ((PurifierTileEntity) te).getMaxCoalTicks());
DecimalFormat fmt = new DecimalFormat("#.##");
probeInfo.horizontal().text(LABEL + "Consumption: " + INFO + fmt.format(((PurifierTileEntity) te).getLastCoalPerTick()) + "/t");
}
}
示例4: addProbeInfo
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
@Override
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world,
IBlockState blockState, IProbeHitData data) {
TileInfestedLeaves tile = (TileInfestedLeaves) world.getTileEntity(data.getPos());
if (tile.getProgress() >= 1.0F) {
probeInfo.text("Progress: Done");
} else {
probeInfo.progress((int) (tile.getProgress()*100), 100);
}
}
示例5: mkRfLine
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
private void mkRfLine(ProbeMode mode, EioBox eiobox, TOPData data) {
if (data.hasRF) {
if (mode != ProbeMode.NORMAL || topShowPowerByDefault) {
IProbeInfo rfLine = eiobox.get().horizontal(eiobox.center()).item(Material.POWDER_INFINITY.getStack());
if (data.hasRFIO) {
rfLine = rfLine.vertical();
}
if (data.isPowered) {
rfLine.progress(data.rf, data.maxrf, eiobox.getProbeinfo().defaultProgressStyle().suffix(EnderIO.lang.localize("top.suffix.rf"))
.filledColor(0xffd63223).alternateFilledColor(0xffd63223));
} else {
rfLine.text(loc("top.machine.outofpower"));
}
if (data.hasRFIO) {
rfLine = rfLine.horizontal();
rfLine.vertical(eiobox.getProbeinfo().defaultLayoutStyle().spacing(-1))//
.text(loc("top.rf.header.avg")).text(loc("top.rf.header.maxin")).text(loc("top.rf.header.maxout"));
// LangPower.format should be run on the client, but we have no way to do that
String line1 = loc("top.rf.value",
(data.avgRF == 0 ? TextFormatting.WHITE : data.avgRF > 0 ? TextFormatting.GREEN + "+" : TextFormatting.RED) + LangPower.format(data.avgRF));
String line2 = loc("top.rf.value", LangPower.format(data.maxRFIn));
String line3 = loc("top.rf.value", LangPower.format(data.maxRFOut));
rfLine = rfLine.vertical(eiobox.getProbeinfo().defaultLayoutStyle().spacing(-1)).text(line1).text(line2).text(line3);
}
} else {
eiobox.addMore();
}
}
}
示例6: mkProgressLine
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
private void mkProgressLine(ProbeMode mode, EioBox eiobox, TOPData data) {
if (data.progressResult != TOPData.ProgressResult.NONE) {
if (mode != ProbeMode.NORMAL || topShowProgressByDefault || data.progressResult == TOPData.ProgressResult.PROGRESS_NO_POWER) {
final IProbeInfo progressLine = eiobox.get().horizontal(eiobox.center()).item(new ItemStack(Items.CLOCK));
switch (data.progressResult) {
case PROGRESS:
progressLine.progress((int) (data.progress * 100), 100, eiobox.getProbeinfo().defaultProgressStyle()
.suffix(EnderIO.lang.localize("top.suffix.percent")).filledColor(0xffffb600).alternateFilledColor(0xffffb600));
break;
case PROGRESS_NO_POWER:
progressLine.text(loc("top.progress.outofpower"));
break;
case PROGRESS_ACTIVE:
case NO_PROGRESS_ACTIVE:
progressLine.text(loc("top.machine.active"));
break;
case PROGRESS_IDLE:
case NO_PROGRESS_IDLE:
progressLine.text(loc("top.machine.idle"));
break;
case NONE:
break;
}
} else {
eiobox.addMore();
}
}
}
示例7: addMachineProbeInfo
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
/**
* Call from addProbeInfo
*/
public default void addMachineProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data)
{
if(world.isRemote) return;
AbstractMachine machine = this.machine(world, data.getPos());
if(machine == null) return;
probeInfo.text(machine.machineName().toUpperCase());
probeInfo.text(I18n.translateToLocalFormatted("probe.machine.domain",
machine.getDomain() == null ? I18n.translateToLocal("misc.unassigned") : machine.getDomain().getName()));
if(machine.hasTransportManager(StorageType.ITEM))
{
// if(machine.blockManager().itemCircuit() != null)
// {
// probeInfo.text(I18n.translateToLocalFormatted("Item circuit: %d version: %d",
// machine.blockManager().itemCircuit().carrierAddress(),
// machine.blockManager().itemCircuit().bridgeVersion()));
// }
probeInfo.text("Item Legs: " + machine.itemTransport().legs().toString());
}
if(!machine.energyManager().isEmpty())
{
probeInfo.progress(machine.energyManager().storedEnergyJoules(),
machine.energyManager().maxStoredEnergyJoules());
probeInfo.text("Stored Energy: " + MachinePower.formatEnergy(
machine.energyManager().storedEnergyJoules(), false));
float netCharge = machine.energyManager().netStorageWatts();
probeInfo.text((netCharge >= 0 ? "Charge Rate: " : "Discharge Rate: ")
+ MachinePower.formatPower(
(long) netCharge, true));
}
if(machine.hasTransportManager(StorageType.POWER))
{
// if(machine.blockManager().powerCircuit() != null)
// {
// probeInfo.text(I18n.translateToLocalFormatted("Power circuit: %d version: %d",
// machine.blockManager().powerCircuit().carrierAddress(),
// machine.blockManager().powerCircuit().bridgeVersion()));
// }
probeInfo.text("Power Legs: " + machine.tranportManager(StorageType.POWER).legs().toString());
}
}