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


Java TeslaCapabilities.CAPABILITY_HOLDER属性代码示例

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


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

示例1: getCapability

@Override
@SuppressWarnings("unchecked")
public <T> T getCapability (Capability<T> capability, EnumFacing facing) {

    // This method is where other things will try to access your TileEntity's Tesla
    // capability. In the case of the analyzer, is a consumer, producer and holder so we
    // can allow requests that are looking for any of those things. This example also does
    // not care about which side is being accessed, however if you wanted to restrict which
    // side can be used, for example only allow power input through the back, that could be
    // done here.
    if (capability == TeslaCapabilities.CAPABILITY_CONSUMER || capability == TeslaCapabilities.CAPABILITY_PRODUCER || capability == TeslaCapabilities.CAPABILITY_HOLDER) {
        return (T) this.container;
    }

    return super.getCapability(capability, facing);
}
 
开发者ID:Darkhax-Minecraft,项目名称:Tesla,代码行数:16,代码来源:TileEntityAnalyzer.java

示例2: getCapability

@Override
@SuppressWarnings("unchecked")
public <T> T getCapability (Capability<T> capability, EnumFacing facing) {

    // This method is where other things will try to access your TileEntity's Tesla
    // capability. In the case of the analyzer, is a consumer, producer and holder so we
    // can allow requests that are looking for any of those things. This example also does
    // not care about which side is being accessed, however if you wanted to restrict which
    // side can be used, for example only allow power input through the back, that could be
    // done here.
    if (capability == TeslaCapabilities.CAPABILITY_PRODUCER || capability == TeslaCapabilities.CAPABILITY_HOLDER)
        return (T) this.container;
    if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
        return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(itemHandler);

    return super.getCapability(capability, facing);
}
 
开发者ID:Rushmead,项目名称:LotsOfGenerators,代码行数:17,代码来源:TileGenerator.java

示例3: getCapability

@Override
@SuppressWarnings("unchecked")
public <T> T getCapability (Capability<T> capability, EnumFacing facing) {
    
    if (capability == TeslaCapabilities.CAPABILITY_CONSUMER || capability == TeslaCapabilities.CAPABILITY_PRODUCER || capability == TeslaCapabilities.CAPABILITY_HOLDER)
        return (T) this.container;
        
    return null;
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:9,代码来源:BaseTeslaContainerProvider.java

示例4: getCapability

@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
    if(capability == TeslaCapabilities.CAPABILITY_PRODUCER && getInfoForFace(facing).getIoInfo() == AccumulatorInfo.AccumulatorIOInfo.OUTPUT) {
        return (T) this.container;
    }
    if(capability == TeslaCapabilities.CAPABILITY_CONSUMER && getInfoForFace(facing).getIoInfo() == AccumulatorInfo.AccumulatorIOInfo.INPUT) {
        return (T) this.container;
    }
    if(capability == TeslaCapabilities.CAPABILITY_HOLDER && getInfoForFace(facing).getIoInfo() != AccumulatorInfo.AccumulatorIOInfo.DISABLED)
        return (T) this.container;
    return super.getCapability(capability, facing);
}
 
开发者ID:jaredlll08,项目名称:Machines-and-Stuff,代码行数:12,代码来源:TileEntityAccumulator.java

示例5: hasCapability

@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
    if(capability == TeslaCapabilities.CAPABILITY_PRODUCER && getInfoForFace(facing).getIoInfo() == AccumulatorInfo.AccumulatorIOInfo.OUTPUT) {
        return true;
    }
    if(capability == TeslaCapabilities.CAPABILITY_CONSUMER && getInfoForFace(facing).getIoInfo() == AccumulatorInfo.AccumulatorIOInfo.INPUT) {
        return true;
    }
    if(capability == TeslaCapabilities.CAPABILITY_HOLDER && getInfoForFace(facing).getIoInfo() != AccumulatorInfo.AccumulatorIOInfo.DISABLED)
        return true;
    return super.hasCapability(capability, facing);
}
 
开发者ID:jaredlll08,项目名称:Machines-and-Stuff,代码行数:12,代码来源:TileEntityAccumulator.java

示例6: hasCapability

@Override
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing) {
    if (capability == TeslaCapabilities.CAPABILITY_CONSUMER && connection.canConnectEnergy(facing)) {
        return true;
    }
    if (capability == TeslaCapabilities.CAPABILITY_PRODUCER && connection.canConnectEnergy(facing)) {
        return true;
    }
    if (capability == TeslaCapabilities.CAPABILITY_HOLDER && connection.canConnectEnergy(facing)) {
        return true;
    }
    return false;
}
 
开发者ID:modmuss50,项目名称:Tesla-Flux,代码行数:13,代码来源:TeslaCapabilityProvider.java

示例7: getCapability

@Override
public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing) {
    container.setDir(facing);
    if (capability == TeslaCapabilities.CAPABILITY_CONSUMER && connection.canConnectEnergy(facing)) {
        return (T) container;
    }
    if (capability == TeslaCapabilities.CAPABILITY_PRODUCER && connection.canConnectEnergy(facing)) {
        return (T) container;
    }
    if (capability == TeslaCapabilities.CAPABILITY_HOLDER && connection.canConnectEnergy(facing)) {
        return (T) container;
    }
    return null;
}
 
开发者ID:modmuss50,项目名称:Tesla-Flux,代码行数:14,代码来源:TeslaCapabilityProvider.java

示例8: getCapability

