本文整理汇总了Java中mcjty.theoneprobe.api.IProbeInfo.text方法的典型用法代码示例。如果您正苦于以下问题:Java IProbeInfo.text方法的具体用法?Java IProbeInfo.text怎么用?Java IProbeInfo.text使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mcjty.theoneprobe.api.IProbeInfo
的用法示例。
在下文中一共展示了IProbeInfo.text方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addProbeInfo
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
/**
* Called by TOP compatibility handler
* @param mode
* @param probeInfo
* @param player
* @param world
* @param blockState
* @param data
*/
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
TileEntity te = world.getTileEntity(data.getPos());
if (te instanceof TileEntityChunkProtector) {
TileEntityChunkProtector chunkprotector = (TileEntityChunkProtector) te;
int secondsLeft = chunkprotector.getSecondsBeforeDestroyed();
int ticksLeft = chunkprotector.getTicksBeforeDestroyed();
if (ticksLeft != -1) {
if (mode == ProbeMode.NORMAL) {
probeInfo.text(TextFormatting.BLUE + Integer.toString(secondsLeft) + " seconds left in world");
} else if (mode == ProbeMode.EXTENDED) {
probeInfo.text(TextFormatting.BLUE + Integer.toString(ticksLeft) + " ticks left in world");
} else if (mode == ProbeMode.DEBUG) {
probeInfo.text(TextFormatting.BLUE + Integer.toString(secondsLeft) + " seconds left in world");
probeInfo.text(TextFormatting.BLUE + Integer.toString(ticksLeft) + " ticks left in world");
}
} else probeInfo.text(TextFormatting.GRAY + "Won't decay");
}
}
示例2: addProbeInfo
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
@Override
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world,
IBlockState blockState, IProbeHitData data) {
TileCrucible crucible = (TileCrucible) world.getTileEntity(data.getPos());
if (crucible == null)
return;
ItemStack solid = crucible.getCurrentItem() == null ? null : crucible.getCurrentItem().getItemStack();
FluidStack liquid = crucible.getTank().getFluid();
String solidName = solid == null ? "None" : solid.getDisplayName();
String liquidName = liquid == null ? "None" : liquid.getLocalizedName();
int solidAmount = Math.max(0, crucible.getSolidAmount());
ItemStack toMelt = crucible.getItemHandler().getStackInSlot(0);
if (toMelt != null) {
solidAmount += CrucibleRegistry.getMeltable(toMelt).getAmount() * toMelt.stackSize;
}
probeInfo.text(String.format("Solid (%s): %d", solidName, solidAmount));
probeInfo.text(String.format("Liquid (%s): %d", liquidName, crucible.getTank().getFluidAmount()));
probeInfo.text("Rate: " + crucible.getHeatRate() + "x");
}
示例3: addProbeInfo
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
@Override
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world,
IBlockState blockState, IProbeHitData data) {
TileSieve sieve = (TileSieve) world.getTileEntity(data.getPos());
if (sieve == null)
return;
if (sieve.getMeshStack() == null) {
probeInfo.text("Mesh: None");
return;
}
probeInfo.text("Mesh: " + I18n.format(sieve.getMeshStack().getUnlocalizedName() + ".name"));
if (mode == ProbeMode.EXTENDED) {
Map<Enchantment, Integer> enchantments = EnchantmentHelper.getEnchantments(sieve.getMeshStack());
for (Enchantment enchantment : enchantments.keySet()) {
probeInfo.text(TextFormatting.BLUE + enchantment.getTranslatedName(enchantments.get(enchantment)));
}
}
}
示例4: 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 TankTE) {
TankTE tankTE = (TankTE) te;
int blockID = tankTE.getID();
if (blockID != -1) {
IMultiBlockClientInfo clientInfo = ImmersiveCraftHandler.tankNetwork.getClientInfo(blockID);
if (clientInfo != null) {
TankClientInfo tankClientInfo = (TankClientInfo) clientInfo;
probeInfo.text(TextFormatting.GREEN + "Id: " + blockID);
Fluid fluid = tankClientInfo.getFluid();
if (fluid != null) {
probeInfo.text(TextFormatting.GREEN + "Liquid: " + Tank.getFluidName(fluid));
}
probeInfo.text(TextFormatting.GREEN + "Contents: " + tankClientInfo.getContents() + " (" + tankClientInfo.getBlockCount() * TankTE.MAX_CONTENTS + ")");
}
}
}
}
示例5: 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);
}
}
}
示例6: 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 GrindStoneTE) {
GrindStoneTE grindStoneTE = (GrindStoneTE) te;
IInterfaceHandle selectedHandle = grindStoneTE.getHandle(player);
if (selectedHandle != null) {
ItemStack currentStack = selectedHandle.getCurrentStack(te);
if (ItemStackTools.isValid(currentStack)) {
probeInfo.text(TextFormatting.GREEN + currentStack.getDisplayName() + " (" + ItemStackTools.getStackSize(currentStack) + ")");
}
}
}
}
示例7: 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);
}
}
}
示例8: addProbeInfo
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
/**
* Called by TOP compatibility handler
* @param mode
* @param probeInfo
* @param player
* @param world
* @param blockState
* @param data
*/
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
TileEntity te = world.getTileEntity(data.getPos());
if (te instanceof TileEntityAreaProtector) {
int xrange = Config.areaProtectorX;
int yrange = Config.areaProtectorY;
int zrange = Config.areaProtectorZ;
probeInfo.text(TextFormatting.BOLD + "Range:");
probeInfo.text(TextFormatting.YELLOW + " X" + TextFormatting.RESET + " = " + TextFormatting.GREEN + "±" + Integer.toString(xrange));
probeInfo.text(TextFormatting.YELLOW + " Y" + TextFormatting.RESET + " = " + TextFormatting.GREEN + "±" + Integer.toString(yrange));
probeInfo.text(TextFormatting.YELLOW + " Z" + TextFormatting.RESET + " = " + TextFormatting.GREEN + "±" + Integer.toString(zrange));
}
}
示例9: 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);
}
}
示例10: addProbeInfo
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
@Override
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world,
IBlockState blockState, IProbeHitData data) {
TileBarrel barrel = (TileBarrel) world.getTileEntity(data.getPos());
if (barrel == null)
return;
if (mode == ProbeMode.EXTENDED)
probeInfo.text(TextFormatting.GREEN + "Mode: "+StringUtils.capitalize(barrel.getMode().getName()));
List<String> tooltips = barrel.getMode().getWailaTooltip(barrel, new ArrayList<String>());
for (String tooltip : tooltips) {
probeInfo.text( tooltip);
}
}
示例11: 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 tileEntity = world.getTileEntity(data.getPos());
if (tileEntity instanceof DesalinationTankTE) {
DesalinationTankTE te = (DesalinationTankTE) tileEntity;
DecimalFormat decimalFormat = new DecimalFormat("#.#");
probeInfo.text(TextFormatting.GREEN + "Liquid: " + FluidRegistry.getFluidName(te.getSupportedFluid()));
probeInfo.text(TextFormatting.GREEN + "Contents: " + te.getContents() + " (" + DesalinationTankTE.MAX_CONTENTS + ")");
}
}
示例12: 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 tileEntity = world.getTileEntity(data.getPos());
if (tileEntity instanceof DesalinationBoilerTE) {
DesalinationBoilerTE te = (DesalinationBoilerTE) tileEntity;
DecimalFormat decimalFormat = new DecimalFormat("#.#");
probeInfo.text(TextFormatting.GREEN + "Liquid: " + FluidRegistry.getFluidName(te.getSupportedFluid()));
probeInfo.text(TextFormatting.GREEN + "Contents: " + te.getContents() + " (" + DesalinationBoilerTE.MAX_CONTENTS + ")");
probeInfo.text(TextFormatting.GREEN + "Temperature: " + decimalFormat.format(te.getTemperature()));
}
}
示例13: addProbeInfo
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
@Override
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
if (!freshWaterNearby(world, data.getPos())) {
probeInfo.text(TextFormatting.YELLOW + "No fresh water nearby!");
} else {
EnvironmentData environment = EnvironmentData.getEnvironmentData(player.getEntityWorld());
byte level = environment.getData().get(player.getEntityWorld().provider.getDimension(), data.getPos());
probeInfo.text(TextFormatting.GREEN + "Moistness: " + (level * 100 / SprinklerTE.MAX_MOISTNESS) + "%");
}
}
示例14: addProbeInfo
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
@Override
@Optional.Method(modid = "theoneprobe")
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data)
{
super.addProbeInfo(mode, probeInfo, player, world, blockState, data);
if(Simulator.instance().lavaSimulator() instanceof LavaSimulator)
{
LavaSimulator sim = (LavaSimulator)Simulator.instance().lavaSimulator();
BlockPos pos = data.getPos();
LavaCell cell = sim.cells.getCellIfExists(pos.getX(), pos.getY(), pos.getZ());
if(cell == null)
{
probeInfo.text("Cell not checked.");
}
else
{
probeInfo.text("Cell ID = " + cell.id)
.text("FluidUnits=" + cell.fluidUnits() + " FluidSurfaceLevel=" + cell.worldSurfaceLevel() + " Fluid Levels=" + (cell.fluidLevels()))
.text("RawRetainedUnits=" + cell.getRawRetainedUnits() + " RawRetained Depth=" + (cell.getRawRetainedUnits() / LavaSimulator.FLUID_UNITS_PER_LEVEL))
.text("SmoothRetainedUnits=" + cell.getSmoothedRetainedUnits() + " SmoothRetained Depth=" + (cell.getSmoothedRetainedUnits() / LavaSimulator.FLUID_UNITS_PER_LEVEL))
.text("floor=" + cell.floorLevel() + " ceiling=" + cell.ceilingLevel() + " isFlowFloor=" + cell.isBottomFlow() + " floorFlowHeight=" + cell.floorFlowHeight())
.text(" avgLevelWithPrecisionShifted=" + (cell.avgFluidSurfaceLevelWithPrecision >> 6))
.text("Visible Level = " + cell.getCurrentVisibleLevel() + " Last Visible Level = " + cell.getLastVisibleLevel())
.text("Connection Count = " + cell.connections.size());
}
}
}
示例15: addProbeInfo
import mcjty.theoneprobe.api.IProbeInfo; //导入方法依赖的package包/类
@Method(modid = "theoneprobe")
@Override
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
SignInfo info = getSignInfo(world, data.getPos());
String modName = info.activateTag.equals(SignRegistry.ALWAYS_ACTIVE_TAG) ? "Minecraft" : info.activateTag;
probeInfo.text(Colors.LIGHTGRAY + Localization.ITEM.SIGN.MATERIAL_ORIGIN.translate(Colors.WHITE + Utils.getModName(modName)));
if (mode.equals(ProbeMode.EXTENDED) || mode.equals(ProbeMode.DEBUG)) {
probeInfo.text(Colors.LIGHTGRAY + Localization.ITEM.SIGN.MATERIAL.translate(Colors.WHITE + info.material.materialName));
}
}