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


Java IWailaDataAccessor.getStack方法代码示例

本文整理汇总了Java中mcp.mobius.waila.api.IWailaDataAccessor.getStack方法的典型用法代码示例。如果您正苦于以下问题:Java IWailaDataAccessor.getStack方法的具体用法?Java IWailaDataAccessor.getStack怎么用?Java IWailaDataAccessor.getStack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mcp.mobius.waila.api.IWailaDataAccessor的用法示例。


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

示例1: getWailaStack

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
/** Change tooltip item stack */
@Override
@Optional.Method(modid = "Waila")
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
	
	// get the icon from the tile entity
	TileEntity te = accessor.getTileEntity();
	if(te instanceof TileEntityBlockEverything) {
		TileEntityBlockEverything tile = (TileEntityBlockEverything)te;
		if(tile.contains == null) return accessor.getStack();
		ItemStack stack = new ItemStack(accessor.getBlock());
		stack.setTagCompound(new NBTTagCompound());
		NBTTagCompound tags = new NBTTagCompound();
		tile.contains.writeToNBT(tags);
		stack.getTagCompound().setTag("contains", tags);
		return stack;
	} else {
		return accessor.getStack();
	}
}
 
开发者ID:sblectric,项目名称:EverythingBlocks,代码行数:21,代码来源:WailaTileHandler.java

示例2: getWailaStack

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public ItemStack getWailaStack (IWailaDataAccessor data, IWailaConfigHandler cfg) {

    final Block block = Block.getBlockFromItem(data.getStack().getItem());

    if (block instanceof BlockSneaky && !data.getTileEntity().isInvalid()) {

        final TileEntitySneaky tile = (TileEntitySneaky) data.getTileEntity();

        if (cfg.getConfig(CONFIG_SNEAKY_OWNERS) && tile.playerID != null && !tile.playerID.isEmpty() && data.getPlayer().getUniqueID().toString().equals(tile.playerID)) {
            return data.getStack();
        }

        if (tile.heldState != null) {
            return new ItemStack(tile.heldState.getBlock(), 1, tile.heldState.getBlock().getMetaFromState(tile.heldState));
        }
    }

    else if (data.getBlock() instanceof BlockFakeTNT) {
        return new ItemStack(Blocks.TNT, 1, 0);
    }

    return new ItemStack(data.getStack().getItem(), 1, 0);
}
 
开发者ID:Darkhax-Minecraft,项目名称:Dark-Utilities,代码行数:25,代码来源:DarkUtilsTileProvider.java

示例3: getWailaStack

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
	ItemStack stack = accessor.getStack();
	if (accessor.getBlock() instanceof BlockInfusedBlockOre && accessor.getPlayer() != null
			&& config.getConfig("hideinfusedore")) {
		stack = ((BlockInfusedBlockOre) accessor.getBlock()).getPickBlock(accessor.getPosition(),
				accessor.getWorld(), accessor.getPosition().blockX, accessor.getPosition().blockY,
				accessor.getPosition().blockZ, accessor.getPlayer());
	}
	return stack;
}
 
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:12,代码来源:WailaInfusedBlockOre.java

示例4: getWailaStack

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
@Optional.Method(modid = "Waila")
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
	if(accessor.getBlock() instanceof BlockContainerLC) {
		return accessor.getBlock().getPickBlock(accessor.getBlockState(), accessor.getMOP(), 
				accessor.getWorld(), accessor.getPosition(), accessor.getPlayer());
	}
	return accessor.getStack();
}
 
开发者ID:sblectric,项目名称:LightningCraft,代码行数:10,代码来源:WailaTileHandler.java

示例5: getWailaStack

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) 
{
	return accessor.getStack();
}
 
开发者ID:StrayWolfe,项目名称:TerrafirmaPunk-Tweaks,代码行数:6,代码来源:WAILAInfo.java


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