@Override
@SuppressWarnings("unchecked")
public <T> T getCapability (Capability<T> capability, EnumFacing facing) {

    // This method is where other things will try to access your TileEntity's Tesla
    // capability. In the case of the analyzer, is a consumer, producer and holder so we
    // can allow requests that are looking for any of those things. This example also does
    // not care about which side is being accessed, however if you wanted to restrict which
    // side can be used, for example only allow power input through the back, that could be
    // done here.
    if (capability == TeslaCapabilities.CAPABILITY_CONSUMER || capability == TeslaCapabilities.CAPABILITY_PRODUCER || capability == TeslaCapabilities.CAPABILITY_HOLDER)
        return (T) this.container;

    return super.getCapability(capability, facing);
}
 
开发者ID:CyberdyneCC,项目名称:BigReactors,代码行数:15,代码来源:TileEntityTesla.java

示例9: hasCapability

@Override
public boolean hasCapability (Capability<?> capability, EnumFacing facing) {

    // This method replaces the instanceof checks that would be used in an interface based
    // system. It can be used by other things to see if the TileEntity uses a capability or
    // not. This example is a Consumer, Producer and Holder, so we return true for all
    // three. This can also be used to restrict access on certain sides, for example if you
    // only accept power input from the bottom of the block, you would only return true for
    // Consumer if the facing parameter was down.
    if (capability == TeslaCapabilities.CAPABILITY_CONSUMER || capability == TeslaCapabilities.CAPABILITY_PRODUCER || capability == TeslaCapabilities.CAPABILITY_HOLDER)
        return true;

    return super.hasCapability(capability, facing);
}
 
开发者ID:CyberdyneCC,项目名称:BigReactors,代码行数:14,代码来源:TileEntityTesla.java

示例10: getCapability

@Override
@SuppressWarnings("unchecked")
public <T> T getCapability (Capability<T> capability, EnumFacing facing) {

    if (capability == TeslaCapabilities.CAPABILITY_CONSUMER || capability == TeslaCapabilities.CAPABILITY_PRODUCER || capability == TeslaCapabilities.CAPABILITY_HOLDER) {
        return (T) this.container;
    }

    return null;
}
 
开发者ID:Darkhax-Minecraft,项目名称:Tesla,代码行数:10,代码来源:BaseTeslaContainerProvider.java

示例11: hasCapability

@Override
public boolean hasCapability (Capability<?> capability, EnumFacing facing) {

    // This method replaces the instanceof checks that would be used in an interface based
    // system. It can be used by other things to see if the TileEntity uses a capability or
    // not. This example is a Consumer, Producer and Holder, so we return true for all
    // three. This can also be used to restrict access on certain sides, for example if you
    // only accept power input from the bottom of the block, you would only return true for
    // Consumer if the facing parameter was down.
    if (capability == TeslaCapabilities.CAPABILITY_CONSUMER || capability == TeslaCapabilities.CAPABILITY_PRODUCER || capability == TeslaCapabilities.CAPABILITY_HOLDER) {
        return true;
    }

    return super.hasCapability(capability, facing);
}
 
开发者ID:Darkhax-Minecraft,项目名称:Tesla,代码行数:15,代码来源:TileEntityAnalyzer.java

示例12: getCapability

@Override
@SuppressWarnings("unchecked")
public <T> T getCapability (Capability<T> capability, EnumFacing facing)
{
    if (capability == TeslaCapabilities.CAPABILITY_HOLDER || capability == TeslaCapabilities.CAPABILITY_CONSUMER)
    {
        return (T) this.container;
    }
    return super.getCapability(capability, facing);
}
 
开发者ID:CyberdyneCC,项目名称:HazardousResearch,代码行数:10,代码来源:TileEntityMachine.java

示例13: hasCapability

@Override
public boolean hasCapability (Capability<?> capability, EnumFacing facing)
{
    if (capability == TeslaCapabilities.CAPABILITY_HOLDER || capability == TeslaCapabilities.CAPABILITY_CONSUMER)
    {
        return true;
    }
    return super.hasCapability(capability, facing);
}
 
开发者ID:CyberdyneCC,项目名称:HazardousResearch,代码行数:9,代码来源:TileEntityMachine.java

示例14: hasCapability

@Override
public boolean hasCapability (Capability<?> capability, EnumFacing facing) {

    // This method replaces the instanceof checks that would be used in an interface based
    // system. It can be used by other things to see if the TileEntity uses a capability or
    // not. This example is a Consumer, Producer and Holder, so we return true for all
    // three. This can also be used to restrict access on certain sides, for example if you
    // only accept power input from the bottom of the block, you would only return true for
    // Consumer if the facing parameter was down.
    if (capability == TeslaCapabilities.CAPABILITY_PRODUCER || capability == TeslaCapabilities.CAPABILITY_HOLDER)
        return true;
    if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
        return true;
    return super.hasCapability(capability, facing);
}
 
开发者ID:Rushmead,项目名称:LotsOfGenerators,代码行数:15,代码来源:TileGenerator.java

示例15: hasCapability

@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing)
{
	return (capability == TeslaCapabilities.CAPABILITY_CONSUMER ||
		    capability == TeslaCapabilities.CAPABILITY_HOLDER ||
		    capability == CapabilityEnergy.ENERGY);
}
 
开发者ID:gunnerwolf,项目名称:TeslaCoils,代码行数:7,代码来源:TileEntityTeslaCoil.java


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