Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.Material Enum Reference

Public Member Functions

int getId ()
 
int getMaxStackSize ()
 
short getMaxDurability ()
 
Class<?extends MaterialDatagetData ()
 
MaterialData getNewData (final byte raw)
 
boolean isBlock ()
 
boolean isEdible ()
 
boolean isRecord ()
 
boolean isSolid ()
 
boolean isTransparent ()
 
boolean isFlammable ()
 
boolean isBurnable ()
 
boolean isOccluding ()
 
boolean hasGravity ()
 

Static Public Member Functions

static Material getMaterial (final int id)
 
static Material getMaterial (final String name)
 
static Material matchMaterial (final String name)
 
 [static initializer]
 

Public Attributes

 AIR =(0, 0)
 
 STONE =(1)
 
 GRASS =(2)
 
 DIRT =(3)
 
 COBBLESTONE =(4)
 
 WOOD =(5, Tree.class)
 
 SAPLING =(6, Tree.class)
 
 BEDROCK =(7)
 
 WATER =(8, MaterialData.class)
 
 STATIONARY_WATER =(9, MaterialData.class)
 
 LAVA =(10, MaterialData.class)
 
 STATIONARY_LAVA =(11, MaterialData.class)
 
 SAND =(12)
 
 GRAVEL =(13)
 
 GOLD_ORE =(14)
 
 IRON_ORE =(15)
 
 COAL_ORE =(16)
 
 LOG =(17, Tree.class)
 
 LEAVES =(18, Tree.class)
 
 SPONGE =(19)
 
 GLASS =(20)
 
 LAPIS_ORE =(21)
 
 LAPIS_BLOCK =(22)
 
 DISPENSER =(23, Dispenser.class)
 
 SANDSTONE =(24, Sandstone.class)
 
 NOTE_BLOCK =(25)
 
 BED_BLOCK =(26, Bed.class)
 
 POWERED_RAIL =(27, PoweredRail.class)
 
 DETECTOR_RAIL =(28, DetectorRail.class)
 
 PISTON_STICKY_BASE =(29, PistonBaseMaterial.class)
 
 WEB =(30)
 
 LONG_GRASS =(31, LongGrass.class)
 
 DEAD_BUSH =(32)
 
 PISTON_BASE =(33, PistonBaseMaterial.class)
 
 PISTON_EXTENSION =(34, PistonExtensionMaterial.class)
 
 WOOL =(35, Wool.class)
 
 PISTON_MOVING_PIECE =(36)
 
 YELLOW_FLOWER =(37)
 
 RED_ROSE =(38)
 
 BROWN_MUSHROOM =(39)
 
 RED_MUSHROOM =(40)
 
 GOLD_BLOCK =(41)
 
 IRON_BLOCK =(42)
 
 DOUBLE_STEP =(43, Step.class)
 
 STEP =(44, Step.class)
 
 BRICK =(45)
 
 TNT =(46)
 
 BOOKSHELF =(47)
 
 MOSSY_COBBLESTONE =(48)
 
 OBSIDIAN =(49)
 
 TORCH =(50, Torch.class)
 
 FIRE =(51)
 
 MOB_SPAWNER =(52)
 
 WOOD_STAIRS =(53, Stairs.class)
 
 CHEST =(54, Chest.class)
 
 REDSTONE_WIRE =(55, RedstoneWire.class)
 
 DIAMOND_ORE =(56)
 
 DIAMOND_BLOCK =(57)
 
 WORKBENCH =(58)
 
 CROPS =(59, Crops.class)
 
 SOIL =(60, MaterialData.class)
 
 FURNACE =(61, Furnace.class)
 
 BURNING_FURNACE =(62, Furnace.class)
 
 SIGN_POST =(63, 64, Sign.class)
 
 WOODEN_DOOR =(64, Door.class)
 
 LADDER =(65, Ladder.class)
 
 RAILS =(66, Rails.class)
 
 COBBLESTONE_STAIRS =(67, Stairs.class)
 
 WALL_SIGN =(68, 64, Sign.class)
 
 LEVER =(69, Lever.class)
 
 STONE_PLATE =(70, PressurePlate.class)
 
 IRON_DOOR_BLOCK =(71, Door.class)
 
 WOOD_PLATE =(72, PressurePlate.class)
 
 REDSTONE_ORE =(73)
 
 GLOWING_REDSTONE_ORE =(74)
 
 REDSTONE_TORCH_OFF =(75, RedstoneTorch.class)
 
 REDSTONE_TORCH_ON =(76, RedstoneTorch.class)
 
 STONE_BUTTON =(77, Button.class)
 
 SNOW =(78)
 
 ICE =(79)
 
 SNOW_BLOCK =(80)
 
 CACTUS =(81, MaterialData.class)
 
 CLAY =(82)
 
 SUGAR_CANE_BLOCK =(83, MaterialData.class)
 
 JUKEBOX =(84)
 
 FENCE =(85)
 
 PUMPKIN =(86, Pumpkin.class)
 
 NETHERRACK =(87)
 
 SOUL_SAND =(88)
 
 GLOWSTONE =(89)
 
 PORTAL =(90)
 
 JACK_O_LANTERN =(91, Pumpkin.class)
 
 CAKE_BLOCK =(92, 64, Cake.class)
 
 DIODE_BLOCK_OFF =(93, Diode.class)
 
 DIODE_BLOCK_ON =(94, Diode.class)
 
 LOCKED_CHEST =(95)
 
 STAINED_GLASS =(95)
 
 TRAP_DOOR =(96, TrapDoor.class)
 
 MONSTER_EGGS =(97, MonsterEggs.class)
 
 SMOOTH_BRICK =(98, SmoothBrick.class)
 
 HUGE_MUSHROOM_1 =(99, Mushroom.class)
 
 HUGE_MUSHROOM_2 =(100, Mushroom.class)
 
 IRON_FENCE =(101)
 
 THIN_GLASS =(102)
 
 MELON_BLOCK =(103)
 
 PUMPKIN_STEM =(104, MaterialData.class)
 
 MELON_STEM =(105, MaterialData.class)
 
 VINE =(106, Vine.class)
 
 FENCE_GATE =(107, Gate.class)
 
 BRICK_STAIRS =(108, Stairs.class)
 
 SMOOTH_STAIRS =(109, Stairs.class)
 
 MYCEL =(110)
 
 WATER_LILY =(111)
 
 NETHER_BRICK =(112)
 
 NETHER_FENCE =(113)
 
 NETHER_BRICK_STAIRS =(114, Stairs.class)
 
 NETHER_WARTS =(115, NetherWarts.class)
 
 ENCHANTMENT_TABLE =(116)
 
 BREWING_STAND =(117, MaterialData.class)
 
 CAULDRON =(118, Cauldron.class)
 
 ENDER_PORTAL =(119)
 
 ENDER_PORTAL_FRAME =(120)
 
 ENDER_STONE =(121)
 
 DRAGON_EGG =(122)
 
 REDSTONE_LAMP_OFF =(123)
 
 REDSTONE_LAMP_ON =(124)
 
 WOOD_DOUBLE_STEP =(125, WoodenStep.class)
 
 WOOD_STEP =(126, WoodenStep.class)
 
 COCOA =(127, CocoaPlant.class)
 
 SANDSTONE_STAIRS =(128, Stairs.class)
 
 EMERALD_ORE =(129)
 
 ENDER_CHEST =(130, EnderChest.class)
 
 TRIPWIRE_HOOK =(131, TripwireHook.class)
 
 TRIPWIRE =(132, Tripwire.class)
 
 EMERALD_BLOCK =(133)
 
 SPRUCE_WOOD_STAIRS =(134, Stairs.class)
 
 BIRCH_WOOD_STAIRS =(135, Stairs.class)
 
 JUNGLE_WOOD_STAIRS =(136, Stairs.class)
 
 COMMAND =(137, Command.class)
 
 BEACON =(138)
 
 COBBLE_WALL =(139)
 
 FLOWER_POT =(140, FlowerPot.class)
 
 CARROT =(141)
 
 POTATO =(142)
 
 WOOD_BUTTON =(143, Button.class)
 
 SKULL =(144, Skull.class)
 
 ANVIL =(145)
 
 TRAPPED_CHEST =(146)
 
 GOLD_PLATE =(147)
 
 IRON_PLATE =(148)
 
 REDSTONE_COMPARATOR_OFF =(149)
 
 REDSTONE_COMPARATOR_ON =(150)
 
 DAYLIGHT_DETECTOR =(151)
 
 REDSTONE_BLOCK =(152)
 
 QUARTZ_ORE =(153)
 
 HOPPER =(154)
 
 QUARTZ_BLOCK =(155)
 
 QUARTZ_STAIRS =(156, Stairs.class)
 
 ACTIVATOR_RAIL =(157, PoweredRail.class)
 
 DROPPER =(158, Dispenser.class)
 
 STAINED_CLAY =(159)
 
 STAINED_GLASS_PANE =(160)
 
 LEAVES_2 =(161)
 
 LOG_2 =(162)
 
 ACACIA_STAIRS =(163, Stairs.class)
 
 DARK_OAK_STAIRS =(164, Stairs.class)
 
 HAY_BLOCK =(170)
 
 CARPET =(171)
 
 HARD_CLAY =(172)
 
 COAL_BLOCK =(173)
 
 PACKED_ICE =(174)
 
 DOUBLE_PLANT =(175)
 
 IRON_SPADE =(256, 1, 250)
 
 IRON_PICKAXE =(257, 1, 250)
 
 IRON_AXE =(258, 1, 250)
 
 FLINT_AND_STEEL =(259, 1, 64)
 
 APPLE =(260)
 
 BOW =(261, 1, 384)
 
 ARROW =(262)
 
 COAL =(263, Coal.class)
 
 DIAMOND =(264)
 
 IRON_INGOT =(265)
 
 GOLD_INGOT =(266)
 
 IRON_SWORD =(267, 1, 250)
 
 WOOD_SWORD =(268, 1, 59)
 
 WOOD_SPADE =(269, 1, 59)
 
 WOOD_PICKAXE =(270, 1, 59)
 
 WOOD_AXE =(271, 1, 59)
 
 STONE_SWORD =(272, 1, 131)
 
 STONE_SPADE =(273, 1, 131)
 
 STONE_PICKAXE =(274, 1, 131)
 
 STONE_AXE =(275, 1, 131)
 
 DIAMOND_SWORD =(276, 1, 1561)
 
 DIAMOND_SPADE =(277, 1, 1561)
 
 DIAMOND_PICKAXE =(278, 1, 1561)
 
 DIAMOND_AXE =(279, 1, 1561)
 
 STICK =(280)
 
 BOWL =(281)
 
 MUSHROOM_SOUP =(282, 1)
 
 GOLD_SWORD =(283, 1, 32)
 
 GOLD_SPADE =(284, 1, 32)
 
 GOLD_PICKAXE =(285, 1, 32)
 
 GOLD_AXE =(286, 1, 32)
 
 STRING =(287)
 
 FEATHER =(288)
 
 SULPHUR =(289)
 
 WOOD_HOE =(290, 1, 59)
 
 STONE_HOE =(291, 1, 131)
 
 IRON_HOE =(292, 1, 250)
 
 DIAMOND_HOE =(293, 1, 1561)
 
 GOLD_HOE =(294, 1, 32)
 
 SEEDS =(295)
 
 WHEAT =(296)
 
 BREAD =(297)
 
 LEATHER_HELMET =(298, 1, 55)
 
 LEATHER_CHESTPLATE =(299, 1, 80)
 
 LEATHER_LEGGINGS =(300, 1, 75)
 
 LEATHER_BOOTS =(301, 1, 65)
 
 CHAINMAIL_HELMET =(302, 1, 165)
 
 CHAINMAIL_CHESTPLATE =(303, 1, 240)
 
 CHAINMAIL_LEGGINGS =(304, 1, 225)
 
 CHAINMAIL_BOOTS =(305, 1, 195)
 
 IRON_HELMET =(306, 1, 165)
 
 IRON_CHESTPLATE =(307, 1, 240)
 
 IRON_LEGGINGS =(308, 1, 225)
 
 IRON_BOOTS =(309, 1, 195)
 
 DIAMOND_HELMET =(310, 1, 363)
 
 DIAMOND_CHESTPLATE =(311, 1, 528)
 
 DIAMOND_LEGGINGS =(312, 1, 495)
 
 DIAMOND_BOOTS =(313, 1, 429)
 
 GOLD_HELMET =(314, 1, 77)
 
 GOLD_CHESTPLATE =(315, 1, 112)
 
 GOLD_LEGGINGS =(316, 1, 105)
 
 GOLD_BOOTS =(317, 1, 91)
 
 FLINT =(318)
 
 PORK =(319)
 
 GRILLED_PORK =(320)
 
 PAINTING =(321)
 
 GOLDEN_APPLE =(322)
 
 SIGN =(323, 16)
 
 WOOD_DOOR =(324, 1)
 
 BUCKET =(325, 16)
 
 WATER_BUCKET =(326, 1)
 
 LAVA_BUCKET =(327, 1)
 
 MINECART =(328, 1)
 
 SADDLE =(329, 1)
 
 IRON_DOOR =(330, 1)
 
 REDSTONE =(331)
 
 SNOW_BALL =(332, 16)
 
 BOAT =(333, 1)
 
 LEATHER =(334)
 
 MILK_BUCKET =(335, 1)
 
 CLAY_BRICK =(336)
 
 CLAY_BALL =(337)
 
 SUGAR_CANE =(338)
 
 PAPER =(339)
 
 BOOK =(340)
 
 SLIME_BALL =(341)
 
 STORAGE_MINECART =(342, 1)
 
 POWERED_MINECART =(343, 1)
 
 EGG =(344, 16)
 
 COMPASS =(345)
 
 FISHING_ROD =(346, 1, 64)
 
 WATCH =(347)
 
 GLOWSTONE_DUST =(348)
 
 RAW_FISH =(349)
 
 COOKED_FISH =(350)
 
 INK_SACK =(351, Dye.class)
 
 BONE =(352)
 
 SUGAR =(353)
 
 CAKE =(354, 1)
 
 BED =(355, 1)
 
 DIODE =(356)
 
 COOKIE =(357)
 
 MAP =(358, MaterialData.class)
 
 SHEARS =(359, 1, 238)
 
 MELON =(360)
 
 PUMPKIN_SEEDS =(361)
 
 MELON_SEEDS =(362)
 
 RAW_BEEF =(363)
 
 COOKED_BEEF =(364)
 
 RAW_CHICKEN =(365)
 
 COOKED_CHICKEN =(366)
 
 ROTTEN_FLESH =(367)
 
 ENDER_PEARL =(368, 16)
 
 BLAZE_ROD =(369)
 
 GHAST_TEAR =(370)
 
 GOLD_NUGGET =(371)
 
 NETHER_STALK =(372)
 
 POTION =(373, 1, MaterialData.class)
 
 GLASS_BOTTLE =(374)
 
 SPIDER_EYE =(375)
 
 FERMENTED_SPIDER_EYE =(376)
 
 BLAZE_POWDER =(377)
 
 MAGMA_CREAM =(378)
 
 BREWING_STAND_ITEM =(379)
 
 CAULDRON_ITEM =(380)
 
 EYE_OF_ENDER =(381)
 
 SPECKLED_MELON =(382)
 
 MONSTER_EGG =(383, 64, SpawnEgg.class)
 
 EXP_BOTTLE =(384, 64)
 
 FIREBALL =(385, 64)
 
 BOOK_AND_QUILL =(386, 1)
 
 WRITTEN_BOOK =(387, 16)
 
 EMERALD =(388, 64)
 
 ITEM_FRAME =(389)
 
 FLOWER_POT_ITEM =(390)
 
 CARROT_ITEM =(391)
 
 POTATO_ITEM =(392)
 
 BAKED_POTATO =(393)
 
 POISONOUS_POTATO =(394)
 
 EMPTY_MAP =(395)
 
 GOLDEN_CARROT =(396)
 
 SKULL_ITEM =(397)
 
 CARROT_STICK =(398, 1, 25)
 
 NETHER_STAR =(399)
 
 PUMPKIN_PIE =(400)
 
 FIREWORK =(401)
 
 FIREWORK_CHARGE =(402)
 
 ENCHANTED_BOOK =(403, 1)
 
 REDSTONE_COMPARATOR =(404)
 
 NETHER_BRICK_ITEM =(405)
 
 QUARTZ =(406)
 
 EXPLOSIVE_MINECART =(407, 1)
 
 HOPPER_MINECART =(408, 1)
 
 IRON_BARDING =(417, 1)
 
 GOLD_BARDING =(418, 1)
 
 DIAMOND_BARDING =(419, 1)
 
 LEASH =(420)
 
 NAME_TAG =(421)
 
 COMMAND_MINECART =(422, 1)
 
 GOLD_RECORD =(2256, 1)
 
 GREEN_RECORD =(2257, 1)
 
 RECORD_3 =(2258, 1)
 
 RECORD_4 =(2259, 1)
 
 RECORD_5 =(2260, 1)
 
 RECORD_6 =(2261, 1)
 
 RECORD_7 =(2262, 1)
 
 RECORD_8 =(2263, 1)
 
 RECORD_9 =(2264, 1)
 
 RECORD_10 =(2265, 1)
 
 RECORD_11 =(2266, 1)
 
 RECORD_12 =(2267, 1)
 

