Examples of BlockType


Examples of forestry.core.worldgen.BlockType

  public WorldGenDarkOak(ITreeGenData tree) {
    super(tree);
  }
  @Override
  public BlockType getWood() {
    return new BlockType(Blocks.log2, 1);
  }
View Full Code Here

Examples of mapwriter.region.BlockColours.BlockType

  private static int adjustBlockColourFromType(BlockColours bc, int blockAndMeta, int blockColour) {
    // for normal blocks multiply the block colour by the render colour.
    // for other blocks the block colour will be multiplied by the biome colour.
        int blockid = blockAndMeta >> 4;
    Block block = (Block) Block.blockRegistry.getObjectById(blockid);
    BlockType blockType = bc.getBlockType(blockAndMeta);
    switch (blockType) {
   
    case OPAQUE:
      blockColour |= 0xff000000;
    case NORMAL:
View Full Code Here

Examples of net.glowstone.block.blocktype.BlockType

    /**
     * If needed, create a new tile entity at the given location.
     */
    private void createEntity(int cx, int cy, int cz, int type) {
        BlockType blockType = ItemTable.instance().getBlock(type);
        if (blockType == null) return;

        try {
            TileEntity entity = blockType.createTileEntity(this, cx, cy, cz);
            if (entity == null) return;

            tileEntities.put(coordToIndex(cx, cz, cy), entity);
        } catch (Exception ex) {
            GlowServer.logger.log(Level.SEVERE, "Unable to initialize tile entity for " + type, ex);
View Full Code Here

Examples of net.glowstone.block.blocktype.BlockType

    }

    @Override
    public void rightClickBlock(GlowPlayer player, GlowBlock against, BlockFace face, ItemStack holding, Vector clickedLoc) {
        GlowBlock target = against.getRelative(face);
        BlockType againstBlockType = ItemTable.instance().getBlock(against.getType());

        // only allow placement inside replaceable blocks
        if (againstBlockType.canAbsorb(target, face, holding)) {
            target = against;
        } else if (!target.isEmpty()) {
            BlockType targetType = ItemTable.instance().getBlock(target.getTypeId());
            if (!targetType.canOverride(target, face, holding)) {
                return;
            }
        }

        GlowBlockState newState = target.getState();
View Full Code Here

Examples of net.glowstone.block.blocktype.BlockType

public class ItemBanner extends ItemType {

    @Override
    public void rightClickBlock(GlowPlayer player, GlowBlock target, BlockFace face, ItemStack holding, Vector clickedLoc) {
        BlockType placeAs;
        if (face == BlockFace.UP) {
            placeAs = ItemTable.instance().getBlock(Material.STANDING_BANNER);
        } else if (face == BlockFace.DOWN) {
            return;
        } else {
            placeAs = ItemTable.instance().getBlock(Material.WALL_BANNER);
        }
        placeAs.rightClickBlock(player, target, face, holding, clickedLoc);
    }
View Full Code Here

Examples of net.glowstone.block.blocktype.BlockType

public class ItemSign extends ItemType {

    @Override
    public void rightClickBlock(GlowPlayer player, GlowBlock target, BlockFace face, ItemStack holding, Vector clickedLoc) {
        BlockType placeAs;
        if (face == BlockFace.UP) {
            placeAs = ItemTable.instance().getBlock(Material.SIGN_POST);
        } else if (face == BlockFace.DOWN) {
            return;
        } else {
            placeAs = ItemTable.instance().getBlock(Material.WALL_SIGN);
        }
        placeAs.rightClickBlock(player, target, face, holding, clickedLoc);
    }
View Full Code Here

Examples of net.glowstone.block.blocktype.BlockType

    public void rightClickAir(GlowPlayer player, ItemStack holding) {
        Iterator<Block> itr = new BlockIterator(player, 5);
        Block target = null;
        // Used to determine the side the block was clicked on:
        Block previousTarget = null;
        BlockType targetBlockType = null;
        boolean validTarget = false;

        // Find the next available non-air liquid block type which is collectible in a radius of 5 blocks
        while (itr.hasNext()) {
            previousTarget = target;
View Full Code Here

Examples of net.glowstone.block.blocktype.BlockType

            if (breakEvent.isCancelled()) {
                BlockPlacementHandler.revert(player, block);
                return;
            }

            BlockType blockType = ItemTable.instance().getBlock(block.getType());
            if (blockType != null) {
                blockType.blockDestroy(player, block, face);
            }

            // destroy the block
            if (!block.isEmpty() && !block.isLiquid() && player.getGameMode() != GameMode.CREATIVE) {
                for (ItemStack drop : block.getDrops(holding)) {
View Full Code Here

Examples of net.glowstone.block.blocktype.BlockType

        // attempt to use interacted block
        // DEFAULT is treated as ALLOW, and sneaking is always considered
        boolean useInteractedBlock = event.useInteractedBlock() != Event.Result.DENY;
        if (useInteractedBlock && clicked != null && (!player.isSneaking() || holding == null)) {
            BlockType blockType = ItemTable.instance().getBlock(clicked.getType());
            useInteractedBlock = blockType.blockInteract(player, clicked, face, clickedLoc);
        } else {
            useInteractedBlock = false;
        }

        // attempt to use item in hand
View Full Code Here

Examples of net.java.textilej.parser.DocumentBuilder.BlockType

  private String title;
  private StringBuilder blockContent = new StringBuilder();

  @Override
  protected void openBlock() {
    BlockType blockType;
    if (tag.getTagName().equals("tip")) {
      blockType = BlockType.TIP;
    } else if (tag.getTagName().equals("warning")) {
      blockType = BlockType.WARNING;
    } else if (tag.getTagName().equals("info")) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.