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


Java IBlockAccess.getTileEntity方法代码示例

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


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

示例1: getWeakPower

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
    if (!blockState.canProvidePower())
    {
        return 0;
    }
    else
    {
        int i = 0;
        TileEntity tileentity = blockAccess.getTileEntity(pos);

        if (tileentity instanceof TileEntityChest)
        {
            i = ((TileEntityChest)tileentity).numPlayersUsing;
        }

        return MathHelper.clamp_int(i, 0, 15);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:BlockChest.java

示例2: colorMultiplier

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass)
{
    TileEntity tileentity = worldIn.getTileEntity(pos);

    if (tileentity instanceof TileEntityFlowerPot)
    {
        Item item = ((TileEntityFlowerPot)tileentity).getFlowerPotItem();

        if (item instanceof ItemBlock)
        {
            return Block.getBlockFromItem(item).colorMultiplier(worldIn, pos, renderPass);
        }
    }

    return 16777215;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:17,代码来源:BlockFlowerPot.java

示例3: getDrops

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
    boolean hasCustomDrops = false;

    TileEntity te = world.getTileEntity(pos);
    if (te instanceof TileEntityBase) {
        ((TileEntityBase) te).getAllDrops(drops);
    }

    if (te instanceof ISerializableTanks) {
        hasCustomDrops = true;
        drops.add(((ISerializableTanks) te).getDroppedStack(this));
    }

    if (!hasCustomDrops) {
        super.getDrops(drops, world, pos, state, fortune);
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:19,代码来源:BlockPneumaticCraft.java

示例4: getActualState

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
{
    EnumFacing facing = EnumFacing.NORTH;
    boolean active = false;

    TileEntity te = world.getTileEntity(pos);
    if (te != null && te instanceof TileEntityIronFurnace)
    {
        TileEntityIronFurnace furnace = (TileEntityIronFurnace) te;
        facing = EnumFacing.getFront(furnace.getFacing());
        if (facing == EnumFacing.DOWN || facing == EnumFacing.UP)
            facing = EnumFacing.NORTH;
        active = furnace.isActive();
    }

    return state.withProperty(FACING, facing).withProperty(ACTIVE, active);
}
 
开发者ID:cubex2,项目名称:morefurnaces,代码行数:19,代码来源:BlockMoreFurnaces.java

示例5: getDrops

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
{
    TileEntity te = world.getTileEntity(pos);

    java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
    if (te instanceof TileEntityBanner)
    {
        TileEntityBanner banner = (TileEntityBanner)te;
        ItemStack item = new ItemStack(Items.BANNER, 1, banner.getBaseColor());
        NBTTagCompound nbt = new NBTTagCompound();
        TileEntityBanner.setBaseColorAndPatterns(nbt, banner.getBaseColor(), banner.getPatterns());
        item.setTagInfo("BlockEntityTag", nbt);
        ret.add(item);
    }
    else
    {
        ret.add(new ItemStack(Items.BANNER, 1, 0));
    }
    return ret;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:22,代码来源:BlockBanner.java

示例6: getActualState

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
	TileEntity te = worldIn.getTileEntity(pos);
	if (te == null) return state;
	return state.withProperty(WOOD_TYPE, ((TileEntityBarrel) worldIn.getTileEntity(pos)).getType());
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:8,代码来源:BlockBarrel.java

示例7: getWeakPower

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
    TileEntity te = blockAccess.getTileEntity(pos);
    if (te instanceof TileEntityUVLightBox) {
        return ((TileEntityUVLightBox) te).shouldEmitRedstone() ? 15 : 0;
    }
    return 0;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:9,代码来源:BlockUVLightBox.java

示例8: getData

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
public static RandoresItemData getData(IBlockAccess acces, BlockPos pos) {
    TileEntity entity = acces.getTileEntity(pos);
    if(entity != null && entity instanceof RandoresTileEntity) {
        return ((RandoresTileEntity) entity).getData();
    }
    return null;
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:8,代码来源:RandoresItemData.java

示例9: getExtendedState

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
{
    if(state instanceof IExtendedBlockState)
    {
        TileEntity te = world.getTileEntity(pos);
        if(te != null && te instanceof TileCodeStorage)
        {
            return ((IExtendedBlockState) state).withProperty(UNLOCKED_PROPERTY, ((TileCodeStorage) te).isUnlocked());
        }
    }
    return super.getExtendedState(state, world, pos);
}
 
开发者ID:PearXTeam,项目名称:PurificatiMagicae,代码行数:14,代码来源:BlockCodeStorage.java

示例10: getWeakPower

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
    TileEntity te = blockAccess.getTileEntity(pos);
    if (te instanceof TileEntitySecurityStation) {
        return ((TileEntitySecurityStation) te).shouldEmitRedstone() ? 15 : 0;
    }
    return 0;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:9,代码来源:BlockSecurityStation.java

示例11: getDrops

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
    TileEntity te = world.getTileEntity(pos);
    if (te instanceof TileEntityAssemblyIOUnit) {
        drops.add(new ItemStack(Blockss.ASSEMBLY_IO_UNIT, 1, ((TileEntityAssemblyIOUnit) te).isImportUnit() ? 1 : 0));
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:8,代码来源:BlockAssemblyIOUnit.java

示例12: getActiveSignal

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
protected int getActiveSignal(IBlockAccess worldIn, BlockPos pos, IBlockState state)
{
    TileEntity tileentity = worldIn.getTileEntity(pos);
    return tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:6,代码来源:BlockRedstoneComparator.java

示例13: canConnectCable

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public boolean canConnectCable(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
	TileEntity te = world.getTileEntity(pos);
	if (te==null) return false;
	return te.hasCapability(Thermionics.CAPABILITY_HEATSTORAGE, side);
}
 
开发者ID:elytra,项目名称:Thermionics,代码行数:7,代码来源:BlockHeatPipe.java

示例14: getLightValue

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
    TileEntity te = world.getTileEntity(pos);
    return te instanceof TileEntityUVLightBox ? ((TileEntityUVLightBox) te).getLightLevel() : 0;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:6,代码来源:BlockUVLightBox.java

示例15: getWeakPower

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
    TileEntity te = blockAccess.getTileEntity(pos);
    return te instanceof TileEntityUniversalSensor ? ((TileEntityUniversalSensor) te).redstoneStrength : 0;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:6,代码来源:BlockUniversalSensor.java


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