Detailed Description

An enum of all material IDs accepted by the official server and client

Definition at line 64 of file Material.java.

Member Function Documentation

Class<? extends MaterialData> org.bukkit.Material.getData ( )

Gets the MaterialData class associated with this Material

Returns
MaterialData associated with this Material

Definition at line 493 of file Material.java.

Referenced by org.bukkit.inventory.ItemStack.getData(), and org.bukkit.inventory.ItemStack.setData().

493  {
494  return ctor.getDeclaringClass();
495  }
int org.bukkit.Material.getId ( )

Gets the item ID or block ID of this Material

Returns
ID of this material
Deprecated:
Magic value

Definition at line 466 of file Material.java.

Referenced by org.bukkit.inventory.ItemStack.ItemStack(), org.bukkit.material.MaterialData.MaterialData(), and org.bukkit.inventory.ItemStack.setType().

466  {
467  return id;
468  }
static Material org.bukkit.Material.getMaterial ( final int  id)
static

Attempts to get the Material with the given ID

Parameters
idID of the material to get
Returns
Material if found, or null
Deprecated:
Magic value

Definition at line 575 of file Material.java.

Referenced by org.bukkit.inventory.ItemStack.deserialize(), org.bukkit.event.block.BlockPhysicsEvent.getChangedType(), org.bukkit.material.MaterialData.getItemType(), and org.bukkit.event.block.BlockCanBuildEvent.getMaterial().

