Package net.glowstone.block.itemtype

Examples of net.glowstone.block.itemtype.ItemType


        // attempt to use item in hand
        // follows ALLOW/DENY: default to if no block was interacted with
        if (selectResult(event.useItemInHand(), !useInteractedBlock) && holding != null) {
            // call out to the item type to determine the appropriate right-click action
            ItemType type = ItemTable.instance().getItem(holding.getType());
            if (clicked == null) {
                type.rightClickAir(player, holding);
            } else {
                type.rightClickBlock(player, clicked, face, holding, clickedLoc);
            }
        }

        // if anything was actually clicked, make sure the player's up to date
        // in case something is unimplemented or otherwise screwy on our side
View Full Code Here


        return ParameterUtils.enumCases(Material.values());
    }

    @Test
    public void hasAllMaterials() {
        ItemType type = table.getItem(material);

        // special cases
        if (material == Material.AIR) {
            assertNull("ItemType exists for air: " + type, type);
            return;
        } else if (material == Material.LOCKED_CHEST) {
            // LOCKED_CHEST was superseded by STAINED_GLASS
            return;
        }

        // check that it exists
        assertNotNull("ItemType does not exist for " + material, type);
        // check that its block status is correct
        assertTrue("Block status mismatch between " + material + "(" + material.isBlock() + ") and " + type, (type instanceof BlockType) == material.isBlock());
        // check that material returned matches
        assertEquals("ItemType returned wrong material", material, type.getMaterial());

        // check that max stack size matches
        assertEquals("Maximum stack size was incorrect", material.getMaxStackSize(), type.getMaxStackSize());
    }
View Full Code Here

TOP

Related Classes of net.glowstone.block.itemtype.ItemType

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.