当前位置: 首页>>代码示例>>Java>>正文


Java IBlockState.getActualState方法代码示例

本文整理汇总了Java中net.minecraft.block.state.IBlockState.getActualState方法的典型用法代码示例。如果您正苦于以下问题:Java IBlockState.getActualState方法的具体用法?Java IBlockState.getActualState怎么用?Java IBlockState.getActualState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.block.state.IBlockState的用法示例。


在下文中一共展示了IBlockState.getActualState方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addCollisionBoxToList

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_) {
	if (!p_185477_7_) {
		state = state.getActualState(worldIn, pos);
	}

	addCollisionBoxToList(pos, entityBox, collidingBoxes, PILLAR_AABB);

	if (((Boolean) state.getValue(NORTH)).booleanValue()) {
		addCollisionBoxToList(pos, entityBox, collidingBoxes, NORTH_AABB);
	}

	if (((Boolean) state.getValue(EAST)).booleanValue()) {
		addCollisionBoxToList(pos, entityBox, collidingBoxes, EAST_AABB);
	}

	if (((Boolean) state.getValue(SOUTH)).booleanValue()) {
		addCollisionBoxToList(pos, entityBox, collidingBoxes, SOUTH_AABB);
	}

	if (((Boolean) state.getValue(WEST)).booleanValue()) {
		addCollisionBoxToList(pos, entityBox, collidingBoxes, WEST_AABB);
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:25,代码来源:BlockScornedBrickFence.java

示例2: addCollisionBoxToList

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn)
{
    state = state.getActualState(worldIn, pos);
    addCollisionBoxToList(pos, entityBox, collidingBoxes, PILLAR_AABB);

    if (((Boolean)state.getValue(NORTH)).booleanValue())
    {
        addCollisionBoxToList(pos, entityBox, collidingBoxes, NORTH_AABB);
    }

    if (((Boolean)state.getValue(EAST)).booleanValue())
    {
        addCollisionBoxToList(pos, entityBox, collidingBoxes, EAST_AABB);
    }

    if (((Boolean)state.getValue(SOUTH)).booleanValue())
    {
        addCollisionBoxToList(pos, entityBox, collidingBoxes, SOUTH_AABB);
    }

    if (((Boolean)state.getValue(WEST)).booleanValue())
    {
        addCollisionBoxToList(pos, entityBox, collidingBoxes, WEST_AABB);
    }
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:Got-Wood,代码行数:26,代码来源:BlockBambooFence.java

示例3: addCollisionBoxToList

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn) {
	IBlockState actualstate = state.getActualState(worldIn, pos);
	addCollisionBoxToList(pos, entityBox, collidingBoxes, PILLAR_AABB);

	if (actualstate.getValue(NORTH)) {
		addCollisionBoxToList(pos, entityBox, collidingBoxes, NORTH_AABB);
	}

	if (actualstate.getValue(EAST)) {
		addCollisionBoxToList(pos, entityBox, collidingBoxes, EAST_AABB);
	}

	if (actualstate.getValue(SOUTH)) {
		addCollisionBoxToList(pos, entityBox, collidingBoxes, SOUTH_AABB);
	}

	if (actualstate.getValue(WEST)) {
		addCollisionBoxToList(pos, entityBox, collidingBoxes, WEST_AABB);
	}
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:Got-Wood,代码行数:21,代码来源:BlockBambooFence.java

示例4: addBlockDestroyEffects

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void addBlockDestroyEffects(BlockPos pos, IBlockState state)
{
    if (!state.getBlock().isAir(state, this.worldObj, pos) && !state.getBlock().addDestroyEffects(worldObj, pos, this))
    {
        state = state.getActualState(this.worldObj, pos);
        int i = 4;

        for (int j = 0; j < 4; ++j)
        {
            for (int k = 0; k < 4; ++k)
            {
                for (int l = 0; l < 4; ++l)
                {
                    double d0 = (double)pos.getX() + ((double)j + 0.5D) / 4.0D;
                    double d1 = (double)pos.getY() + ((double)k + 0.5D) / 4.0D;
                    double d2 = (double)pos.getZ() + ((double)l + 0.5D) / 4.0D;
                    this.addEffect((new ParticleDigging(this.worldObj, d0, d1, d2, d0 - (double)pos.getX() - 0.5D, d1 - (double)pos.getY() - 0.5D, d2 - (double)pos.getZ() - 0.5D, state)).setBlockPos(pos));
                }
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:23,代码来源:ParticleManager.java

示例5: renderBlockDamage

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void renderBlockDamage(IBlockState state, BlockPos pos, TextureAtlasSprite texture, IBlockAccess blockAccess)
{
    if (state.getRenderType() == EnumBlockRenderType.MODEL)
    {
        state = state.getActualState(blockAccess, pos);
        IBakedModel ibakedmodel = this.blockModelShapes.getModelForState(state);
        IBakedModel ibakedmodel1 = net.minecraftforge.client.ForgeHooksClient.getDamageModel(ibakedmodel, texture, state, blockAccess, pos);
        this.blockModelRenderer.renderModel(blockAccess, ibakedmodel1, state, pos, Tessellator.getInstance().getBuffer(), true);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:11,代码来源:BlockRendererDispatcher.java

示例6: addCollisionBoxToList

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Override
@SuppressWarnings("deprecation")
public void addCollisionBoxToList (IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_) {
    state = state.getActualState(worldIn, pos);
    addCollisionBoxToList(pos, entityBox, collidingBoxes, PILLAR_AABB);

    if (state.getValue(NORTH))
        addCollisionBoxToList(pos, entityBox, collidingBoxes, NORTH_AABB);
    if (state.getValue(EAST))
        addCollisionBoxToList(pos, entityBox, collidingBoxes, EAST_AABB);
    if (state.getValue(SOUTH))
        addCollisionBoxToList(pos, entityBox, collidingBoxes, SOUTH_AABB);
    if (state.getValue(WEST))
        addCollisionBoxToList(pos, entityBox, collidingBoxes, WEST_AABB);
}
 
开发者ID:jaquadro,项目名称:GardenStuff,代码行数:16,代码来源:BlockFence.java

示例7: getBoundingBox

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
	state = state.getActualState(source, pos);
	float minX = state.getValue(WEST) ? 0.0F : 0.3125F;
	float minY = state.getValue(DOWN) ? 0.0F : 0.3125F;
	float minZ = state.getValue(NORTH) ? 0.0F : 0.3125F;
	float maxX = state.getValue(EAST) ? 1.0F : 0.6875F;
	float maxY = state.getValue(UP) ? 1.0F : 0.6875F;
	float maxZ = state.getValue(SOUTH) ? 1.0F : 0.6875F;
	return new AxisAlignedBB((double) minX, (double) minY, (double) minZ, (double) maxX, (double) maxY, (double) maxZ);
}
 
开发者ID:TechReborn,项目名称:TechReborn3,代码行数:11,代码来源:BlockCable.java

示例8: addCollisionBoxToList

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_)
{
    if (!p_185477_7_)
    {
        state = state.getActualState(worldIn, pos);
    }

    addCollisionBoxToList(pos, entityBox, collidingBoxes, PILLAR_AABB);

    if (((Boolean)state.getValue(NORTH)).booleanValue())
    {
        addCollisionBoxToList(pos, entityBox, collidingBoxes, NORTH_AABB);
    }

    if (((Boolean)state.getValue(EAST)).booleanValue())
    {
        addCollisionBoxToList(pos, entityBox, collidingBoxes, EAST_AABB);
    }

    if (((Boolean)state.getValue(SOUTH)).booleanValue())
    {
        addCollisionBoxToList(pos, entityBox, collidingBoxes, SOUTH_AABB);
    }

    if (((Boolean)state.getValue(WEST)).booleanValue())
    {
        addCollisionBoxToList(pos, entityBox, collidingBoxes, WEST_AABB);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:30,代码来源:BlockFence.java

示例9: getType

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private BlockDoublePlant.EnumPlantType getType(IBlockAccess blockAccess, BlockPos pos, IBlockState state)
{
    if (state.getBlock() == this)
    {
        state = state.getActualState(blockAccess, pos);
        return (BlockDoublePlant.EnumPlantType)state.getValue(VARIANT);
    }
    else
    {
        return BlockDoublePlant.EnumPlantType.FERN;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:BlockDoublePlant.java

示例10: getBoundingBox

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{
    state = state.getActualState(source, pos);
    int i = 0;
    AxisAlignedBB axisalignedbb = FULL_BLOCK_AABB;

    if (((Boolean)state.getValue(UP)).booleanValue())
    {
        axisalignedbb = UP_AABB;
        ++i;
    }

    if (((Boolean)state.getValue(NORTH)).booleanValue())
    {
        axisalignedbb = NORTH_AABB;
        ++i;
    }

    if (((Boolean)state.getValue(EAST)).booleanValue())
    {
        axisalignedbb = EAST_AABB;
        ++i;
    }

    if (((Boolean)state.getValue(SOUTH)).booleanValue())
    {
        axisalignedbb = SOUTH_AABB;
        ++i;
    }

    if (((Boolean)state.getValue(WEST)).booleanValue())
    {
        axisalignedbb = WEST_AABB;
        ++i;
    }

    return i == 1 ? axisalignedbb : FULL_BLOCK_AABB;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:39,代码来源:BlockVine.java

示例11: getBoundingBox

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{
    state = state.getActualState(source, pos);
    float f = 0.1875F;
    float f1 = ((Boolean)state.getValue(WEST)).booleanValue() ? 0.0F : 0.1875F;
    float f2 = ((Boolean)state.getValue(DOWN)).booleanValue() ? 0.0F : 0.1875F;
    float f3 = ((Boolean)state.getValue(NORTH)).booleanValue() ? 0.0F : 0.1875F;
    float f4 = ((Boolean)state.getValue(EAST)).booleanValue() ? 1.0F : 0.8125F;
    float f5 = ((Boolean)state.getValue(UP)).booleanValue() ? 1.0F : 0.8125F;
    float f6 = ((Boolean)state.getValue(SOUTH)).booleanValue() ? 1.0F : 0.8125F;
    return new AxisAlignedBB((double)f1, (double)f2, (double)f3, (double)f4, (double)f5, (double)f6);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:BlockChorusPlant.java

示例12: renderBlockDamage

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void renderBlockDamage(IBlockState state, BlockPos pos, TextureAtlasSprite texture, IBlockAccess blockAccess)
{
    if (state.getRenderType() == EnumBlockRenderType.MODEL)
    {
        state = state.getActualState(blockAccess, pos);
        IBakedModel ibakedmodel = this.blockModelShapes.getModelForState(state);
        IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(state, ibakedmodel, texture, pos)).makeBakedModel();
        this.blockModelRenderer.renderModel(blockAccess, ibakedmodel1, state, pos, Tessellator.getInstance().getBuffer(), true);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:11,代码来源:BlockRendererDispatcher.java

示例13: renderBlock

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public boolean renderBlock(IBlockState state, BlockPos pos, IBlockAccess blockAccess, VertexBuffer worldRendererIn)
{
    try
    {
        EnumBlockRenderType enumblockrendertype = state.getRenderType();

        if (enumblockrendertype == EnumBlockRenderType.INVISIBLE)
        {
            return false;
        }
        else
        {
            if (blockAccess.getWorldType() != WorldType.DEBUG_WORLD)
            {
                try
                {
                    state = state.getActualState(blockAccess, pos);
                }
                catch (Exception var8)
                {
                    ;
                }
            }

            switch (enumblockrendertype)
            {
                case MODEL:
                    IBakedModel model = this.getModelForState(state);
                    state = state.getBlock().getExtendedState(state, blockAccess, pos);
                    return this.blockModelRenderer.renderModel(blockAccess, model, state, pos, worldRendererIn, true);
                case ENTITYBLOCK_ANIMATED:
                    return false;
                case LIQUID:
                    return this.fluidRenderer.renderFluid(blockAccess, state, pos, worldRendererIn);
                default:
                    return false;
            }
        }
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block in world");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being tesselated");
        CrashReportCategory.addBlockInfo(crashreportcategory, pos, state.getBlock(), state.getBlock().getMetaFromState(state));
        throw new ReportedException(crashreport);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:48,代码来源:BlockRendererDispatcher.java

示例14: addCollisionBoxToList

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_)
{
    if (!p_185477_7_)
    {
        state = state.getActualState(worldIn, pos);
    }

    float f = 0.1875F;
    float f1 = 0.8125F;
    addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.8125D, 0.8125D));

    if (((Boolean)state.getValue(WEST)).booleanValue())
    {
        addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(0.0D, 0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.8125D));
    }

    if (((Boolean)state.getValue(EAST)).booleanValue())
    {
        addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(0.8125D, 0.1875D, 0.1875D, 1.0D, 0.8125D, 0.8125D));
    }

    if (((Boolean)state.getValue(UP)).booleanValue())
    {
        addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(0.1875D, 0.8125D, 0.1875D, 0.8125D, 1.0D, 0.8125D));
    }

    if (((Boolean)state.getValue(DOWN)).booleanValue())
    {
        addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(0.1875D, 0.0D, 0.1875D, 0.8125D, 0.1875D, 0.8125D));
    }

    if (((Boolean)state.getValue(NORTH)).booleanValue())
    {
        addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(0.1875D, 0.1875D, 0.0D, 0.8125D, 0.8125D, 0.1875D));
    }

    if (((Boolean)state.getValue(SOUTH)).booleanValue())
    {
        addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(0.1875D, 0.1875D, 0.8125D, 0.8125D, 0.8125D, 1.0D));
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:42,代码来源:BlockChorusPlant.java

示例15: getDebugInfoRight

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
protected <T extends Comparable<T>> List<String> getDebugInfoRight()
{
    long i = Runtime.getRuntime().maxMemory();
    long j = Runtime.getRuntime().totalMemory();
    long k = Runtime.getRuntime().freeMemory();
    long l = j - k;
    List<String> list = Lists.newArrayList(new String[] {String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.mc.isJava64bit() ? 64 : 32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(bytesToMb(l)), Long.valueOf(bytesToMb(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(bytesToMb(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.getCpu()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GlStateManager.glGetString(7936)}), GlStateManager.glGetString(7937), GlStateManager.glGetString(7938)});

    list.add("");
    list.addAll(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(false));

    if (this.mc.isReducedDebug())
    {
        return list;
    }
    else
    {
        if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == RayTraceResult.Type.BLOCK && this.mc.objectMouseOver.getBlockPos() != null)
        {
            BlockPos blockpos = this.mc.objectMouseOver.getBlockPos();
            IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos);

            if (this.mc.theWorld.getWorldType() != WorldType.DEBUG_WORLD)
            {
                iblockstate = iblockstate.getActualState(this.mc.theWorld, blockpos);
            }

            list.add("");
            list.add(String.valueOf(Block.REGISTRY.getNameForObject(iblockstate.getBlock())));

            for (Entry < IProperty<?>, Comparable<? >> entry : iblockstate.getProperties().entrySet())
            {
                IProperty<T> iproperty = (IProperty)entry.getKey();
                T t = (T)entry.getValue();
                String s = iproperty.getName(t);

                if (Boolean.TRUE.equals(t))
                {
                    s = TextFormatting.GREEN + s;
                }
                else if (Boolean.FALSE.equals(t))
                {
                    s = TextFormatting.RED + s;
                }

                list.add(iproperty.getName() + ": " + s);
            }
        }

        return list;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:53,代码来源:GuiOverlayDebug.java


注:本文中的net.minecraft.block.state.IBlockState.getActualState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。