575  {
576  if (byId.length > id && id >= 0) {
577  return byId[id];
578  } else {
579  return null;
580  }
581  }
static Material org.bukkit.Material.getMaterial ( final String  name)
static

Attempts to get the Material with the given name.

This is a normal lookup, names must be the precise name they are given in the enum.

Parameters
nameName of the material to get
Returns
Material if found, or null

Definition at line 592 of file Material.java.

592  {
593  return BY_NAME.get(name);
594  }
short org.bukkit.Material.getMaxDurability ( )

Gets the maximum durability of this material

Returns
Maximum durability for this material

Definition at line 484 of file Material.java.

484  {
485  return durability;
486  }
int org.bukkit.Material.getMaxStackSize ( )

Gets the maximum amount of this material that can be held in a stack

Returns
Maximum stack size for this material

Definition at line 475 of file Material.java.

Referenced by org.bukkit.inventory.ItemStack.getMaxStackSize().

475  {
476  return maxStack;
477  }
MaterialData org.bukkit.Material.getNewData ( final byte  raw)

Constructs a new MaterialData relevant for this Material, with the given initial data

Parameters
rawInitial data to construct the MaterialData with
Returns
New MaterialData with the given data
Deprecated:
Magic value

Definition at line 506 of file Material.java.

Referenced by org.bukkit.inventory.ItemStack.getData().

