當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。