本文整理汇总了Java中net.minecraft.world.IBlockAccess类的典型用法代码示例。如果您正苦于以下问题:Java IBlockAccess类的具体用法?Java IBlockAccess怎么用?Java IBlockAccess使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IBlockAccess类属于net.minecraft.world包,在下文中一共展示了IBlockAccess类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUnderwaterColor
import net.minecraft.world.IBlockAccess; //导入依赖的package包/类
public static Vec3 getUnderwaterColor(IBlockAccess p_getUnderwaterColor_0_, double p_getUnderwaterColor_1_, double p_getUnderwaterColor_3_, double p_getUnderwaterColor_5_)
{
if (underwaterColors == null)
{
return null;
}
else
{
int i = getSmoothColor(underwaterColors, p_getUnderwaterColor_0_, p_getUnderwaterColor_1_, p_getUnderwaterColor_3_, p_getUnderwaterColor_5_, 7, 1);
int j = i >> 16 & 255;
int k = i >> 8 & 255;
int l = i & 255;
float f = (float)j / 255.0F;
float f1 = (float)k / 255.0F;
float f2 = (float)l / 255.0F;
return new Vec3((double)f, (double)f1, (double)f2);
}
}
示例2: getUnderwaterColor
import net.minecraft.world.IBlockAccess; //导入依赖的package包/类
public static Vec3 getUnderwaterColor(IBlockAccess p_getUnderwaterColor_0_, double p_getUnderwaterColor_1_, double p_getUnderwaterColor_3_, double p_getUnderwaterColor_5_)
{
if (underwaterColors == null)
{
return null;
}
else
{
int i = underwaterColors.getColorSmooth(p_getUnderwaterColor_0_, p_getUnderwaterColor_1_, p_getUnderwaterColor_3_, p_getUnderwaterColor_5_, 3);
int j = i >> 16 & 255;
int k = i >> 8 & 255;
int l = i & 255;
float f = (float)j / 255.0F;
float f1 = (float)k / 255.0F;
float f2 = (float)l / 255.0F;
Vec3 vec3 = underwaterColorFader.getColor((double)f, (double)f1, (double)f2);
return vec3;
}
}
示例3: getBoundingBox
import net.minecraft.world.IBlockAccess; //导入依赖的package包/类
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
float pixel = 1f/16f;
float min = pixel*2;
float max = 1 - min;
float x1 = min;
float y1 = 0;
float z1 = min;
float x2 = max;
float y2 = 1;
float z2 = max;
return new AxisAlignedBB(x1,y1,z1,x2,y2,z2);
}
示例4: getBoundingBox
import net.minecraft.world.IBlockAccess; //导入依赖的package包/类
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{
switch ((EnumFacing)state.getValue(FACING))
{
case DOWN:
default:
return PISTON_EXTENSION_DOWN_AABB;
case UP:
return PISTON_EXTENSION_UP_AABB;
case NORTH:
return PISTON_EXTENSION_NORTH_AABB;
case SOUTH:
return PISTON_EXTENSION_SOUTH_AABB;
case WEST:
return PISTON_EXTENSION_WEST_AABB;
case EAST:
return PISTON_EXTENSION_EAST_AABB;
}
}
示例5: setBlockBoundsBasedOnState
import net.minecraft.world.IBlockAccess; //导入依赖的package包/类
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
float plusX = 0;
float plusY = 0;
float plusZ = 0;
if (meta == 0) { plusY = 0.375F; } // Bottom, so need to move to the top
else if (meta == 1) { plusY = -0.375F; } // Top, so need to move to the bottom
else if (meta == 2) { plusZ = 0.375F; } // East, so need to move west
else if (meta == 3) { plusZ = -0.375F; } // West, so need to move east
else if (meta == 4) { plusX = 0.375F; } // North, so need to move south
else if (meta == 5) { plusX = -0.375F; } // South, so need to move north
this.setBlockBounds(sizeMin + plusX, sizeMin + plusY, sizeMin + plusZ, sizeMax + plusX, sizeMax + plusY, sizeMax + plusZ);
}
示例6: getDrops
import net.minecraft.world.IBlockAccess; //导入依赖的package包/类
@Override
public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
{
java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
Random rand = world instanceof World ? ((World)world).rand : new Random();
int count = 1;
if (((Integer)state.getValue(AGE)) >= 3)
{
count = 2 + rand.nextInt(3) + (fortune > 0 ? rand.nextInt(fortune + 1) : 0);
}
for (int i = 0; i < count; i++)
{
ret.add(new ItemStack(Items.NETHER_WART));
}
return ret;
}
示例7: 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;
}
示例8: getBoundingBox
import net.minecraft.world.IBlockAccess; //导入依赖的package包/类
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{
int i = ((Integer)state.getValue(AGE)).intValue();
switch ((EnumFacing)state.getValue(FACING))
{
case SOUTH:
return COCOA_SOUTH_AABB[i];
case NORTH:
default:
return COCOA_NORTH_AABB[i];
case WEST:
return COCOA_WEST_AABB[i];
case EAST:
return COCOA_EAST_AABB[i];
}
}
示例9: canFlowInto
import net.minecraft.world.IBlockAccess; //导入依赖的package包/类
protected boolean canFlowInto(IBlockAccess world, BlockPos pos)
{
if (world.isAirBlock(pos)) return true;
IBlockState state = world.getBlockState(pos);
if (state.getBlock() == this)
{
return true;
}
if (displacements.containsKey(state.getBlock()))
{
return displacements.get(state.getBlock());
}
Material material = state.getMaterial();
if (material.blocksMovement() ||
material == Material.WATER ||
material == Material.LAVA ||
material == Material.PORTAL)
{
return false;
}
int density = getDensity(world, pos);
if (density == Integer.MAX_VALUE)
{
return true;
}
if (this.density > density)
{
return true;
}
else
{
return false;
}
}
示例10: isShearable
import net.minecraft.world.IBlockAccess; //导入依赖的package包/类
@Override
public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos)
{
IBlockState state = world.getBlockState(pos);
EnumPlantType type = (EnumPlantType)state.getValue(VARIANT);
return state.getValue(HALF) == EnumBlockHalf.LOWER && (type == EnumPlantType.FERN || type == EnumPlantType.GRASS);
}
示例11: getBoundingBox
import net.minecraft.world.IBlockAccess; //导入依赖的package包/类
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{
switch ((EnumFacing)state.getValue(FACING))
{
case NORTH:
return LADDER_NORTH_AABB;
case SOUTH:
return LADDER_SOUTH_AABB;
case WEST:
return LADDER_WEST_AABB;
case EAST:
default:
return LADDER_EAST_AABB;
}
}
示例12: getLightValue
import net.minecraft.world.IBlockAccess; //导入依赖的package包/类
/**
* Get a light value for the block at the specified coordinates, normal ranges are between 0 and 15
*
* @param state Block state
* @param world The current world
* @param pos Block position in world
* @return The light value
*/
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
{
IBlockState other = world.getBlockState(pos);
if (other.getBlock() != this)
{
return other.getLightValue(world, pos);
}
return state.getLightValue();
}
示例13: renderModelSmooth
import net.minecraft.world.IBlockAccess; //导入依赖的package包/类
public boolean renderModelSmooth(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, boolean checkSides, long rand)
{
boolean flag = false;
float[] afloat = new float[EnumFacing.values().length * 2];
BitSet bitset = new BitSet(3);
BlockModelRenderer.AmbientOcclusionFace blockmodelrenderer$ambientocclusionface = new BlockModelRenderer.AmbientOcclusionFace();
for (EnumFacing enumfacing : EnumFacing.values())
{
List<BakedQuad> list = modelIn.getQuads(stateIn, enumfacing, rand);
if (!list.isEmpty() && (!checkSides || stateIn.shouldSideBeRendered(worldIn, posIn, enumfacing)))
{
this.renderQuadsSmooth(worldIn, stateIn, posIn, buffer, list, afloat, bitset, blockmodelrenderer$ambientocclusionface);
flag = true;
}
}
List<BakedQuad> list1 = modelIn.getQuads(stateIn, (EnumFacing)null, rand);
if (!list1.isEmpty())
{
this.renderQuadsSmooth(worldIn, stateIn, posIn, buffer, list1, afloat, bitset, blockmodelrenderer$ambientocclusionface);
flag = true;
}
return flag;
}
示例14: getActualState
import net.minecraft.world.IBlockAccess; //导入依赖的package包/类
/**
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
* metadata, such as fence connections.
*/
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
{
if (!worldIn.getBlockState(pos.down()).isSideSolid(worldIn, pos.down(), EnumFacing.UP) && !Blocks.FIRE.canCatchFire(worldIn, pos.down(), EnumFacing.UP))
{
return state.withProperty(NORTH, this.canCatchFire(worldIn, pos.north(), EnumFacing.SOUTH))
.withProperty(EAST, this.canCatchFire(worldIn, pos.east(), EnumFacing.WEST))
.withProperty(SOUTH, this.canCatchFire(worldIn, pos.south(), EnumFacing.NORTH))
.withProperty(WEST, this.canCatchFire(worldIn, pos.west(), EnumFacing.EAST))
.withProperty(UPPER, this.canCatchFire(worldIn, pos.up(), EnumFacing.DOWN));
}
return this.getDefaultState();
}
示例15: getActualState
import net.minecraft.world.IBlockAccess; //导入依赖的package包/类
/**
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
* metadata, such as fence connections.
*/
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
{
if (state.getValue(PART) == BlockBed.EnumPartType.FOOT)
{
IBlockState iblockstate = worldIn.getBlockState(pos.offset((EnumFacing)state.getValue(FACING)));
if (iblockstate.getBlock() == this)
{
state = state.withProperty(OCCUPIED, iblockstate.getValue(OCCUPIED));
}
}
return state;
}