506  {
507  try {
508  return ctor.newInstance(id, raw);
509  } catch (InstantiationException ex) {
510  final Throwable t = ex.getCause();
511  if (t instanceof RuntimeException) {
512  throw (RuntimeException) t;
513  }
514  if (t instanceof Error) {
515  throw (Error) t;
516  }
517  throw new AssertionError(t);
518  } catch (Throwable t) {
519  throw new AssertionError(t);
520  }
521  }
boolean org.bukkit.Material.hasGravity ( )
Returns
True if this material is affected by gravity.

Definition at line 1021 of file Material.java.

1021  {
1022  if (!isBlock()) {
1023  return false;
1024  }
1025  switch (this) {
1026  case SAND:
1027  case GRAVEL:
1028  case ANVIL:
1029  return true;
1030  default:
1031  return false;
1032  }
1033  }
boolean org.bukkit.Material.isBlock ( )

Checks if this Material is a placable block

Returns
true if this material is a block

Definition at line 528 of file Material.java.

Referenced by org.bukkit.event.player.PlayerInteractEvent.isBlockInHand().

528  {
529  return id < 256;
530  }
boolean org.bukkit.Material.isBurnable ( )

Check if the material is a block and can burn away

Returns
True if this material is a block and can burn away

Definition at line 903 of file Material.java.

