当前位置: 首页>>代码示例>>Java>>正文


Java IProbeInfo类代码示例

本文整理汇总了Java中mcjty.theoneprobe.api.IProbeInfo的典型用法代码示例。如果您正苦于以下问题:Java IProbeInfo类的具体用法?Java IProbeInfo怎么用?Java IProbeInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IProbeInfo类属于mcjty.theoneprobe.api包,在下文中一共展示了IProbeInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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) {
    TileEntity te = world.getTileEntity(data.getPos());
    if(te instanceof IInfoForwarder){
        te = ((IInfoForwarder)te).getInfoTileEntity();
    }
    
    if (te instanceof IPneumaticMachine) {
        TOPCallback.handlePneumatic(mode, probeInfo, (IPneumaticMachine)te);
    }
    if (te instanceof IHeatExchanger) {
        TOPCallback.handleHeat(mode, probeInfo, (IHeatExchanger) te);
    }
    if (ConfigHandler.client.topShowsFluids && te != null && te.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, data.getSideHit())) {
        IFluidHandler handler = te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, data.getSideHit());
        TOPCallback.handleFluidTanks(mode, probeInfo, handler);
    }
    if (te instanceof TileEntityBase) {
        TOPCallback.handleRedstoneMode(mode, probeInfo, (TileEntityBase) te);
    }
    if (te instanceof TileEntityPressureTube) {
        TOPCallback.handlePressureTube(mode, probeInfo, (TileEntityPressureTube) te, data.getSideHit());
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:26,代码来源:BlockPneumaticCraft.java

示例2: 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");
	}
}
 
开发者ID:Maxwell-lt,项目名称:MobBlocker,代码行数:28,代码来源:BlockChunkProtector.java

示例3: overrideStandardInfo

import mcjty.theoneprobe.api.IProbeInfo; //导入依赖的package包/类
@Override
public boolean overrideStandardInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState state, IProbeHitData data) {
	if (state.getBlock() == ModBlocks.DANKNULL_DOCK) {
		ItemStack stack = new ItemStack(ModBlocks.DANKNULL_DOCK);
		TileEntity tile = world.getTileEntity(data.getPos());
		if (tile != null && tile instanceof TileDankNullDock) {
			TileDankNullDock te = (TileDankNullDock) tile;
			NBTTagCompound nbttagcompound = new NBTTagCompound();
			te.writeToNBT(nbttagcompound);
			stack.setTagInfo("BlockEntityTag", nbttagcompound);
			if (player.isSneaking()) {
				probeInfo.horizontal().item(stack).vertical().itemLabel(stack).text("Extraction Mode: " + (te.getExtractionMode() == ExtractionMode.SELECTED ? "Only Selected Item" : "All Items") + " Extracted").text(" ").text("Right-click with empty hand").text("to change extraction mode").text(TextStyleClass.MODNAME.toString() + Tools.getModName(state.getBlock()));
			}
			else {
				probeInfo.horizontal().item(stack).vertical().itemLabel(stack).text(TOP.doSneak).text(TextStyleClass.MODNAME.toString() + Tools.getModName(state.getBlock()));
			}
			return true;
		}
	}
	return false;
}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:22,代码来源:TileDankNullDock.java

示例4: addProbeInfo

import mcjty.theoneprobe.api.IProbeInfo; //导入依赖的package包/类
@Override
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, Entity entity, IProbeHitEntityData data) {
	if (!isTamed()) {
		probeInfo.horizontal().item(new ItemStack(ModItems.FRIENDER_PEARL), new ItemStyle().width(8).height(8)).text(" Right-click with FrienderPearl to tame.");
	}
	else {
		String ownerName = "";
		ownerName = PlayerUUIDUtils.getPlayerName(getOwnerId());
		if (ownerName == "") {
			ownerName = "<Unavailable>";
		}
		probeInfo.horizontal().text("Owner: " + ownerName);
		probeInfo.horizontal().text("Mode: " + (isSitting() ? "Idle" : "Following/Defending"));
		if (isHoldingChest() && player == getOwner()) {
			probeInfo.horizontal().text("Sneak+Right-Click to take chest");
		}
	}
}
 
开发者ID:p455w0rd,项目名称:EndermanEvolution,代码行数:19,代码来源:EntityFrienderman.java

示例5: apply

import mcjty.theoneprobe.api.IProbeInfo; //导入依赖的package包/类
@Nullable
@Override
public Void apply(ITheOneProbe theOneProbe) {
    probe = theOneProbe;
    probe.registerProvider(new IProbeInfoProvider() {
        @Override
        public String getID() {
            return "exnihiloadscensio:topprovider";
        }

        @Override
        public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
            if (blockState.getBlock() instanceof ITOPInfoProvider) {
                ITOPInfoProvider provider = (ITOPInfoProvider) blockState.getBlock();
                provider.addProbeInfo(mode, probeInfo, player, world, blockState, data);
            }

        }
    });
    return null;
}
 
开发者ID:MikeLydeamore,项目名称:ExNihiloAdscensio,代码行数:22,代码来源:CompatTOP.java

示例6: 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");
}
 
开发者ID:MikeLydeamore,项目名称:ExNihiloAdscensio,代码行数:27,代码来源:BlockCrucible.java

示例7: 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)));
		}
	}
	
}
 
开发者ID:MikeLydeamore,项目名称:ExNihiloAdscensio,代码行数:23,代码来源:BlockSieve.java

示例8: 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 + ")");
            }
        }
    }
}
 
开发者ID:McJty,项目名称:AquaMunda,代码行数:22,代码来源:TankBlock.java

示例9: 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);
        }
    }
}
 
开发者ID:McJty,项目名称:AquaMunda,代码行数:23,代码来源:CuttingBoardBlock.java

示例10: 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) + ")");
            }
        }
    }
}
 
开发者ID:McJty,项目名称:AquaMunda,代码行数:17,代码来源:GrindStoneBlock.java

示例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 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);
        }
    }
}
 
开发者ID:McJty,项目名称:AquaMunda,代码行数:26,代码来源:CookerBlock.java

示例12: 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);

    IBlockState camo = getCamoState(world, data.getPos());
    if (camo != null) {
        TOPCallback.handleCamo(mode, probeInfo, camo);
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:11,代码来源:BlockPneumaticCraftCamo.java

示例13: 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));
    }
}
 
开发者ID:Maxwell-lt,项目名称:MobBlocker,代码行数:22,代码来源:BlockAreaProtector.java

示例14: 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");
    }
}
 
开发者ID:McJty,项目名称:needtobreath,代码行数:11,代码来源:PurifierBlock.java

示例15: addProbeInfo

import mcjty.theoneprobe.api.IProbeInfo; //导入依赖的package包/类
@Override
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData hitData)
{
	TileEntity te = world.getTileEntity(hitData.getPos());
	if (te instanceof TileEntityChunkLoader)
	{
		TileEntityChunkLoader loader = (TileEntityChunkLoader) te;
		ForgeChunkManager.Ticket tkt = loader.getChunkTicket();

		if (tkt != null)
		{
			String owner;
			if (tkt.isPlayerTicket())
			{
				owner = tkt.getPlayerName();
			}
			else
			{
				owner = tkt.getModId();
			}

			probeInfo.horizontal().text(TextFormatting.GREEN + "Owner: " + owner);
		}
		else
		{
			probeInfo.horizontal().text(TextFormatting.RED + "No chunk ticket found!");
		}
	}
}
 
开发者ID:DarkMorford,项目名称:Simple-Chunks,代码行数:30,代码来源:BlockChunkLoader.java


注:本文中的mcjty.theoneprobe.api.IProbeInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。