本文整理匯總了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;
}