903  {
904  if (!isBlock()) {
905  return false;
906  }
907  switch (this) {
908  case WOOD:
909  case LOG:
910  case LEAVES:
911  case LONG_GRASS:
912  case WOOL:
913  case YELLOW_FLOWER:
914  case RED_ROSE:
915  case TNT:
916  case BOOKSHELF:
917  case WOOD_STAIRS:
918  case FENCE:
919  case VINE:
920  case WOOD_DOUBLE_STEP:
921  case WOOD_STEP:
922  case SPRUCE_WOOD_STAIRS:
923  case BIRCH_WOOD_STAIRS:
924  case JUNGLE_WOOD_STAIRS:
925  case HAY_BLOCK:
926  case COAL_BLOCK:
927  case LEAVES_2:
928  case LOG_2:
929  case CARPET:
930  case DOUBLE_PLANT:
931  return true;
932  default:
933  return false;
934  }
935  }
boolean org.bukkit.Material.isEdible ( )

Checks if this Material is edible.

Returns
true if this Material is edible.

Definition at line 537 of file Material.java.

537  {
538  switch (this) {
539  case BREAD:
540  case CARROT_ITEM:
541  case BAKED_POTATO:
542  case POTATO_ITEM:
543  case POISONOUS_POTATO:
544  case GOLDEN_CARROT:
545  case PUMPKIN_PIE:
546  case COOKIE:
547  case MELON:
548  case MUSHROOM_SOUP:
549  case RAW_CHICKEN:
550  case COOKED_CHICKEN:
551  case RAW_BEEF:
552  case COOKED_BEEF:
553  case RAW_FISH:
554  case COOKED_FISH:
555  case PORK:
556  case GRILLED_PORK:
557  case APPLE:
558  case GOLDEN_APPLE:
559  case ROTTEN_FLESH:
560  case SPIDER_EYE:
561  return true;
562  default:
563  return false;
564  }
565  }
boolean org.bukkit.Material.isFlammable ( )

