本文整理汇总了Java中mcp.mobius.waila.api.IWailaDataAccessor.getBlock方法的典型用法代码示例。如果您正苦于以下问题:Java IWailaDataAccessor.getBlock方法的具体用法?Java IWailaDataAccessor.getBlock怎么用?Java IWailaDataAccessor.getBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mcp.mobius.waila.api.IWailaDataAccessor
的用法示例。
在下文中一共展示了IWailaDataAccessor.getBlock方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
示例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);
}
示例3: getWailaBody
import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public List<String> getWailaBody (ItemStack stack, List<String> tip, IWailaDataAccessor data, IWailaConfigHandler cfg) {
if (data.getBlock() instanceof BlockFilter && cfg.getConfig(CONFIG_FILTER_TYPE) && !(stack.getMetadata() > FilterType.getTypes().length)) {
tip.add(I18n.format("tooltip.darkutils.filter.type") + ": " + TextFormatting.AQUA + I18n.format("tooltip.darkutils.filter.type." + FilterType.getTypes()[stack.getMetadata()]));
}
else if (data.getBlock() instanceof BlockTimer && cfg.getConfig(CONFIG_TIMER_TIME) && data.getTileEntity() instanceof TileEntityTimer && !data.getTileEntity().isInvalid()) {
final int delay = data.getNBTData().getInteger("TickRate");
final int currentTime = data.getNBTData().getInteger("CurrentTime");
tip.add(I18n.format("gui.darkutils.timer.delay") + ": " + delay);
tip.add(I18n.format("gui.darkutils.timer.remaining") + ": " + StringUtils.ticksToElapsedTime(delay - currentTime));
}
return tip;
}
示例4: oreStack
import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
private ItemStack oreStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
int meta = accessor.getMetadata();
TEModOre te = (TEModOre) accessor.getTileEntity();
ItemStack itemstack = null;
if (accessor.getBlock() == ModBlocks.ore) {
if (config.getConfig("tfc.oreQuality"))
itemstack = new ItemStack(ModItems.oreChunk, 1, getOreGrade(te, meta)); // Shows specific quality ore.
else
itemstack = new ItemStack(ModItems.oreChunk, 1, meta); // All normal quality ores.
return itemstack;
}
return null;
}
示例5: getWailaBody
import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
Block block = accessor.getBlock();
if (block instanceof WailaInfoProvider) {
return ((WailaInfoProvider) block).getWailaBody(itemStack, currenttip, accessor, config);
}
return currenttip;
}
示例6: getWailaStack
import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public ItemStack getWailaStack(IWailaDataAccessor iWailaDataAccessor, IWailaConfigHandler iWailaConfigHandler) {
if (!this.forgeMode && iWailaDataAccessor.getBlock() instanceof IRandoresItem) {
ItemStack stack = new ItemStack(((IRandoresItem) iWailaDataAccessor.getBlock()).getThis());
TileEntity entity = iWailaDataAccessor.getTileEntity();
if (entity != null && entity instanceof RandoresTileEntity) {
((RandoresTileEntity) entity).getData().applyTo(stack);
}
return stack;
}
return ItemStack.EMPTY;
}
示例7: getWailaStack
import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config)
{
Block block = accessor.getBlock();
if (block instanceof CSBlock)
{
CSBlock csBlock = (CSBlock) block;
return new ItemStack(block, 1, csBlock.getSubtype(accessor.getBlockState()));
}
return null;
}
示例8: 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;
}
示例9: getWailaBody
import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
if (PrimordialConfig.enableExtraWAILAInfo) {
if (accessor.getBlock() instanceof CropBlocksSpecial) {
float chance = PrimordialConfig.specialSeedExtraChance;
currenttip.add(String.format("%s%.0f%% %s", Colours.YELLOW, chance, "Change of extra seed"));
if (PrimordialConfig.enableBonemealUse) {
currenttip.add(String.format("%s%s", Colours.LIGHTGREEN, "Bonemeal use Enabled"));
} else {
currenttip.add(String.format("%s%s", Colours.LIGHTRED, "Bonemeal use Disabled"));
}
}
}
return currenttip;
}
示例10: getWailaBody
import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
if (PrimordialConfig.enableExtraWAILAInfo) {
if (accessor.getBlock() instanceof CropBlocks) {
float chance = PrimordialConfig.regularSeedExtraChance;
currenttip.add(String.format("%s%.0f%% %s", Colours.YELLOW, chance, "Change of extra seed"));
if (PrimordialConfig.enableBonemealUse) {
currenttip.add(String.format("%s%s", Colours.LIGHTGREEN, "Bonemeal use Enabled"));
} else {
currenttip.add(String.format("%s%s", Colours.LIGHTRED, "Bonemeal use Disabled"));
}
}
}
return currenttip;
}
示例11: getWailaBody
import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
Block block = accessor.getBlock();
if (block instanceof WailaInfoProvider) {
return ((WailaInfoProvider) block).getWailaBody(itemStack, currenttip, accessor, config);
}
return currenttip;
}
示例12: getWailaStack
import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
if (accessor.getBlock() != null) {
IBlockState state = accessor.getWorld().getBlockState(accessor.getPosition());
Block block = state.getBlock();
if (block instanceof BlockVitalized) { return new ItemStack(block, 1, state.getValue(BlockVitalized.META)); }
if (block instanceof BlockBulb) { return new ItemStack(block, 1, state.getValue(BlockBulb.META)); }
if (block instanceof BlockPlant) { return new ItemStack(block, 1, 0); }
}
return null;
}
示例13: wireStack
import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
private ItemStack wireStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
TEWireDrawBench te = (TEWireDrawBench) accessor.getTileEntity();
te = te.getMainTileEntity();
if (accessor.getBlock() == ModBlocks.wireDrawBench && te != null) {
if (te.getInput() != null)
return te.getInput();
if (te.getOutput() != null)
return te.getOutput();
}
return null;
}
示例14: 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();
}
示例15: getWailaBody
import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
Block block = accessor.getBlock();
if (block instanceof WailaProvider) {
return ((WailaProvider)block).getWailaBody(itemStack, currenttip, accessor, config);
}
return currenttip;
}