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