Check if the material is a block and can catch fire

Returns
True if this material is a block and can catch fire

Definition at line 851 of file Material.java.

851  {
852  if (!isBlock()) {
853  return false;
854  }
855  switch (this) {
856  case WOOD:
857  case LOG:
858  case LEAVES:
859  case NOTE_BLOCK:
860  case BED_BLOCK:
861  case LONG_GRASS:
862  case DEAD_BUSH:
863  case WOOL:
864  case TNT:
865  case BOOKSHELF:
866  case WOOD_STAIRS:
867  case CHEST:
868  case WORKBENCH:
869  case SIGN_POST:
870  case WOODEN_DOOR:
871  case WALL_SIGN:
872  case WOOD_PLATE:
873  case JUKEBOX:
874  case FENCE:
875  case TRAP_DOOR:
876  case HUGE_MUSHROOM_1:
877  case HUGE_MUSHROOM_2:
878  case VINE:
879  case FENCE_GATE:
880  case WOOD_DOUBLE_STEP:
881  case WOOD_STEP:
882  case SPRUCE_WOOD_STAIRS:
883  case BIRCH_WOOD_STAIRS:
884  case JUNGLE_WOOD_STAIRS:
885  case TRAPPED_CHEST:
886  case DAYLIGHT_DETECTOR:
887  case CARPET:
888  case LEAVES_2:
889  case LOG_2:
890  case ACACIA_STAIRS:
891  case DARK_OAK_STAIRS:
892  return true;
893  default:
894  return false;
895  }
896  }
boolean org.bukkit.Material.isOccluding ( )

Check if the material is a block and completely blocks vision

Returns
True if this material is a block and completely blocks vision

Definition at line 942 of file Material.java.

942  {
943  if (!isBlock()) {
944  return false;
945  }
946  switch (this) {
947  case STONE:
948  case GRASS:
949  case DIRT:
950  case COBBLESTONE:
951  case WOOD:
952  case BEDROCK:
953  case SAND:
954  case GRAVEL:
955  case GOLD_ORE:
956  case IRON_ORE:
957  case COAL_ORE:
958  case LOG:
959  case SPONGE:
960  case LAPIS_ORE:
961  case LAPIS_BLOCK:
962  case DISPENSER:
963  case SANDSTONE:
964  case NOTE_BLOCK:
965  case WOOL:
966  case GOLD_BLOCK:
967  case IRON_BLOCK:
968  case DOUBLE_STEP:
969  case BRICK:
970  case BOOKSHELF:
971  case MOSSY_COBBLESTONE:
972  case OBSIDIAN:
973  case MOB_SPAWNER:
974  case DIAMOND_ORE:
975  case DIAMOND_BLOCK:
976  case WORKBENCH:
977  case FURNACE:
978  case BURNING_FURNACE:
979  case REDSTONE_ORE:
980  case GLOWING_REDSTONE_ORE:
981  case SNOW_BLOCK:
982  case CLAY:
983  case JUKEBOX:
984  case PUMPKIN:
985  case NETHERRACK:
986  case SOUL_SAND:
987  case JACK_O_LANTERN:
988  case MONSTER_EGGS:
989  case SMOOTH_BRICK:
990  case HUGE_MUSHROOM_1:
991  case HUGE_MUSHROOM_2:
992  case MELON_BLOCK:
993  case MYCEL:
994  case NETHER_BRICK:
995  case ENDER_PORTAL_FRAME:
996  case ENDER_STONE:
997  case REDSTONE_LAMP_OFF:
998  case REDSTONE_LAMP_ON:
999  case WOOD_DOUBLE_STEP:
1000  case EMERALD_ORE:
1001  case EMERALD_BLOCK:
1002  case COMMAND:
1003  case QUARTZ_ORE:
1004  case QUARTZ_BLOCK:
1005  case DROPPER:
1006  case STAINED_CLAY:
1007  case HAY_BLOCK:
1008  case HARD_CLAY:
1009  case COAL_BLOCK:
1010  case LOG_2:
1011  case PACKED_ICE:
1012  return true;
1013  default:
1014  return false;
1015  }
1016  }
boolean org.bukkit.Material.isRecord ( )
Returns
True if this material represents a playable music disk.

