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


Java CapabilityItemHandler.ITEM_HANDLER_CAPABILITY属性代码示例

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


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

示例1: getCapability

@Nullable
@SuppressWarnings("unchecked")
@Override
public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing)
{
    if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
    {
        return (T) getItemHandlerCapability(facing);
    }

    for (TileEntityModule module : modules.values())
    {
        if (module.hasCapability(capability, facing))
            return module.getCapability(capability, facing);
    }

    return super.getCapability(capability, facing);
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:18,代码来源:TileEntitySimple.java

示例2: getCapability

@Nullable
@Override
public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing) {
    if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
        if (facing == null) return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(playerMainInvHandler);
        switch (facing) {
            case UP:
                return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(playerArmorInvHandler);
            case DOWN:
                return super.getCapability(capability, facing);
            default:
                return dispenserUpgradeInserted ?
                        CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(playerFoodHandler) :
                        CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(playerMainInvHandler);
        }
    } else if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY && dispenserUpgradeInserted) {
        return CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(playerExperienceHandler);
    } else if (capability == CapabilityEnergy.ENERGY) {
        return CapabilityEnergy.ENERGY.cast(energyRF);
    }
    return super.getCapability(capability, facing);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:22,代码来源:TileEntityAerialInterface.java

示例3: getCapability

@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing)
{
	if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
	{
		return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(itemStackHandler);
	}
	return super.getCapability(capability, facing);
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:9,代码来源:TileEntityWritingDesk.java

示例4: hasCapability

@Override
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing) {
    return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY
            || capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY
            || capability == CapabilityEnergy.ENERGY
            || super.hasCapability(capability, facing);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:7,代码来源:EntityDrone.java

示例5: getCapability

@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
	if (!getStack().isEmpty() && capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY && facing == EnumFacing.DOWN) {
		return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(new SidedInvWrapper(this, facing));
	}
	return super.getCapability(capability, facing);
}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:7,代码来源:TileDankNullDock.java

示例6: getCapability

@Nullable
@Override
public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing) {
    if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY && getPrimaryInventory() != null) {
        return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(getPrimaryInventory());
    }
    return super.getCapability(capability, facing);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:8,代码来源:TileEntityBase.java

示例7: getCapability

@SuppressWarnings("unchecked")
@Nullable
@Override
public <T> T getCapability(@Nonnull Capability<T> capability, @Nullable EnumFacing facing) {
    if (capability == CapabilityEnergy.ENERGY) return (T) energyStorage;
    else if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) return (T) fluidTank;
    else if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return (T) itemHandler;
    else return super.getCapability(capability, facing);
}
 
开发者ID:LasmGratel,项目名称:FoodCraft-Reloaded,代码行数:9,代码来源:TileEntityPressureCooker.java

示例8: getCapability

@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
	if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
		IItemHandler handler = this.getItemHandler();
		
		if (handler != null) {
			return (T) handler;
		}
	}
	return super.getCapability(capability, facing);
}
 
开发者ID:Arez0101,项目名称:Dynamic-GUIs,代码行数:11,代码来源:DynamicTileInventory.java

示例9: getCapability

@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing)
{
	if (capability  == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
		return (T) this.handler;
	return super.getCapability(capability, facing);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:7,代码来源:BaseTileEntityHarshenStackedInventory.java

示例10: hasCapability

@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing)
{
	if (facing == null && capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
	{
		return true;
	}
	return super.hasCapability(capability, facing);
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:9,代码来源:TileEntityArcaneTransfigurationTable.java

示例11: hasCapability

@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
    if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
        return true;
    }
    return super.hasCapability(capability, facing);
}
 
开发者ID:tiffit,项目名称:Defier,代码行数:7,代码来源:PatternMolderTileEntity.java

示例12: hasCapability

@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing)
{
	if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
	{
		return true;
	}
	return super.hasCapability(capability, facing);
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:9,代码来源:TileEntityWritingDesk.java

示例13: hasCapability

@Override
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing) {
    return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing);
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:4,代码来源:CraftiniumForgeTileEntity.java

示例14: hasCapability

@Override
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing)
{
    return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing);
}
 
开发者ID:cubex2,项目名称:morefurnaces,代码行数:5,代码来源:TileEntityIronFurnace.java

示例15: hasCapability

@Override
public boolean hasCapability(Capability<?> cap, EnumFacing side) {
    return cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(cap, side);
}
 
开发者ID:BenjaminSutter,项目名称:genera,代码行数:4,代码来源:TileFaerieHome.java


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