當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。