Definition at line 642 of file Material.java.

642  {
643  return id >= GOLD_RECORD.id && id <= RECORD_12.id;
644  }
boolean org.bukkit.Material.isSolid ( )

Check if the material is a block and solid (cannot be passed through by a player)

Returns
True if this material is a block and solid

Definition at line 652 of file Material.java.

652  {
653  if (!isBlock() || id == 0) {
654  return false;
655  }
656  switch (this) {
657  case STONE:
658  case GRASS:
659  case DIRT:
660  case COBBLESTONE:
661  case WOOD:
662  case BEDROCK:
663  case SAND:
664  case GRAVEL:
665  case GOLD_ORE:
666  case IRON_ORE:
667  case COAL_ORE:
668  case LOG:
669  case LEAVES:
670  case SPONGE:
671  case GLASS:
672  case LAPIS_ORE:
673  case LAPIS_BLOCK:
674  case DISPENSER:
675  case SANDSTONE:
676  case NOTE_BLOCK:
677  case BED_BLOCK:
678  case PISTON_STICKY_BASE:
679  case PISTON_BASE:
680  case PISTON_EXTENSION:
681  case WOOL:
682  case PISTON_MOVING_PIECE:
683  case GOLD_BLOCK:
684  case IRON_BLOCK:
685  case DOUBLE_STEP:
686  case STEP:
687  case BRICK:
688  case TNT:
689  case BOOKSHELF:
690  case MOSSY_COBBLESTONE:
691  case OBSIDIAN:
692  case MOB_SPAWNER:
693  case WOOD_STAIRS:
694  case CHEST:
695  case DIAMOND_ORE:
696  case DIAMOND_BLOCK:
697  case WORKBENCH:
698  case SOIL:
699  case FURNACE:
700  case BURNING_FURNACE:
701  case SIGN_POST:
702  case WOODEN_DOOR:
703  case COBBLESTONE_STAIRS:
704  case WALL_SIGN:
705  case STONE_PLATE:
706  case IRON_DOOR_BLOCK:
707  case WOOD_PLATE:
708  case REDSTONE_ORE:
709  case GLOWING_REDSTONE_ORE:
710  case ICE:
711  case SNOW_BLOCK:
712  case CACTUS:
713  case CLAY:
714  case JUKEBOX:
715  case FENCE:
716  case PUMPKIN:
717  case NETHERRACK:
718  case SOUL_SAND:
719  case GLOWSTONE:
720  case JACK_O_LANTERN:
721  case CAKE_BLOCK:
722  case LOCKED_CHEST:
723  case STAINED_GLASS:
724  case TRAP_DOOR:
725  case MONSTER_EGGS:
726  case SMOOTH_BRICK:
727  case HUGE_MUSHROOM_1:
728  case HUGE_MUSHROOM_2:
729  case IRON_FENCE:
730  case THIN_GLASS:
731  case MELON_BLOCK:
732  case FENCE_GATE:
733  case BRICK_STAIRS:
734  case SMOOTH_STAIRS:
735  case MYCEL:
736  case NETHER_BRICK:
737  case NETHER_FENCE:
738  case NETHER_BRICK_STAIRS:
739  case ENCHANTMENT_TABLE:
740  case BREWING_STAND:
741  case CAULDRON:
742  case ENDER_PORTAL_FRAME:
743  case ENDER_STONE:
744  case DRAGON_EGG:
745  case REDSTONE_LAMP_OFF:
746  case REDSTONE_LAMP_ON:
747  case WOOD_DOUBLE_STEP:
748  case WOOD_STEP:
749  case SANDSTONE_STAIRS:
750  case EMERALD_ORE:
751  case ENDER_CHEST:
752  case EMERALD_BLOCK:
753  case SPRUCE_WOOD_STAIRS:
754  case BIRCH_WOOD_STAIRS:
755  case JUNGLE_WOOD_STAIRS:
756  case COMMAND:
757  case BEACON:
758  case COBBLE_WALL:
759  case ANVIL:
760  case TRAPPED_CHEST:
761  case GOLD_PLATE:
762  case IRON_PLATE:
763  case DAYLIGHT_DETECTOR:
764  case REDSTONE_BLOCK:
765  case QUARTZ_ORE:
766  case HOPPER:
767  case QUARTZ_BLOCK:
768  case QUARTZ_STAIRS:
769  case DROPPER:
770  case STAINED_CLAY:
771  case HAY_BLOCK:
772  case HARD_CLAY:
773  case COAL_BLOCK:
774  case STAINED_GLASS_PANE:
775  case LEAVES_2:
776  case LOG_2:
777  case ACACIA_STAIRS:
778  case DARK_OAK_STAIRS:
779  case PACKED_ICE:
780  return true;
781  default:
782  return false;
783  }
784  }
boolean org.bukkit.Material.isTransparent ( )

