Package org.terasology.world.block

Examples of org.terasology.world.block.Block


        return 0;
    }

    @Override
    public boolean isSufficientlySupported(Vector3i location, Map<Vector3i, Block> blockOverrides) {
        final Block block = getBlockWithOverrides(location, blockOverrides);
        if (block.isSupportRequired()) {
            final Vector3i bottomLocation = Side.BOTTOM.getAdjacentPos(location);
            return !getWorldProvider().isBlockRelevant(bottomLocation)
                    || getBlockWithOverrides(bottomLocation, blockOverrides).isFullSide(Side.TOP);
        }
        return true;
View Full Code Here


    public boolean shouldBeRemovedDueToChange(Vector3i location, Side sideChanged) {
        return sideChanged == Side.BOTTOM && !isSufficientlySupported(location, Collections.<Vector3i, Block>emptyMap());
    }

    private Block getBlockWithOverrides(Vector3i location, Map<Vector3i, Block> blockOverrides) {
        final Block blockFromOverride = blockOverrides.get(location);
        if (blockFromOverride != null) {
            return blockFromOverride;
        }
        return getWorldProvider().getBlock(location);
    }
View Full Code Here

    @Override
    public boolean shouldBeRemovedDueToChange(Vector3i location, Side sideChanged) {
        final AttachSupportRequiredComponent component = getComponent(location, Collections.<Vector3i, Block>emptyMap());
        if (component != null) {
            final Block block = getBlockWithOverrides(location, Collections.<Vector3i, Block>emptyMap());
            if (!hasRequiredSupportOnSideForBlock(location, sideChanged, block)) {
                return true;
            }
        }
        return false;
View Full Code Here

    @Override
    public boolean isSufficientlySupported(Vector3i location, Map<Vector3i, Block> blockOverrides) {
        final AttachSupportRequiredComponent component = getComponent(location, blockOverrides);
        if (component != null) {
            final Block block = getBlockWithOverrides(location, blockOverrides);
            for (Side side : Side.values()) {
                if (hasRequiredSupportOnSideForBlock(location, side, block)) {
                    return true;
                }
            }
View Full Code Here

        }
        return true;
    }

    private EntityRef getEntity(Vector3i location, Map<Vector3i, Block> blockOverrides) {
        final Block overwrittenBlock = blockOverrides.get(location);
        if (overwrittenBlock != null) {
            return overwrittenBlock.getEntity();
        }
        EntityRef blockEntity = getBlockEntityRegistry().getExistingBlockEntityAt(location);
        if (blockEntity.exists()) {
            return blockEntity;
        } else {
View Full Code Here

        }
        return getBlockWithOverrides(sideBlockPosition, blockOverrides).canAttachTo(side.reverse());
    }

    private Block getBlockWithOverrides(Vector3i location, Map<Vector3i, Block> blockOverrides) {
        final Block blockFromOverride = blockOverrides.get(location);
        if (blockFromOverride != null) {
            return blockFromOverride;
        }
        return getWorldProvider().getBlock(location);
    }
View Full Code Here

        if (config.getRendering().isAnimateWater()) {
            cameraPos.y -= RenderHelper.evaluateOceanHeightAtPosition(cameraPos, worldProvider.getTime().getDays());
        }

        if (worldProvider.isBlockRelevant(new Vector3f(cameraPos))) {
            Block block = worldProvider.getBlock(new Vector3f(cameraPos));
            return block.isLiquid();
        }
        return false;
    }
View Full Code Here

        return currentRenderingStage;
    }

    public Vector3f getTint() {
        Vector3f cameraPos = getActiveCamera().getPosition();
        Block block = worldProvider.getBlock(cameraPos);
        return block.getTint();
    }
View Full Code Here

TOP

Related Classes of org.terasology.world.block.Block

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.