本文整理汇总了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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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));
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}