Check if the material is a block and does not block any light

Returns
True if this material is a block and does not block any light

Definition at line 791 of file Material.java.

791  {
792  if (!isBlock()) {
793  return false;
794  }
795  switch (this) {
796  case AIR:
797  case SAPLING:
798  case POWERED_RAIL:
799  case DETECTOR_RAIL:
800  case LONG_GRASS:
801  case DEAD_BUSH:
802  case YELLOW_FLOWER:
803  case RED_ROSE:
804  case BROWN_MUSHROOM:
805  case RED_MUSHROOM:
806  case TORCH:
807  case FIRE:
808  case REDSTONE_WIRE:
809  case CROPS:
810  case LADDER:
811  case RAILS:
812  case LEVER:
813  case REDSTONE_TORCH_OFF:
814  case REDSTONE_TORCH_ON:
815  case STONE_BUTTON:
816  case SNOW:
817  case SUGAR_CANE_BLOCK:
818  case PORTAL:
819  case DIODE_BLOCK_OFF:
820  case DIODE_BLOCK_ON:
821  case PUMPKIN_STEM:
822  case MELON_STEM:
823  case VINE:
824  case WATER_LILY:
825  case NETHER_WARTS:
826  case ENDER_PORTAL:
827  case COCOA:
828  case TRIPWIRE_HOOK:
829  case TRIPWIRE:
830  case FLOWER_POT:
831  case CARROT:
832  case POTATO:
833  case WOOD_BUTTON:
834  case SKULL:
835  case REDSTONE_COMPARATOR_OFF:
836  case REDSTONE_COMPARATOR_ON:
837  case ACTIVATOR_RAIL:
838  case CARPET:
839  case DOUBLE_PLANT:
840  return true;
841  default:
842  return false;
843  }
844  }
static Material org.bukkit.Material.matchMaterial ( final String  name)
static

Attempts to match the Material with the given name.

This is a match lookup; names will be converted to uppercase, then stripped of special characters in an attempt to format it like the enum.

Using this for match by ID is deprecated.

Parameters
nameName of the material to get
Returns
Material if found, or null

Definition at line 608 of file Material.java.

608  {
609  Validate.notNull(name, "Name cannot be null");
610 
611  Material result = null;
612 
613  try {
614  result = getMaterial(Integer.parseInt(name));
615  } catch (NumberFormatException ex) {}
616 
617  if (result == null) {
618  String filtered = name.toUpperCase();
619 
620  filtered = filtered.replaceAll("\\s+", "_").replaceAll("\\W", "");
621  result = BY_NAME.get(filtered);
622  }
623 
624  return result;
625  }
static Material getMaterial(final int id)
Definition: Material.java:575

Member Data Documentation

org.bukkit.Material.MAP =(358, MaterialData.class)
See also
MapView

Definition at line 344 of file Material.java.

org.bukkit.Material.POTION =(373, 1, MaterialData.class)
See also
Potion

Definition at line 362 of file Material.java.

Referenced by org.bukkit.potion.Potion.apply(), and org.bukkit.potion.Potion.toItemStack().


The documentation for this enum was generated from the following file: