├── .gitignore ├── CONTRIBUTING.md ├── LICENCE.txt ├── README.md ├── pom.xml └── src ├── main ├── java │ └── org │ │ ├── bukkit │ │ ├── Achievement.java │ │ ├── Art.java │ │ ├── BanEntry.java │ │ ├── BanList.java │ │ ├── BlockChangeDelegate.java │ │ ├── Bukkit.java │ │ ├── ChatColor.java │ │ ├── Chunk.java │ │ ├── ChunkSnapshot.java │ │ ├── CoalType.java │ │ ├── Color.java │ │ ├── CropState.java │ │ ├── Difficulty.java │ │ ├── DyeColor.java │ │ ├── Effect.java │ │ ├── EntityEffect.java │ │ ├── FireworkEffect.java │ │ ├── GameMode.java │ │ ├── GrassSpecies.java │ │ ├── Instrument.java │ │ ├── Location.java │ │ ├── Material.java │ │ ├── NetherWartsState.java │ │ ├── Note.java │ │ ├── OfflinePlayer.java │ │ ├── PortalType.java │ │ ├── Rotation.java │ │ ├── SandstoneType.java │ │ ├── Server.java │ │ ├── SkullType.java │ │ ├── Sound.java │ │ ├── Statistic.java │ │ ├── TravelAgent.java │ │ ├── TreeSpecies.java │ │ ├── TreeType.java │ │ ├── UnsafeValues.java │ │ ├── Utility.java │ │ ├── Warning.java │ │ ├── WeatherType.java │ │ ├── World.java │ │ ├── WorldCreator.java │ │ ├── WorldType.java │ │ ├── block │ │ │ ├── Beacon.java │ │ │ ├── Biome.java │ │ │ ├── Block.java │ │ │ ├── BlockFace.java │ │ │ ├── BlockState.java │ │ │ ├── BrewingStand.java │ │ │ ├── Chest.java │ │ │ ├── CommandBlock.java │ │ │ ├── ContainerBlock.java │ │ │ ├── CreatureSpawner.java │ │ │ ├── Dispenser.java │ │ │ ├── DoubleChest.java │ │ │ ├── Dropper.java │ │ │ ├── Furnace.java │ │ │ ├── Hopper.java │ │ │ ├── Jukebox.java │ │ │ ├── NoteBlock.java │ │ │ ├── PistonMoveReaction.java │ │ │ ├── Sign.java │ │ │ └── Skull.java │ │ ├── command │ │ │ ├── BlockCommandSender.java │ │ │ ├── Command.java │ │ │ ├── CommandException.java │ │ │ ├── CommandExecutor.java │ │ │ ├── CommandMap.java │ │ │ ├── CommandSender.java │ │ │ ├── ConsoleCommandSender.java │ │ │ ├── FormattedCommandAlias.java │ │ │ ├── MultipleCommandAlias.java │ │ │ ├── PluginCommand.java │ │ │ ├── PluginCommandYamlParser.java │ │ │ ├── PluginIdentifiableCommand.java │ │ │ ├── RemoteConsoleCommandSender.java │ │ │ ├── SimpleCommandMap.java │ │ │ ├── TabCommandExecutor.java │ │ │ ├── TabCompleter.java │ │ │ ├── TabExecutor.java │ │ │ └── defaults │ │ │ │ ├── AchievementCommand.java │ │ │ │ ├── BanCommand.java │ │ │ │ ├── BanIpCommand.java │ │ │ │ ├── BanListCommand.java │ │ │ │ ├── BukkitCommand.java │ │ │ │ ├── ClearCommand.java │ │ │ │ ├── DefaultGameModeCommand.java │ │ │ │ ├── DeopCommand.java │ │ │ │ ├── DifficultyCommand.java │ │ │ │ ├── EffectCommand.java │ │ │ │ ├── EnchantCommand.java │ │ │ │ ├── ExpCommand.java │ │ │ │ ├── GameModeCommand.java │ │ │ │ ├── GameRuleCommand.java │ │ │ │ ├── GiveCommand.java │ │ │ │ ├── HelpCommand.java │ │ │ │ ├── KickCommand.java │ │ │ │ ├── KillCommand.java │ │ │ │ ├── ListCommand.java │ │ │ │ ├── MeCommand.java │ │ │ │ ├── OpCommand.java │ │ │ │ ├── PardonCommand.java │ │ │ │ ├── PardonIpCommand.java │ │ │ │ ├── PlaySoundCommand.java │ │ │ │ ├── PluginsCommand.java │ │ │ │ ├── ReloadCommand.java │ │ │ │ ├── SaveCommand.java │ │ │ │ ├── SaveOffCommand.java │ │ │ │ ├── SaveOnCommand.java │ │ │ │ ├── SayCommand.java │ │ │ │ ├── ScoreboardCommand.java │ │ │ │ ├── SeedCommand.java │ │ │ │ ├── SetIdleTimeoutCommand.java │ │ │ │ ├── SetWorldSpawnCommand.java │ │ │ │ ├── SpawnpointCommand.java │ │ │ │ ├── SpreadPlayersCommand.java │ │ │ │ ├── StopCommand.java │ │ │ │ ├── TeleportCommand.java │ │ │ │ ├── TellCommand.java │ │ │ │ ├── TestForCommand.java │ │ │ │ ├── TimeCommand.java │ │ │ │ ├── TimingsCommand.java │ │ │ │ ├── ToggleDownfallCommand.java │ │ │ │ ├── VanillaCommand.java │ │ │ │ ├── VersionCommand.java │ │ │ │ ├── WeatherCommand.java │ │ │ │ └── WhitelistCommand.java │ │ ├── configuration │ │ │ ├── Configuration.java │ │ │ ├── ConfigurationOptions.java │ │ │ ├── ConfigurationSection.java │ │ │ ├── InvalidConfigurationException.java │ │ │ ├── MemoryConfiguration.java │ │ │ ├── MemoryConfigurationOptions.java │ │ │ ├── MemorySection.java │ │ │ ├── file │ │ │ │ ├── FileConfiguration.java │ │ │ │ ├── FileConfigurationOptions.java │ │ │ │ ├── YamlConfiguration.java │ │ │ │ ├── YamlConfigurationOptions.java │ │ │ │ ├── YamlConstructor.java │ │ │ │ └── YamlRepresenter.java │ │ │ └── serialization │ │ │ │ ├── ConfigurationSerializable.java │ │ │ │ ├── ConfigurationSerialization.java │ │ │ │ ├── DelegateDeserialization.java │ │ │ │ └── SerializableAs.java │ │ ├── conversations │ │ │ ├── BooleanPrompt.java │ │ │ ├── Conversable.java │ │ │ ├── Conversation.java │ │ │ ├── ConversationAbandonedEvent.java │ │ │ ├── ConversationAbandonedListener.java │ │ │ ├── ConversationCanceller.java │ │ │ ├── ConversationContext.java │ │ │ ├── ConversationFactory.java │ │ │ ├── ConversationPrefix.java │ │ │ ├── ExactMatchConversationCanceller.java │ │ │ ├── FixedSetPrompt.java │ │ │ ├── InactivityConversationCanceller.java │ │ │ ├── ManuallyAbandonedConversationCanceller.java │ │ │ ├── MessagePrompt.java │ │ │ ├── NullConversationPrefix.java │ │ │ ├── NumericPrompt.java │ │ │ ├── PlayerNamePrompt.java │ │ │ ├── PluginNameConversationPrefix.java │ │ │ ├── Prompt.java │ │ │ ├── RegexPrompt.java │ │ │ ├── StringPrompt.java │ │ │ └── ValidatingPrompt.java │ │ ├── enchantments │ │ │ ├── Enchantment.java │ │ │ ├── EnchantmentTarget.java │ │ │ └── EnchantmentWrapper.java │ │ ├── entity │ │ │ ├── Ageable.java │ │ │ ├── Ambient.java │ │ │ ├── AnimalTamer.java │ │ │ ├── Animals.java │ │ │ ├── Arrow.java │ │ │ ├── Bat.java │ │ │ ├── Blaze.java │ │ │ ├── Boat.java │ │ │ ├── CaveSpider.java │ │ │ ├── Chicken.java │ │ │ ├── ComplexEntityPart.java │ │ │ ├── ComplexLivingEntity.java │ │ │ ├── Cow.java │ │ │ ├── Creature.java │ │ │ ├── CreatureType.java │ │ │ ├── Creeper.java │ │ │ ├── Damageable.java │ │ │ ├── Egg.java │ │ │ ├── EnderCrystal.java │ │ │ ├── EnderDragon.java │ │ │ ├── EnderDragonPart.java │ │ │ ├── EnderPearl.java │ │ │ ├── EnderSignal.java │ │ │ ├── Enderman.java │ │ │ ├── Entity.java │ │ │ ├── EntityType.java │ │ │ ├── ExperienceOrb.java │ │ │ ├── Explosive.java │ │ │ ├── FallingBlock.java │ │ │ ├── FallingSand.java │ │ │ ├── Fireball.java │ │ │ ├── Firework.java │ │ │ ├── Fish.java │ │ │ ├── FishHook.java │ │ │ ├── Flying.java │ │ │ ├── Ghast.java │ │ │ ├── Giant.java │ │ │ ├── Golem.java │ │ │ ├── Hanging.java │ │ │ ├── Horse.java │ │ │ ├── HumanEntity.java │ │ │ ├── IronGolem.java │ │ │ ├── Item.java │ │ │ ├── ItemFrame.java │ │ │ ├── LargeFireball.java │ │ │ ├── LeashHitch.java │ │ │ ├── LightningStrike.java │ │ │ ├── LivingEntity.java │ │ │ ├── MagmaCube.java │ │ │ ├── Minecart.java │ │ │ ├── Monster.java │ │ │ ├── MushroomCow.java │ │ │ ├── NPC.java │ │ │ ├── Ocelot.java │ │ │ ├── Painting.java │ │ │ ├── Pig.java │ │ │ ├── PigZombie.java │ │ │ ├── Player.java │ │ │ ├── PoweredMinecart.java │ │ │ ├── Projectile.java │ │ │ ├── Sheep.java │ │ │ ├── Silverfish.java │ │ │ ├── Skeleton.java │ │ │ ├── Slime.java │ │ │ ├── SmallFireball.java │ │ │ ├── Snowball.java │ │ │ ├── Snowman.java │ │ │ ├── Spider.java │ │ │ ├── Squid.java │ │ │ ├── StorageMinecart.java │ │ │ ├── TNTPrimed.java │ │ │ ├── Tameable.java │ │ │ ├── ThrownExpBottle.java │ │ │ ├── ThrownPotion.java │ │ │ ├── Vehicle.java │ │ │ ├── Villager.java │ │ │ ├── WaterMob.java │ │ │ ├── Weather.java │ │ │ ├── Witch.java │ │ │ ├── Wither.java │ │ │ ├── WitherSkull.java │ │ │ ├── Wolf.java │ │ │ ├── Zombie.java │ │ │ └── minecart │ │ │ │ ├── CommandMinecart.java │ │ │ │ ├── ExplosiveMinecart.java │ │ │ │ ├── HopperMinecart.java │ │ │ │ ├── PoweredMinecart.java │ │ │ │ ├── RideableMinecart.java │ │ │ │ ├── SpawnerMinecart.java │ │ │ │ └── StorageMinecart.java │ │ ├── event │ │ │ ├── Cancellable.java │ │ │ ├── Event.java │ │ │ ├── EventException.java │ │ │ ├── EventHandler.java │ │ │ ├── EventPriority.java │ │ │ ├── HandlerList.java │ │ │ ├── Listener.java │ │ │ ├── block │ │ │ │ ├── Action.java │ │ │ │ ├── BlockBreakEvent.java │ │ │ │ ├── BlockBurnEvent.java │ │ │ │ ├── BlockCanBuildEvent.java │ │ │ │ ├── BlockDamageEvent.java │ │ │ │ ├── BlockDispenseEvent.java │ │ │ │ ├── BlockEvent.java │ │ │ │ ├── BlockExpEvent.java │ │ │ │ ├── BlockFadeEvent.java │ │ │ │ ├── BlockFormEvent.java │ │ │ │ ├── BlockFromToEvent.java │ │ │ │ ├── BlockGrowEvent.java │ │ │ │ ├── BlockIgniteEvent.java │ │ │ │ ├── BlockMultiPlaceEvent.java │ │ │ │ ├── BlockPhysicsEvent.java │ │ │ │ ├── BlockPistonEvent.java │ │ │ │ ├── BlockPistonExtendEvent.java │ │ │ │ ├── BlockPistonRetractEvent.java │ │ │ │ ├── BlockPlaceEvent.java │ │ │ │ ├── BlockRedstoneEvent.java │ │ │ │ ├── BlockSpreadEvent.java │ │ │ │ ├── EntityBlockFormEvent.java │ │ │ │ ├── LeavesDecayEvent.java │ │ │ │ ├── NotePlayEvent.java │ │ │ │ └── SignChangeEvent.java │ │ │ ├── enchantment │ │ │ │ ├── EnchantItemEvent.java │ │ │ │ └── PrepareItemEnchantEvent.java │ │ │ ├── entity │ │ │ │ ├── CreatureSpawnEvent.java │ │ │ │ ├── CreeperPowerEvent.java │ │ │ │ ├── EntityBreakDoorEvent.java │ │ │ │ ├── EntityChangeBlockEvent.java │ │ │ │ ├── EntityCombustByBlockEvent.java │ │ │ │ ├── EntityCombustByEntityEvent.java │ │ │ │ ├── EntityCombustEvent.java │ │ │ │ ├── EntityCreatePortalEvent.java │ │ │ │ ├── EntityDamageByBlockEvent.java │ │ │ │ ├── EntityDamageByEntityEvent.java │ │ │ │ ├── EntityDamageEvent.java │ │ │ │ ├── EntityDeathEvent.java │ │ │ │ ├── EntityEvent.java │ │ │ │ ├── EntityExplodeEvent.java │ │ │ │ ├── EntityInteractEvent.java │ │ │ │ ├── EntityPortalEnterEvent.java │ │ │ │ ├── EntityPortalEvent.java │ │ │ │ ├── EntityPortalExitEvent.java │ │ │ │ ├── EntityRegainHealthEvent.java │ │ │ │ ├── EntityShootBowEvent.java │ │ │ │ ├── EntitySpawnEvent.java │ │ │ │ ├── EntityTameEvent.java │ │ │ │ ├── EntityTargetEvent.java │ │ │ │ ├── EntityTargetLivingEntityEvent.java │ │ │ │ ├── EntityTeleportEvent.java │ │ │ │ ├── EntityUnleashEvent.java │ │ │ │ ├── ExpBottleEvent.java │ │ │ │ ├── ExplosionPrimeEvent.java │ │ │ │ ├── FoodLevelChangeEvent.java │ │ │ │ ├── HorseJumpEvent.java │ │ │ │ ├── ItemDespawnEvent.java │ │ │ │ ├── ItemSpawnEvent.java │ │ │ │ ├── PigZapEvent.java │ │ │ │ ├── PlayerDeathEvent.java │ │ │ │ ├── PlayerLeashEntityEvent.java │ │ │ │ ├── PotionSplashEvent.java │ │ │ │ ├── ProjectileHitEvent.java │ │ │ │ ├── ProjectileLaunchEvent.java │ │ │ │ ├── SheepDyeWoolEvent.java │ │ │ │ ├── SheepRegrowWoolEvent.java │ │ │ │ ├── SlimeSplitEvent.java │ │ │ │ └── SpawnerSpawnEvent.java │ │ │ ├── hanging │ │ │ │ ├── HangingBreakByEntityEvent.java │ │ │ │ ├── HangingBreakEvent.java │ │ │ │ ├── HangingEvent.java │ │ │ │ └── HangingPlaceEvent.java │ │ │ ├── inventory │ │ │ │ ├── BrewEvent.java │ │ │ │ ├── ClickType.java │ │ │ │ ├── CraftItemEvent.java │ │ │ │ ├── DragType.java │ │ │ │ ├── FurnaceBurnEvent.java │ │ │ │ ├── FurnaceExtractEvent.java │ │ │ │ ├── FurnaceSmeltEvent.java │ │ │ │ ├── InventoryAction.java │ │ │ │ ├── InventoryClickEvent.java │ │ │ │ ├── InventoryCloseEvent.java │ │ │ │ ├── InventoryCreativeEvent.java │ │ │ │ ├── InventoryDragEvent.java │ │ │ │ ├── InventoryEvent.java │ │ │ │ ├── InventoryInteractEvent.java │ │ │ │ ├── InventoryMoveItemEvent.java │ │ │ │ ├── InventoryOpenEvent.java │ │ │ │ ├── InventoryPickupItemEvent.java │ │ │ │ ├── InventoryType.java │ │ │ │ └── PrepareItemCraftEvent.java │ │ │ ├── painting │ │ │ │ ├── PaintingBreakByEntityEvent.java │ │ │ │ ├── PaintingBreakEvent.java │ │ │ │ ├── PaintingEvent.java │ │ │ │ └── PaintingPlaceEvent.java │ │ │ ├── player │ │ │ │ ├── AsyncPlayerChatEvent.java │ │ │ │ ├── AsyncPlayerPreLoginEvent.java │ │ │ │ ├── PlayerAchievementAwardedEvent.java │ │ │ │ ├── PlayerAnimationEvent.java │ │ │ │ ├── PlayerAnimationType.java │ │ │ │ ├── PlayerBedEnterEvent.java │ │ │ │ ├── PlayerBedLeaveEvent.java │ │ │ │ ├── PlayerBucketEmptyEvent.java │ │ │ │ ├── PlayerBucketEvent.java │ │ │ │ ├── PlayerBucketFillEvent.java │ │ │ │ ├── PlayerChangedWorldEvent.java │ │ │ │ ├── PlayerChannelEvent.java │ │ │ │ ├── PlayerChatEvent.java │ │ │ │ ├── PlayerChatTabCompleteEvent.java │ │ │ │ ├── PlayerCommandPreprocessEvent.java │ │ │ │ ├── PlayerDropItemEvent.java │ │ │ │ ├── PlayerEditBookEvent.java │ │ │ │ ├── PlayerEggThrowEvent.java │ │ │ │ ├── PlayerEvent.java │ │ │ │ ├── PlayerExpChangeEvent.java │ │ │ │ ├── PlayerFishEvent.java │ │ │ │ ├── PlayerGameModeChangeEvent.java │ │ │ │ ├── PlayerInteractEntityEvent.java │ │ │ │ ├── PlayerInteractEvent.java │ │ │ │ ├── PlayerInventoryEvent.java │ │ │ │ ├── PlayerItemBreakEvent.java │ │ │ │ ├── PlayerItemConsumeEvent.java │ │ │ │ ├── PlayerItemDamageEvent.java │ │ │ │ ├── PlayerItemHeldEvent.java │ │ │ │ ├── PlayerJoinEvent.java │ │ │ │ ├── PlayerKickEvent.java │ │ │ │ ├── PlayerLevelChangeEvent.java │ │ │ │ ├── PlayerLoginEvent.java │ │ │ │ ├── PlayerMoveEvent.java │ │ │ │ ├── PlayerPickupItemEvent.java │ │ │ │ ├── PlayerPortalEvent.java │ │ │ │ ├── PlayerPreLoginEvent.java │ │ │ │ ├── PlayerQuitEvent.java │ │ │ │ ├── PlayerRegisterChannelEvent.java │ │ │ │ ├── PlayerRespawnEvent.java │ │ │ │ ├── PlayerShearEntityEvent.java │ │ │ │ ├── PlayerStatisticIncrementEvent.java │ │ │ │ ├── PlayerTeleportEvent.java │ │ │ │ ├── PlayerToggleFlightEvent.java │ │ │ │ ├── PlayerToggleSneakEvent.java │ │ │ │ ├── PlayerToggleSprintEvent.java │ │ │ │ ├── PlayerUnleashEntityEvent.java │ │ │ │ ├── PlayerUnregisterChannelEvent.java │ │ │ │ └── PlayerVelocityEvent.java │ │ │ ├── server │ │ │ │ ├── MapInitializeEvent.java │ │ │ │ ├── PluginDisableEvent.java │ │ │ │ ├── PluginEnableEvent.java │ │ │ │ ├── PluginEvent.java │ │ │ │ ├── RemoteServerCommandEvent.java │ │ │ │ ├── ServerCommandEvent.java │ │ │ │ ├── ServerEvent.java │ │ │ │ ├── ServerListPingEvent.java │ │ │ │ ├── ServiceEvent.java │ │ │ │ ├── ServiceRegisterEvent.java │ │ │ │ └── ServiceUnregisterEvent.java │ │ │ ├── vehicle │ │ │ │ ├── VehicleBlockCollisionEvent.java │ │ │ │ ├── VehicleCollisionEvent.java │ │ │ │ ├── VehicleCreateEvent.java │ │ │ │ ├── VehicleDamageEvent.java │ │ │ │ ├── VehicleDestroyEvent.java │ │ │ │ ├── VehicleEnterEvent.java │ │ │ │ ├── VehicleEntityCollisionEvent.java │ │ │ │ ├── VehicleEvent.java │ │ │ │ ├── VehicleExitEvent.java │ │ │ │ ├── VehicleMoveEvent.java │ │ │ │ └── VehicleUpdateEvent.java │ │ │ ├── weather │ │ │ │ ├── LightningStrikeEvent.java │ │ │ │ ├── ThunderChangeEvent.java │ │ │ │ ├── WeatherChangeEvent.java │ │ │ │ └── WeatherEvent.java │ │ │ └── world │ │ │ │ ├── ChunkEvent.java │ │ │ │ ├── ChunkLoadEvent.java │ │ │ │ ├── ChunkPopulateEvent.java │ │ │ │ ├── ChunkUnloadEvent.java │ │ │ │ ├── PortalCreateEvent.java │ │ │ │ ├── SpawnChangeEvent.java │ │ │ │ ├── StructureGrowEvent.java │ │ │ │ ├── WorldEvent.java │ │ │ │ ├── WorldInitEvent.java │ │ │ │ ├── WorldLoadEvent.java │ │ │ │ ├── WorldSaveEvent.java │ │ │ │ └── WorldUnloadEvent.java │ │ ├── generator │ │ │ ├── BlockPopulator.java │ │ │ └── ChunkGenerator.java │ │ ├── help │ │ │ ├── GenericCommandHelpTopic.java │ │ │ ├── HelpMap.java │ │ │ ├── HelpTopic.java │ │ │ ├── HelpTopicComparator.java │ │ │ ├── HelpTopicFactory.java │ │ │ └── IndexHelpTopic.java │ │ ├── inventory │ │ │ ├── AnvilInventory.java │ │ │ ├── BeaconInventory.java │ │ │ ├── BrewerInventory.java │ │ │ ├── CraftingInventory.java │ │ │ ├── DoubleChestInventory.java │ │ │ ├── EnchantingInventory.java │ │ │ ├── EntityEquipment.java │ │ │ ├── FurnaceInventory.java │ │ │ ├── FurnaceRecipe.java │ │ │ ├── HorseInventory.java │ │ │ ├── Inventory.java │ │ │ ├── InventoryHolder.java │ │ │ ├── InventoryView.java │ │ │ ├── ItemFactory.java │ │ │ ├── ItemStack.java │ │ │ ├── MerchantInventory.java │ │ │ ├── PlayerInventory.java │ │ │ ├── Recipe.java │ │ │ ├── ShapedRecipe.java │ │ │ ├── ShapelessRecipe.java │ │ │ └── meta │ │ │ │ ├── BookMeta.java │ │ │ │ ├── EnchantmentStorageMeta.java │ │ │ │ ├── FireworkEffectMeta.java │ │ │ │ ├── FireworkMeta.java │ │ │ │ ├── ItemMeta.java │ │ │ │ ├── LeatherArmorMeta.java │ │ │ │ ├── MapMeta.java │ │ │ │ ├── PotionMeta.java │ │ │ │ ├── Repairable.java │ │ │ │ └── SkullMeta.java │ │ ├── map │ │ │ ├── MapCanvas.java │ │ │ ├── MapCursor.java │ │ │ ├── MapCursorCollection.java │ │ │ ├── MapFont.java │ │ │ ├── MapPalette.java │ │ │ ├── MapRenderer.java │ │ │ ├── MapView.java │ │ │ └── MinecraftFont.java │ │ ├── material │ │ │ ├── Attachable.java │ │ │ ├── Bed.java │ │ │ ├── Button.java │ │ │ ├── Cake.java │ │ │ ├── Cauldron.java │ │ │ ├── Chest.java │ │ │ ├── Coal.java │ │ │ ├── CocoaPlant.java │ │ │ ├── Colorable.java │ │ │ ├── Command.java │ │ │ ├── Crops.java │ │ │ ├── DetectorRail.java │ │ │ ├── Diode.java │ │ │ ├── Directional.java │ │ │ ├── DirectionalContainer.java │ │ │ ├── Dispenser.java │ │ │ ├── Door.java │ │ │ ├── Dye.java │ │ │ ├── EnderChest.java │ │ │ ├── ExtendedRails.java │ │ │ ├── FlowerPot.java │ │ │ ├── Furnace.java │ │ │ ├── FurnaceAndDispenser.java │ │ │ ├── Gate.java │ │ │ ├── Ladder.java │ │ │ ├── Leaves.java │ │ │ ├── Lever.java │ │ │ ├── LongGrass.java │ │ │ ├── MaterialData.java │ │ │ ├── MonsterEggs.java │ │ │ ├── Mushroom.java │ │ │ ├── NetherWarts.java │ │ │ ├── Openable.java │ │ │ ├── PistonBaseMaterial.java │ │ │ ├── PistonExtensionMaterial.java │ │ │ ├── PoweredRail.java │ │ │ ├── PressurePlate.java │ │ │ ├── PressureSensor.java │ │ │ ├── Pumpkin.java │ │ │ ├── Rails.java │ │ │ ├── Redstone.java │ │ │ ├── RedstoneTorch.java │ │ │ ├── RedstoneWire.java │ │ │ ├── Sandstone.java │ │ │ ├── Sign.java │ │ │ ├── SimpleAttachableMaterialData.java │ │ │ ├── Skull.java │ │ │ ├── SmoothBrick.java │ │ │ ├── SpawnEgg.java │ │ │ ├── Stairs.java │ │ │ ├── Step.java │ │ │ ├── TexturedMaterial.java │ │ │ ├── Torch.java │ │ │ ├── TrapDoor.java │ │ │ ├── Tree.java │ │ │ ├── Tripwire.java │ │ │ ├── TripwireHook.java │ │ │ ├── Vine.java │ │ │ ├── WoodenStep.java │ │ │ └── Wool.java │ │ ├── metadata │ │ │ ├── FixedMetadataValue.java │ │ │ ├── LazyMetadataValue.java │ │ │ ├── MetadataConversionException.java │ │ │ ├── MetadataEvaluationException.java │ │ │ ├── MetadataStore.java │ │ │ ├── MetadataStoreBase.java │ │ │ ├── MetadataValue.java │ │ │ ├── MetadataValueAdapter.java │ │ │ └── Metadatable.java │ │ ├── permissions │ │ │ ├── Permissible.java │ │ │ ├── PermissibleBase.java │ │ │ ├── Permission.java │ │ │ ├── PermissionAttachment.java │ │ │ ├── PermissionAttachmentInfo.java │ │ │ ├── PermissionDefault.java │ │ │ ├── PermissionRemovedExecutor.java │ │ │ └── ServerOperator.java │ │ ├── plugin │ │ │ ├── AuthorNagException.java │ │ │ ├── EventExecutor.java │ │ │ ├── IllegalPluginAccessException.java │ │ │ ├── InvalidDescriptionException.java │ │ │ ├── InvalidPluginException.java │ │ │ ├── Plugin.java │ │ │ ├── PluginAwareness.java │ │ │ ├── PluginBase.java │ │ │ ├── PluginDescriptionFile.java │ │ │ ├── PluginLoadOrder.java │ │ │ ├── PluginLoader.java │ │ │ ├── PluginLogger.java │ │ │ ├── PluginManager.java │ │ │ ├── RegisteredListener.java │ │ │ ├── RegisteredServiceProvider.java │ │ │ ├── ServicePriority.java │ │ │ ├── ServicesManager.java │ │ │ ├── SimplePluginManager.java │ │ │ ├── SimpleServicesManager.java │ │ │ ├── TimedRegisteredListener.java │ │ │ ├── UnknownDependencyException.java │ │ │ ├── java │ │ │ │ ├── JavaPlugin.java │ │ │ │ ├── JavaPluginLoader.java │ │ │ │ └── PluginClassLoader.java │ │ │ └── messaging │ │ │ │ ├── ChannelNameTooLongException.java │ │ │ │ ├── ChannelNotRegisteredException.java │ │ │ │ ├── MessageTooLargeException.java │ │ │ │ ├── Messenger.java │ │ │ │ ├── PluginChannelDirection.java │ │ │ │ ├── PluginMessageListener.java │ │ │ │ ├── PluginMessageListenerRegistration.java │ │ │ │ ├── PluginMessageRecipient.java │ │ │ │ ├── ReservedChannelException.java │ │ │ │ └── StandardMessenger.java │ │ ├── potion │ │ │ ├── Potion.java │ │ │ ├── PotionBrewer.java │ │ │ ├── PotionEffect.java │ │ │ ├── PotionEffectType.java │ │ │ ├── PotionEffectTypeWrapper.java │ │ │ └── PotionType.java │ │ ├── projectiles │ │ │ ├── BlockProjectileSource.java │ │ │ └── ProjectileSource.java │ │ ├── scheduler │ │ │ ├── BukkitRunnable.java │ │ │ ├── BukkitScheduler.java │ │ │ ├── BukkitTask.java │ │ │ └── BukkitWorker.java │ │ ├── scoreboard │ │ │ ├── Criterias.java │ │ │ ├── DisplaySlot.java │ │ │ ├── Objective.java │ │ │ ├── Score.java │ │ │ ├── Scoreboard.java │ │ │ ├── ScoreboardManager.java │ │ │ └── Team.java │ │ └── util │ │ │ ├── BlockIterator.java │ │ │ ├── BlockVector.java │ │ │ ├── CachedServerIcon.java │ │ │ ├── ChatPaginator.java │ │ │ ├── FileUtil.java │ │ │ ├── Java15Compat.java │ │ │ ├── NumberConversions.java │ │ │ ├── StringUtil.java │ │ │ ├── Vector.java │ │ │ ├── io │ │ │ ├── BukkitObjectInputStream.java │ │ │ ├── BukkitObjectOutputStream.java │ │ │ └── Wrapper.java │ │ │ ├── noise │ │ │ ├── NoiseGenerator.java │ │ │ ├── OctaveGenerator.java │ │ │ ├── PerlinNoiseGenerator.java │ │ │ ├── PerlinOctaveGenerator.java │ │ │ ├── SimplexNoiseGenerator.java │ │ │ └── SimplexOctaveGenerator.java │ │ │ └── permissions │ │ │ ├── BroadcastPermissions.java │ │ │ ├── CommandPermissions.java │ │ │ └── DefaultPermissions.java │ │ └── spigotmc │ │ ├── CustomTimingsHandler.java │ │ └── event │ │ ├── entity │ │ ├── EntityDismountEvent.java │ │ └── EntityMountEvent.java │ │ └── player │ │ └── PlayerSpawnLocationEvent.java └── javadoc │ ├── org │ └── bukkit │ │ ├── block │ │ └── package-info.java │ │ ├── command │ │ ├── defaults │ │ │ └── package-info.java │ │ └── package-info.java │ │ ├── configuration │ │ ├── file │ │ │ └── package-info.java │ │ ├── package-info.java │ │ └── serialization │ │ │ └── package-info.java │ │ ├── conversations │ │ └── package-info.java │ │ ├── enchantments │ │ └── package-info.java │ │ ├── entity │ │ ├── minecart │ │ │ └── package-info.java │ │ └── package-info.java │ │ ├── event │ │ ├── block │ │ │ └── package-info.java │ │ ├── enchantment │ │ │ └── package-info.java │ │ ├── entity │ │ │ └── package-info.java │ │ ├── hanging │ │ │ └── package-info.java │ │ ├── inventory │ │ │ └── package-info.java │ │ ├── package-info.java │ │ ├── painting │ │ │ └── package-info.java │ │ ├── player │ │ │ └── package-info.java │ │ ├── server │ │ │ └── package-info.java │ │ ├── vehicle │ │ │ └── package-info.java │ │ ├── weather │ │ │ └── package-info.java │ │ └── world │ │ │ └── package-info.java │ │ ├── generator │ │ └── package-info.java │ │ ├── help │ │ └── package-info.java │ │ ├── inventory │ │ ├── meta │ │ │ └── package-info.java │ │ └── package-info.java │ │ ├── map │ │ └── package-info.java │ │ ├── material │ │ └── package-info.java │ │ ├── metadata │ │ └── package-info.java │ │ ├── package-info.java │ │ ├── permissions │ │ └── package-info.java │ │ ├── plugin │ │ ├── doc-files │ │ │ └── permissions-example_plugin.yml │ │ ├── java │ │ │ └── package-info.java │ │ ├── messaging │ │ │ └── package-info.java │ │ └── package-info.java │ │ ├── potion │ │ └── package-info.java │ │ ├── projectiles │ │ └── package-info.java │ │ ├── scheduler │ │ └── package-info.java │ │ ├── scoreboard │ │ └── package-info.java │ │ └── util │ │ ├── io │ │ └── package-info.java │ │ ├── noise │ │ └── package-info.java │ │ ├── package-info.java │ │ └── permissions │ │ └── package-info.java │ └── overview.html ├── site ├── apt │ └── index.apt └── site.xml └── test └── java └── org └── bukkit ├── ArtTest.java ├── BukkitMirrorTest.java ├── ChatColorTest.java ├── ChatPaginatorTest.java ├── CoalTypeTest.java ├── ColorTest.java ├── CropStateTest.java ├── DifficultyTest.java ├── DyeColorTest.java ├── EffectTest.java ├── EntityEffectTest.java ├── GameModeTest.java ├── GrassSpeciesTest.java ├── InstrumentTest.java ├── LocationTest.java ├── MaterialTest.java ├── NoteTest.java ├── TestServer.java ├── TreeSpeciesTest.java ├── WorldTypeTest.java ├── configuration ├── ConfigurationSectionTest.java ├── ConfigurationTest.java ├── MemoryConfigurationTest.java ├── MemorySectionTest.java └── file │ ├── FileConfigurationTest.java │ └── YamlConfigurationTest.java ├── conversations ├── ConversationContextTest.java ├── ConversationTest.java ├── FakeConversable.java └── ValidatingPromptTest.java ├── event ├── PlayerChatTabCompleteEventTest.java └── TestEvent.java ├── metadata ├── FixedMetadataValueTest.java ├── LazyMetadataValueTest.java ├── MetadataConversionTest.java ├── MetadataStoreTest.java └── MetadataValueAdapterTest.java ├── plugin ├── PluginManagerTest.java ├── TestPlugin.java ├── TimedRegisteredListenerTest.java └── messaging │ ├── StandardMessengerTest.java │ ├── TestMessageListener.java │ └── TestPlayer.java ├── potion └── PotionTest.java └── util ├── StringUtilStartsWithTest.java ├── StringUtilTest.java └── io └── BukkitObjectStreamTest.java /.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse stuff 2 | /.classpath 3 | /.project 4 | /.settings 5 | 6 | # netbeans 7 | /nbproject 8 | 9 | # we use maven! 10 | /build.xml 11 | 12 | # maven 13 | /target 14 | 15 | # vim 16 | .*.sw[a-p] 17 | 18 | # various other potential build files 19 | /build 20 | /bin 21 | /dist 22 | /manifest.mf 23 | 24 | # Mac filesystem dust 25 | .DS_Store 26 | 27 | # intellij 28 | *.iml 29 | *.ipr 30 | *.iws 31 | .idea/ 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Spigot-API 2 | ====== 3 | 4 | A Minecraft Server API. 5 | 6 | Website: [http://spigotmc.org](http://spigotmc.org) 7 | Bugs/Suggestions: [http://www.spigotmc.org/forums/bugs-feature-requests.8/](http://www.spigotmc.org/forums/bugs-feature-requests.8/) 8 | Contributing Guidelines: [CONTRIBUTING.md](https://github.com/SpigotMC/Spigot-API/blob/master/CONTRIBUTING.md) 9 | 10 | Compilation 11 | ----------- 12 | 13 | We use maven to handle our dependencies. 14 | 15 | * Install [Maven 3](http://maven.apache.org/download.html) 16 | * Check out this repo and: `mvn clean install` 17 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/NetherWartsState.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | public enum NetherWartsState { 4 | 5 | /** 6 | * State when first seeded 7 | */ 8 | SEEDED, 9 | /** 10 | * First growth stage 11 | */ 12 | STAGE_ONE, 13 | /** 14 | * Second growth stage 15 | */ 16 | STAGE_TWO, 17 | /** 18 | * Ready to harvest 19 | */ 20 | RIPE; 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/PortalType.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | /** 4 | * Represents various types of portals that can be made in a world. 5 | */ 6 | public enum PortalType { 7 | 8 | /** 9 | * This is a Nether portal, made of obsidian. 10 | */ 11 | NETHER, 12 | 13 | /** 14 | * This is an Ender portal. 15 | */ 16 | ENDER, 17 | 18 | /** 19 | * This is a custom Plugin portal. 20 | */ 21 | CUSTOM; 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/Rotation.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | /** 4 | * An enum to specify a rotation based orientation, like that on a clock. 5 | *

6 | * It represents how something is viewed, as opposed to cardinal directions. 7 | */ 8 | public enum Rotation { 9 | 10 | /** 11 | * No rotation 12 | */ 13 | NONE, 14 | /** 15 | * Rotated clockwise by 90 degrees 16 | */ 17 | CLOCKWISE, 18 | /** 19 | * Flipped upside-down, a 180 degree rotation 20 | */ 21 | FLIPPED, 22 | /** 23 | * Rotated counter-clockwise by 90 degrees 24 | */ 25 | COUNTER_CLOCKWISE, 26 | ; 27 | 28 | private static final Rotation [] rotations = values(); 29 | 30 | /** 31 | * Rotate clockwise by 90 degrees. 32 | * 33 | * @return the relative rotation 34 | */ 35 | public Rotation rotateClockwise() { 36 | return rotations[(this.ordinal() + 1) & 0x3]; 37 | } 38 | 39 | /** 40 | * Rotate counter-clockwise by 90 degrees. 41 | * 42 | * @return the relative rotation 43 | */ 44 | public Rotation rotateCounterClockwise() { 45 | return rotations[(this.ordinal() - 1) & 0x3]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/SkullType.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | /** 4 | * Represents the different types of skulls. 5 | */ 6 | public enum SkullType { 7 | SKELETON, 8 | WITHER, 9 | ZOMBIE, 10 | PLAYER, 11 | CREEPER; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/UnsafeValues.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | import java.util.List; 4 | 5 | import org.bukkit.inventory.ItemStack; 6 | 7 | /** 8 | * This interface provides value conversions that may be specific to a 9 | * runtime, or have arbitrary meaning (read: magic values). 10 | *

11 | * Their existence and behavior is not guaranteed across future versions. They 12 | * may be poorly named, throw exceptions, have misleading parameters, or any 13 | * other bad programming practice. 14 | *

15 | * This interface is unsupported and only for internal use. 16 | * 17 | * @deprecated Unsupported & internal use only 18 | */ 19 | @Deprecated 20 | public interface UnsafeValues { 21 | 22 | Material getMaterialFromInternalName(String name); 23 | 24 | List tabCompleteInternalMaterialName(String token, List completions); 25 | 26 | ItemStack modifyItemStack(ItemStack stack, String arguments); 27 | 28 | Statistic getStatisticFromInternalName(String name); 29 | 30 | Achievement getAchievementFromInternalName(String name); 31 | 32 | List tabCompleteInternalStatisticOrAchievementName(String token, List completions); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/Utility.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * This annotation indicates a method (and sometimes constructor) will chain 10 | * its internal operations. 11 | *

12 | * This is solely meant for identifying methods that don't need to be 13 | * overridden / handled manually. 14 | */ 15 | @Target({ElementType.CONSTRUCTOR, ElementType.METHOD}) 16 | @Retention(RetentionPolicy.SOURCE) 17 | public @interface Utility { 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/WeatherType.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | /** 4 | * An enum of all current weather types 5 | */ 6 | public enum WeatherType { 7 | 8 | /** 9 | * Raining or snowing depending on biome. 10 | */ 11 | DOWNFALL, 12 | /** 13 | * Clear weather, clouds but no rain. 14 | */ 15 | CLEAR, 16 | ; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/WorldType.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | import com.google.common.collect.Maps; 4 | import java.util.Map; 5 | 6 | /** 7 | * Represents various types of worlds that may exist 8 | */ 9 | public enum WorldType { 10 | NORMAL("DEFAULT"), 11 | FLAT("FLAT"), 12 | VERSION_1_1("DEFAULT_1_1"), 13 | LARGE_BIOMES("LARGEBIOMES"), 14 | AMPLIFIED("AMPLIFIED"); 15 | 16 | private final static Map BY_NAME = Maps.newHashMap(); 17 | private final String name; 18 | 19 | private WorldType(String name) { 20 | this.name = name; 21 | } 22 | 23 | /** 24 | * Gets the name of this WorldType 25 | * 26 | * @return Name of this type 27 | */ 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | /** 33 | * Gets a Worldtype by its name 34 | * 35 | * @param name Name of the WorldType to get 36 | * @return Requested WorldType, or null if not found 37 | */ 38 | public static WorldType getByName(String name) { 39 | return BY_NAME.get(name.toUpperCase()); 40 | } 41 | 42 | static { 43 | for (WorldType type : values()) { 44 | BY_NAME.put(type.name, type); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/block/Beacon.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.block; 2 | 3 | import org.bukkit.inventory.InventoryHolder; 4 | 5 | /** 6 | * Represents a beacon. 7 | */ 8 | public interface Beacon extends BlockState, InventoryHolder { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/block/BrewingStand.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.block; 2 | 3 | import org.bukkit.inventory.BrewerInventory; 4 | 5 | /** 6 | * Represents a brewing stand. 7 | */ 8 | public interface BrewingStand extends BlockState, ContainerBlock { 9 | 10 | /** 11 | * How much time is left in the brewing cycle 12 | * 13 | * @return Brew Time 14 | */ 15 | int getBrewingTime(); 16 | 17 | /** 18 | * Set the time left before brewing completes. 19 | * 20 | * @param brewTime Brewing time 21 | */ 22 | void setBrewingTime(int brewTime); 23 | 24 | public BrewerInventory getInventory(); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/block/Chest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.block; 2 | 3 | import org.bukkit.inventory.Inventory; 4 | 5 | /** 6 | * Represents a chest. 7 | */ 8 | public interface Chest extends BlockState, ContainerBlock { 9 | 10 | /** 11 | * Returns the chest's inventory. If this is a double chest, it returns 12 | * just the portion of the inventory linked to this half of the chest. 13 | * 14 | * @return The inventory. 15 | */ 16 | Inventory getBlockInventory(); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/block/ContainerBlock.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.block; 2 | 3 | import org.bukkit.inventory.InventoryHolder; 4 | 5 | /** 6 | * Indicates a block type that has inventory. 7 | * 8 | * @deprecated in favour of {@link InventoryHolder} 9 | */ 10 | @Deprecated 11 | public interface ContainerBlock extends InventoryHolder {} 12 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/block/Dispenser.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.block; 2 | 3 | import org.bukkit.projectiles.BlockProjectileSource; 4 | 5 | /** 6 | * Represents a dispenser. 7 | */ 8 | public interface Dispenser extends BlockState, ContainerBlock { 9 | 10 | /** 11 | * Gets the BlockProjectileSource object for this dispenser. 12 | *

13 | * If the block is no longer a dispenser, this will return null. 14 | * 15 | * @return a BlockProjectileSource if valid, otherwise null 16 | */ 17 | public BlockProjectileSource getBlockProjectileSource(); 18 | 19 | /** 20 | * Attempts to dispense the contents of this block. 21 | *

22 | * If the block is no longer a dispenser, this will return false. 23 | * 24 | * @return true if successful, otherwise false 25 | */ 26 | public boolean dispense(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/block/Dropper.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.block; 2 | 3 | import org.bukkit.inventory.InventoryHolder; 4 | 5 | /** 6 | * Represents a dropper. 7 | */ 8 | public interface Dropper extends BlockState, InventoryHolder { 9 | /** 10 | * Tries to drop a randomly selected item from the Dropper's inventory, 11 | * following the normal behavior of a Dropper. 12 | *

13 | * Normal behavior of a Dropper is as follows: 14 | *

15 | * If the block that the Dropper is facing is an InventoryHolder or 16 | * ContainerBlock the randomly selected ItemStack is placed within that 17 | * Inventory in the first slot that's available, starting with 0 and 18 | * counting up. If the inventory is full, nothing happens. 19 | *

20 | * If the block that the Dropper is facing is not an InventoryHolder or 21 | * ContainerBlock, the randomly selected ItemStack is dropped on 22 | * the ground in the form of an {@link org.bukkit.entity.Item Item}. 23 | */ 24 | public void drop(); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/block/Furnace.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.block; 2 | 3 | import org.bukkit.inventory.FurnaceInventory; 4 | 5 | /** 6 | * Represents a furnace. 7 | */ 8 | public interface Furnace extends BlockState, ContainerBlock { 9 | 10 | /** 11 | * Get burn time. 12 | * 13 | * @return Burn time 14 | */ 15 | public short getBurnTime(); 16 | 17 | /** 18 | * Set burn time. 19 | * 20 | * @param burnTime Burn time 21 | */ 22 | public void setBurnTime(short burnTime); 23 | 24 | /** 25 | * Get cook time. 26 | * 27 | * @return Cook time 28 | */ 29 | public short getCookTime(); 30 | 31 | /** 32 | * Set cook time. 33 | * 34 | * @param cookTime Cook time 35 | */ 36 | public void setCookTime(short cookTime); 37 | 38 | public FurnaceInventory getInventory(); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/block/Hopper.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.block; 2 | 3 | import org.bukkit.inventory.InventoryHolder; 4 | 5 | /** 6 | * Represents a hopper. 7 | */ 8 | public interface Hopper extends BlockState, InventoryHolder { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/block/Jukebox.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.block; 2 | 3 | import org.bukkit.Material; 4 | 5 | /** 6 | * Represents a Jukebox 7 | */ 8 | public interface Jukebox extends BlockState { 9 | /** 10 | * Get the record currently playing 11 | * 12 | * @return The record Material, or AIR if none is playing 13 | */ 14 | public Material getPlaying(); 15 | 16 | /** 17 | * Set the record currently playing 18 | * 19 | * @param record The record Material, or null/AIR to stop playing 20 | */ 21 | public void setPlaying(Material record); 22 | 23 | /** 24 | * Check if the jukebox is currently playing a record 25 | * 26 | * @return True if there is a record playing 27 | */ 28 | public boolean isPlaying(); 29 | 30 | /** 31 | * Stop the jukebox playing and eject the current record 32 | * 33 | * @return True if a record was ejected; false if there was none playing 34 | */ 35 | public boolean eject(); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/command/BlockCommandSender.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.command; 2 | 3 | import org.bukkit.block.Block; 4 | 5 | public interface BlockCommandSender extends CommandSender { 6 | 7 | /** 8 | * Returns the block this command sender belongs to 9 | * 10 | * @return Block for the command sender 11 | */ 12 | public Block getBlock(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/command/CommandException.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.command; 2 | 3 | /** 4 | * Thrown when an unhandled exception occurs during the execution of a Command 5 | */ 6 | @SuppressWarnings("serial") 7 | public class CommandException extends RuntimeException { 8 | 9 | /** 10 | * Creates a new instance of CommandException without detail 11 | * message. 12 | */ 13 | public CommandException() {} 14 | 15 | /** 16 | * Constructs an instance of CommandException with the 17 | * specified detail message. 18 | * 19 | * @param msg the detail message. 20 | */ 21 | public CommandException(String msg) { 22 | super(msg); 23 | } 24 | 25 | public CommandException(String msg, Throwable cause) { 26 | super(msg, cause); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/command/CommandExecutor.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.command; 2 | 3 | /** 4 | * Represents a class which contains a single method for executing commands 5 | */ 6 | public interface CommandExecutor { 7 | 8 | /** 9 | * Executes the given command, returning its success 10 | * 11 | * @param sender Source of the command 12 | * @param command Command which was executed 13 | * @param label Alias of the command which was used 14 | * @param args Passed command arguments 15 | * @return true if a valid command, otherwise false 16 | */ 17 | public boolean onCommand(CommandSender sender, Command command, String label, String[] args); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/command/CommandSender.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.command; 2 | 3 | import org.bukkit.Server; 4 | import org.bukkit.permissions.Permissible; 5 | 6 | public interface CommandSender extends Permissible { 7 | 8 | /** 9 | * Sends this sender a message 10 | * 11 | * @param message Message to be displayed 12 | */ 13 | public void sendMessage(String message); 14 | 15 | /** 16 | * Sends this sender multiple messages 17 | * 18 | * @param messages An array of messages to be displayed 19 | */ 20 | public void sendMessage(String[] messages); 21 | 22 | /** 23 | * Returns the server instance that this command is running on 24 | * 25 | * @return Server instance 26 | */ 27 | public Server getServer(); 28 | 29 | /** 30 | * Gets the name of this command sender 31 | * 32 | * @return Name of the sender 33 | */ 34 | public String getName(); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/command/ConsoleCommandSender.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.command; 2 | 3 | import org.bukkit.conversations.Conversable; 4 | 5 | public interface ConsoleCommandSender extends CommandSender, Conversable { 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/command/MultipleCommandAlias.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.command; 2 | 3 | /** 4 | * Represents a command that delegates to one or more other commands 5 | */ 6 | public class MultipleCommandAlias extends Command { 7 | private Command[] commands; 8 | 9 | public MultipleCommandAlias(String name, Command[] commands) { 10 | super(name); 11 | this.commands = commands; 12 | } 13 | 14 | /** 15 | * Gets the commands associated with the multi-command alias. 16 | * 17 | * @return commands associated with alias 18 | */ 19 | public Command[] getCommands() { 20 | return commands; 21 | } 22 | 23 | @Override 24 | public boolean execute(CommandSender sender, String commandLabel, String[] args) { 25 | boolean result = false; 26 | 27 | for (Command command : commands) { 28 | result |= command.execute(sender, commandLabel, args); 29 | } 30 | 31 | return result; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/command/PluginIdentifiableCommand.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.command; 2 | 3 | import org.bukkit.plugin.Plugin; 4 | 5 | /** 6 | * This interface is used by the help system to group commands into 7 | * sub-indexes based on the {@link Plugin} they are a part of. Custom command 8 | * implementations will need to implement this interface to have a sub-index 9 | * automatically generated on the plugin's behalf. 10 | */ 11 | public interface PluginIdentifiableCommand { 12 | 13 | /** 14 | * Gets the owner of this PluginIdentifiableCommand. 15 | * 16 | * @return Plugin that owns this PluginIdentifiableCommand. 17 | */ 18 | public Plugin getPlugin(); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.command; 2 | 3 | public interface RemoteConsoleCommandSender extends CommandSender { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/command/TabCommandExecutor.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.command; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Represents a class which can handle command tab completion and commands 7 | * 8 | * @deprecated Remains for plugins that would have implemented it even without 9 | * functionality 10 | * @see TabExecutor 11 | */ 12 | @Deprecated 13 | public interface TabCommandExecutor extends CommandExecutor { 14 | public List onTabComplete(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/command/TabCompleter.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.command; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Represents a class which can suggest tab completions for commands. 7 | */ 8 | public interface TabCompleter { 9 | 10 | /** 11 | * Requests a list of possible completions for a command argument. 12 | * 13 | * @param sender Source of the command 14 | * @param command Command which was executed 15 | * @param alias The alias used 16 | * @param args The arguments passed to the command, including final 17 | * partial argument to be completed and command label 18 | * @return A List of possible completions for the final argument, or null 19 | * to default to the command executor 20 | */ 21 | public List onTabComplete(CommandSender sender, Command command, String alias, String[] args); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/command/TabExecutor.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.command; 2 | 3 | /** 4 | * This class is provided as a convenience to implement both TabCompleter and 5 | * CommandExecutor. 6 | */ 7 | public interface TabExecutor extends TabCompleter, CommandExecutor { 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/command/defaults/BukkitCommand.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.command.defaults; 2 | 3 | import java.util.List; 4 | 5 | import org.bukkit.command.Command; 6 | 7 | public abstract class BukkitCommand extends Command { 8 | protected BukkitCommand(String name) { 9 | super(name); 10 | } 11 | 12 | protected BukkitCommand(String name, String description, String usageMessage, List aliases) { 13 | super(name, description, usageMessage, aliases); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/command/defaults/MeCommand.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.command.defaults; 2 | 3 | import org.bukkit.Bukkit; 4 | import org.bukkit.ChatColor; 5 | import org.bukkit.command.CommandSender; 6 | 7 | public class MeCommand extends VanillaCommand { 8 | public MeCommand() { 9 | super("me"); 10 | this.description = "Performs the specified action in chat"; 11 | this.usageMessage = "/me "; 12 | this.setPermission("bukkit.command.me"); 13 | } 14 | 15 | @Override 16 | public boolean execute(CommandSender sender, String currentAlias, String[] args) { 17 | if (!testPermission(sender)) return true; 18 | if (args.length < 1) { 19 | sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage); 20 | return false; 21 | } 22 | 23 | StringBuilder message = new StringBuilder(); 24 | message.append(sender.getName()); 25 | 26 | for (String arg : args) { 27 | message.append(" "); 28 | message.append(arg); 29 | } 30 | 31 | Bukkit.broadcastMessage("* " + message.toString()); 32 | 33 | return true; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/command/defaults/ReloadCommand.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.command.defaults; 2 | 3 | import java.util.Arrays; 4 | 5 | import org.bukkit.Bukkit; 6 | import org.bukkit.ChatColor; 7 | import org.bukkit.command.Command; 8 | import org.bukkit.command.CommandSender; 9 | 10 | public class ReloadCommand extends BukkitCommand { 11 | public ReloadCommand(String name) { 12 | super(name); 13 | this.description = "Reloads the server configuration and plugins"; 14 | this.usageMessage = "/reload"; 15 | this.setPermission("bukkit.command.reload"); 16 | this.setAliases(Arrays.asList("rl")); 17 | } 18 | 19 | @Override 20 | public boolean execute(CommandSender sender, String currentAlias, String[] args) { 21 | if (!testPermission(sender)) return true; 22 | 23 | Bukkit.reload(); 24 | Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Reload complete."); 25 | 26 | return true; 27 | } 28 | 29 | // Spigot Start 30 | @Override 31 | public java.util.List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException 32 | { 33 | return java.util.Collections.emptyList(); 34 | } 35 | // Spigot End 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/configuration/MemoryConfigurationOptions.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.configuration; 2 | 3 | /** 4 | * Various settings for controlling the input and output of a {@link 5 | * MemoryConfiguration} 6 | */ 7 | public class MemoryConfigurationOptions extends ConfigurationOptions { 8 | protected MemoryConfigurationOptions(MemoryConfiguration configuration) { 9 | super(configuration); 10 | } 11 | 12 | @Override 13 | public MemoryConfiguration configuration() { 14 | return (MemoryConfiguration) super.configuration(); 15 | } 16 | 17 | @Override 18 | public MemoryConfigurationOptions copyDefaults(boolean value) { 19 | super.copyDefaults(value); 20 | return this; 21 | } 22 | 23 | @Override 24 | public MemoryConfigurationOptions pathSeparator(char value) { 25 | super.pathSeparator(value); 26 | return this; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/configuration/serialization/DelegateDeserialization.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.configuration.serialization; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Applies to a {@link ConfigurationSerializable} that will delegate all 10 | * deserialization to another {@link ConfigurationSerializable}. 11 | */ 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Target(ElementType.TYPE) 14 | public @interface DelegateDeserialization { 15 | /** 16 | * Which class should be used as a delegate for this classes 17 | * deserialization 18 | * 19 | * @return Delegate class 20 | */ 21 | public Class value(); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/conversations/ConversationAbandonedListener.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.conversations; 2 | 3 | import java.util.EventListener; 4 | 5 | /** 6 | */ 7 | public interface ConversationAbandonedListener extends EventListener { 8 | /** 9 | * Called whenever a {@link Conversation} is abandoned. 10 | * 11 | * @param abandonedEvent Contains details about the abandoned 12 | * conversation. 13 | */ 14 | public void conversationAbandoned(ConversationAbandonedEvent abandonedEvent); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/conversations/ConversationCanceller.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.conversations; 2 | 3 | /** 4 | * A ConversationCanceller is a class that cancels an active {@link 5 | * Conversation}. A Conversation can have more than one ConversationCanceller. 6 | */ 7 | public interface ConversationCanceller extends Cloneable { 8 | 9 | /** 10 | * Sets the conversation this ConversationCanceller can optionally cancel. 11 | * 12 | * @param conversation A conversation. 13 | */ 14 | public void setConversation(Conversation conversation); 15 | 16 | /** 17 | * Cancels a conversation based on user input. 18 | * 19 | * @param context Context information about the conversation. 20 | * @param input The input text from the user. 21 | * @return True to cancel the conversation, False otherwise. 22 | */ 23 | public boolean cancelBasedOnInput(ConversationContext context, String input); 24 | 25 | /** 26 | * Allows the {@link ConversationFactory} to duplicate this 27 | * ConversationCanceller when creating a new {@link Conversation}. 28 | *

29 | * Implementing this method should reset any internal object state. 30 | * 31 | * @return A clone. 32 | */ 33 | public ConversationCanceller clone(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/conversations/ConversationPrefix.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.conversations; 2 | 3 | import org.bukkit.command.CommandSender; 4 | 5 | /** 6 | * A ConversationPrefix implementation prepends all output from the 7 | * conversation to the player. The ConversationPrefix can be used to display 8 | * the plugin name or conversation status as the conversation evolves. 9 | */ 10 | public interface ConversationPrefix { 11 | 12 | /** 13 | * Gets the prefix to use before each message to the player. 14 | * 15 | * @param context Context information about the conversation. 16 | * @return The prefix text. 17 | */ 18 | String getPrefix(ConversationContext context); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/conversations/ExactMatchConversationCanceller.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.conversations; 2 | 3 | /** 4 | * An ExactMatchConversationCanceller cancels a conversation if the user 5 | * enters an exact input string 6 | */ 7 | public class ExactMatchConversationCanceller implements ConversationCanceller { 8 | private String escapeSequence; 9 | 10 | /** 11 | * Builds an ExactMatchConversationCanceller. 12 | * 13 | * @param escapeSequence The string that, if entered by the user, will 14 | * cancel the conversation. 15 | */ 16 | public ExactMatchConversationCanceller(String escapeSequence) { 17 | this.escapeSequence = escapeSequence; 18 | } 19 | 20 | public void setConversation(Conversation conversation) {} 21 | 22 | public boolean cancelBasedOnInput(ConversationContext context, String input) { 23 | return input.equals(escapeSequence); 24 | } 25 | 26 | public ConversationCanceller clone() { 27 | return new ExactMatchConversationCanceller(escapeSequence); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/conversations/ManuallyAbandonedConversationCanceller.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.conversations; 2 | 3 | /** 4 | * The ManuallyAbandonedConversationCanceller is only used as part of a {@link 5 | * ConversationAbandonedEvent} to indicate that the conversation was manually 6 | * abandoned by programmatically calling the abandon() method on it. 7 | */ 8 | public class ManuallyAbandonedConversationCanceller implements ConversationCanceller{ 9 | public void setConversation(Conversation conversation) { 10 | throw new UnsupportedOperationException(); 11 | } 12 | 13 | public boolean cancelBasedOnInput(ConversationContext context, String input) { 14 | throw new UnsupportedOperationException(); 15 | } 16 | 17 | public ConversationCanceller clone() { 18 | throw new UnsupportedOperationException(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/conversations/NullConversationPrefix.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.conversations; 2 | 3 | import org.bukkit.command.CommandSender; 4 | 5 | /** 6 | * NullConversationPrefix is a {@link ConversationPrefix} implementation that 7 | * displays nothing in front of conversation output. 8 | */ 9 | public class NullConversationPrefix implements ConversationPrefix{ 10 | 11 | /** 12 | * Prepends each conversation message with an empty string. 13 | * 14 | * @param context Context information about the conversation. 15 | * @return An empty string. 16 | */ 17 | public String getPrefix(ConversationContext context) { 18 | return ""; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/conversations/RegexPrompt.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.conversations; 2 | 3 | import java.util.regex.Pattern; 4 | 5 | /** 6 | * RegexPrompt is the base class for any prompt that requires an input 7 | * validated by a regular expression. 8 | */ 9 | public abstract class RegexPrompt extends ValidatingPrompt { 10 | 11 | private Pattern pattern; 12 | 13 | public RegexPrompt(String regex) { 14 | this(Pattern.compile(regex)); 15 | } 16 | 17 | public RegexPrompt(Pattern pattern) { 18 | super(); 19 | this.pattern = pattern; 20 | } 21 | 22 | private RegexPrompt() {} 23 | 24 | @Override 25 | protected boolean isInputValid(ConversationContext context, String input) { 26 | return pattern.matcher(input).matches(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/conversations/StringPrompt.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.conversations; 2 | 3 | /** 4 | * StringPrompt is the base class for any prompt that accepts an arbitrary 5 | * string from the user. 6 | */ 7 | public abstract class StringPrompt implements Prompt{ 8 | 9 | /** 10 | * Ensures that the prompt waits for the user to provide input. 11 | * 12 | * @param context Context information about the conversation. 13 | * @return True. 14 | */ 15 | public boolean blocksForInput(ConversationContext context) { 16 | return true; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Ambient.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents an ambient mob 5 | */ 6 | public interface Ambient extends LivingEntity {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/AnimalTamer.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | import java.util.UUID; 4 | 5 | public interface AnimalTamer { 6 | 7 | /** 8 | * This is the name of the specified AnimalTamer. 9 | * 10 | * @return The name to reference on tamed animals or null if a name cannot be obtained 11 | */ 12 | public String getName(); 13 | 14 | /** 15 | * This is the UUID of the specified AnimalTamer. 16 | * 17 | * @return The UUID to reference on tamed animals 18 | */ 19 | public UUID getUniqueId(); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Animals.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents an Animal. 5 | */ 6 | public interface Animals extends Ageable {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Bat.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Bat 5 | */ 6 | public interface Bat extends Ambient { 7 | 8 | /** 9 | * Checks the current waking state of this bat. 10 | *

11 | * This does not imply any persistence of state past the method call. 12 | * 13 | * @return true if the bat is awake or false if it is currently hanging 14 | * from a block 15 | */ 16 | boolean isAwake(); 17 | 18 | /** 19 | * This method modifies the current waking state of this bat. 20 | *

21 | * This does not prevent a bat from spontaneously awaking itself, or from 22 | * reattaching itself to a block. 23 | * 24 | * @param state the new state 25 | */ 26 | void setAwake(boolean state); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Blaze.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Blaze monster 5 | */ 6 | public interface Blaze extends Monster { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/CaveSpider.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Spider. 5 | */ 6 | public interface CaveSpider extends Spider {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Chicken.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Chicken. 5 | */ 6 | public interface Chicken extends Animals {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/ComplexEntityPart.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a single part of a {@link ComplexLivingEntity} 5 | */ 6 | public interface ComplexEntityPart extends Entity { 7 | 8 | /** 9 | * Gets the parent {@link ComplexLivingEntity} of this part. 10 | * 11 | * @return Parent complex entity 12 | */ 13 | public ComplexLivingEntity getParent(); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/ComplexLivingEntity.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | import java.util.Set; 4 | 5 | /** 6 | * Represents a complex living entity - one that is made up of various smaller 7 | * parts 8 | */ 9 | public interface ComplexLivingEntity extends LivingEntity { 10 | /** 11 | * Gets a list of parts that belong to this complex entity 12 | * 13 | * @return List of parts 14 | */ 15 | public Set getParts(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Cow.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Cow. 5 | */ 6 | public interface Cow extends Animals {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Creature.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Creature. Creatures are non-intelligent monsters or animals 5 | * which have very simple abilities. 6 | */ 7 | public interface Creature extends LivingEntity { 8 | 9 | /** 10 | * Instructs this Creature to set the specified LivingEntity as its 11 | * target. 12 | *

13 | * Hostile creatures may attack their target, and friendly creatures may 14 | * follow their target. 15 | * 16 | * @param target New LivingEntity to target, or null to clear the target 17 | */ 18 | public void setTarget(LivingEntity target); 19 | 20 | /** 21 | * Gets the current target of this Creature 22 | * 23 | * @return Current target of this creature, or null if none exists 24 | */ 25 | public LivingEntity getTarget(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Creeper.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Creeper 5 | */ 6 | public interface Creeper extends Monster { 7 | 8 | /** 9 | * Checks if this Creeper is powered (Electrocuted) 10 | * 11 | * @return true if this creeper is powered 12 | */ 13 | public boolean isPowered(); 14 | 15 | /** 16 | * Sets the Powered status of this Creeper 17 | * 18 | * @param value New Powered status 19 | */ 20 | public void setPowered(boolean value); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Egg.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a thrown egg. 5 | */ 6 | public interface Egg extends Projectile {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/EnderCrystal.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * A crystal that heals nearby EnderDragons 5 | */ 6 | public interface EnderCrystal extends Entity { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/EnderDragon.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents an Ender Dragon 5 | */ 6 | public interface EnderDragon extends ComplexLivingEntity { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/EnderDragonPart.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents an ender dragon part 5 | */ 6 | public interface EnderDragonPart extends ComplexEntityPart, Damageable { 7 | public EnderDragon getParent(); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/EnderPearl.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a thrown Ender Pearl entity 5 | */ 6 | public interface EnderPearl extends Projectile { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/EnderSignal.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents an Ender Signal, which is often created upon throwing an ender 5 | * eye 6 | */ 7 | public interface EnderSignal extends Entity { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Enderman.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | import org.bukkit.material.MaterialData; 4 | 5 | /** 6 | * Represents an Enderman. 7 | */ 8 | public interface Enderman extends Monster { 9 | 10 | /** 11 | * Get the id and data of the block that the Enderman is carrying. 12 | * 13 | * @return MaterialData containing the id and data of the block 14 | */ 15 | public MaterialData getCarriedMaterial(); 16 | 17 | /** 18 | * Set the id and data of the block that the Enderman is carring. 19 | * 20 | * @param material data to set the carried block to 21 | */ 22 | public void setCarriedMaterial(MaterialData material); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/ExperienceOrb.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents an Experience Orb. 5 | */ 6 | public interface ExperienceOrb extends Entity { 7 | 8 | /** 9 | * Gets how much experience is contained within this orb 10 | * 11 | * @return Amount of experience 12 | */ 13 | public int getExperience(); 14 | 15 | /** 16 | * Sets how much experience is contained within this orb 17 | * 18 | * @param value Amount of experience 19 | */ 20 | public void setExperience(int value); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Explosive.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * A representation of an explosive entity 5 | */ 6 | public interface Explosive extends Entity { 7 | 8 | /** 9 | * Set the radius affected by this explosive's explosion 10 | * 11 | * @param yield The explosive yield 12 | */ 13 | public void setYield(float yield); 14 | 15 | /** 16 | * Return the radius or yield of this explosive's explosion 17 | * 18 | * @return the radius of blocks affected 19 | */ 20 | public float getYield(); 21 | 22 | /** 23 | * Set whether or not this explosive's explosion causes fire 24 | * 25 | * @param isIncendiary Whether it should cause fire 26 | */ 27 | public void setIsIncendiary(boolean isIncendiary); 28 | 29 | /** 30 | * Return whether or not this explosive creates a fire when exploding 31 | * 32 | * @return true if the explosive creates fire, false otherwise 33 | */ 34 | public boolean isIncendiary(); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/FallingBlock.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | import org.bukkit.Material; 4 | 5 | /** 6 | * Represents a falling block 7 | */ 8 | public interface FallingBlock extends Entity { 9 | 10 | /** 11 | * Get the Material of the falling block 12 | * 13 | * @return Material of the block 14 | */ 15 | Material getMaterial(); 16 | 17 | /** 18 | * Get the ID of the falling block 19 | * 20 | * @return ID type of the block 21 | * @deprecated Magic value 22 | */ 23 | @Deprecated 24 | int getBlockId(); 25 | 26 | /** 27 | * Get the data for the falling block 28 | * 29 | * @return data of the block 30 | * @deprecated Magic value 31 | */ 32 | @Deprecated 33 | byte getBlockData(); 34 | 35 | /** 36 | * Get if the falling block will break into an item if it cannot be placed 37 | * 38 | * @return true if the block will break into an item when obstructed 39 | */ 40 | boolean getDropItem(); 41 | 42 | /** 43 | * Set if the falling block will break into an item if it cannot be placed 44 | * 45 | * @param drop true to break into an item when obstructed 46 | */ 47 | void setDropItem(boolean drop); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/FallingSand.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a falling block. 5 | * 6 | * @deprecated See {@link FallingBlock} 7 | */ 8 | @Deprecated 9 | public interface FallingSand extends FallingBlock {} 10 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Fireball.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | import org.bukkit.util.Vector; 4 | 5 | /** 6 | * Represents a Fireball. 7 | */ 8 | public interface Fireball extends Projectile, Explosive { 9 | 10 | /** 11 | * Fireballs fly straight and do not take setVelocity(...) well. 12 | * 13 | * @param direction the direction this fireball is flying toward 14 | */ 15 | public void setDirection(Vector direction); 16 | 17 | /** 18 | * Retrieve the direction this fireball is heading toward 19 | * 20 | * @return the direction 21 | */ 22 | public Vector getDirection(); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Firework.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | import org.bukkit.inventory.meta.FireworkMeta; 4 | 5 | public interface Firework extends Entity { 6 | 7 | /** 8 | * Get a copy of the fireworks meta 9 | * 10 | * @return A copy of the current Firework meta 11 | */ 12 | FireworkMeta getFireworkMeta(); 13 | 14 | /** 15 | * Apply the provided meta to the fireworks 16 | * 17 | * @param meta The FireworkMeta to apply 18 | */ 19 | void setFireworkMeta(FireworkMeta meta); 20 | 21 | /** 22 | * Cause this firework to explode at earliest opportunity, as if it has no 23 | * remaining fuse. 24 | */ 25 | void detonate(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Fish.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a fishing hook. 5 | * @deprecated in favor of {@link FishHook} 6 | */ 7 | public interface Fish extends FishHook { 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/FishHook.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a fishing hook. 5 | */ 6 | public interface FishHook extends Projectile { 7 | /** 8 | * Gets the chance of a fish biting. 9 | *

10 | * 0.0 = No Chance.
11 | * 1.0 = Instant catch. 12 | * 13 | * @return chance the bite chance 14 | */ 15 | public double getBiteChance(); 16 | 17 | /** 18 | * Sets the chance of a fish biting. 19 | *

20 | * 0.0 = No Chance.
21 | * 1.0 = Instant catch. 22 | * 23 | * @param chance the bite chance 24 | * @throws IllegalArgumentException if the bite chance is not between 0 25 | * and 1 26 | */ 27 | public void setBiteChance(double chance) throws IllegalArgumentException; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Flying.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Flying Entity. 5 | */ 6 | public interface Flying extends LivingEntity {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Ghast.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Ghast. 5 | */ 6 | public interface Ghast extends Flying {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Giant.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Giant. 5 | */ 6 | public interface Giant extends Monster {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Golem.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * A mechanical creature that may harm enemies. 5 | */ 6 | public interface Golem extends Creature { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Hanging.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | import org.bukkit.block.BlockFace; 4 | import org.bukkit.material.Attachable; 5 | 6 | /** 7 | * Represents a Hanging entity 8 | */ 9 | public interface Hanging extends Entity, Attachable { 10 | 11 | /** 12 | * Sets the direction of the hanging entity, potentially overriding rules 13 | * of placement. Note that if the result is not valid the object would 14 | * normally drop as an item. 15 | * 16 | * @param face The new direction. 17 | * @param force Whether to force it. 18 | * @return False if force was false and there was no block for it to 19 | * attach to in order to face the given direction. 20 | */ 21 | public boolean setFacingDirection(BlockFace face, boolean force); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/IronGolem.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * An iron Golem that protects Villages. 5 | */ 6 | public interface IronGolem extends Golem { 7 | 8 | /** 9 | * Gets whether this iron golem was built by a player. 10 | * 11 | * @return Whether this iron golem was built by a player 12 | */ 13 | public boolean isPlayerCreated(); 14 | 15 | /** 16 | * Sets whether this iron golem was built by a player or not. 17 | * 18 | * @param playerCreated true if you want to set the iron golem as being 19 | * player created, false if you want it to be a natural village golem. 20 | */ 21 | public void setPlayerCreated(boolean playerCreated); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Item.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | import org.bukkit.inventory.ItemStack; 4 | 5 | /** 6 | * Represents an Item. 7 | */ 8 | public interface Item extends Entity { 9 | 10 | /** 11 | * Gets the item stack associated with this item drop. 12 | * 13 | * @return An item stack. 14 | */ 15 | public ItemStack getItemStack(); 16 | 17 | /** 18 | * Sets the item stack associated with this item drop. 19 | * 20 | * @param stack An item stack. 21 | */ 22 | public void setItemStack(ItemStack stack); 23 | 24 | /** 25 | * Gets the delay before this Item is available to be picked up by players 26 | * 27 | * @return Remaining delay 28 | */ 29 | public int getPickupDelay(); 30 | 31 | /** 32 | * Sets the delay before this Item is available to be picked up by players 33 | * 34 | * @param delay New delay 35 | */ 36 | public void setPickupDelay(int delay); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/ItemFrame.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | import org.bukkit.Rotation; 4 | import org.bukkit.inventory.ItemStack; 5 | 6 | /** 7 | * Represents an Item Frame 8 | */ 9 | public interface ItemFrame extends Hanging { 10 | 11 | /** 12 | * Get the item in this frame 13 | * 14 | * @return a defensive copy the item in this item frame 15 | */ 16 | public ItemStack getItem(); 17 | 18 | /** 19 | * Set the item in this frame 20 | * 21 | * @param item the new item 22 | */ 23 | public void setItem(ItemStack item); 24 | 25 | /** 26 | * Get the rotation of the frame's item 27 | * 28 | * @return the direction 29 | */ 30 | public Rotation getRotation(); 31 | 32 | /** 33 | * Set the rotation of the frame's item 34 | * 35 | * @param rotation the new rotation 36 | * @throws IllegalArgumentException if rotation is null 37 | */ 38 | public void setRotation(Rotation rotation) throws IllegalArgumentException; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/LargeFireball.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a large {@link Fireball} 5 | */ 6 | public interface LargeFireball extends Fireball { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/LeashHitch.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Leash Hitch on a fence 5 | */ 6 | public interface LeashHitch extends Hanging { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/LightningStrike.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents an instance of a lightning strike. May or may not do damage. 5 | */ 6 | public interface LightningStrike extends Weather { 7 | 8 | /** 9 | * Returns whether the strike is an effect that does no damage. 10 | * 11 | * @return whether the strike is an effect 12 | */ 13 | public boolean isEffect(); 14 | 15 | 16 | public class Spigot extends Entity.Spigot 17 | { 18 | 19 | /* 20 | * Returns whether the strike is silent. 21 | * 22 | * @return whether the strike is silent. 23 | */ 24 | public boolean isSilent() 25 | { 26 | throw new UnsupportedOperationException( "Not supported yet." ); 27 | } 28 | 29 | } 30 | 31 | Spigot spigot(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/MagmaCube.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a MagmaCube. 5 | */ 6 | public interface MagmaCube extends Slime { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Monster.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Monster. 5 | */ 6 | public interface Monster extends Creature {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/MushroomCow.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a mushroom {@link Cow} 5 | */ 6 | public interface MushroomCow extends Cow { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/NPC.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a non-player character 5 | */ 6 | public interface NPC extends Creature { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Painting.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | import org.bukkit.Art; 4 | import org.bukkit.event.painting.PaintingBreakEvent; 5 | 6 | /** 7 | * Represents a Painting. 8 | */ 9 | public interface Painting extends Hanging { 10 | 11 | /** 12 | * Get the art on this painting 13 | * 14 | * @return The art 15 | */ 16 | public Art getArt(); 17 | 18 | /** 19 | * Set the art on this painting 20 | * 21 | * @param art The new art 22 | * @return False if the new art won't fit at the painting's current 23 | * location 24 | */ 25 | public boolean setArt(Art art); 26 | 27 | /** 28 | * Set the art on this painting 29 | * 30 | * @param art The new art 31 | * @param force If true, force the new art regardless of whether it fits 32 | * at the current location. Note that forcing it where it can't fit 33 | * normally causes it to drop as an item unless you override this by 34 | * catching the {@link PaintingBreakEvent}. 35 | * @return False if force was false and the new art won't fit at the 36 | * painting's current location 37 | */ 38 | public boolean setArt(Art art, boolean force); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Pig.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Pig. 5 | */ 6 | public interface Pig extends Animals, Vehicle { 7 | 8 | /** 9 | * Check if the pig has a saddle. 10 | * 11 | * @return if the pig has been saddled. 12 | */ 13 | public boolean hasSaddle(); 14 | 15 | /** 16 | * Sets if the pig has a saddle or not 17 | * 18 | * @param saddled set if the pig has a saddle or not. 19 | */ 20 | public void setSaddle(boolean saddled); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/PigZombie.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Pig Zombie. 5 | */ 6 | public interface PigZombie extends Zombie { 7 | 8 | /** 9 | * Get the pig zombie's current anger level. 10 | * 11 | * @return The anger level. 12 | */ 13 | int getAnger(); 14 | 15 | /** 16 | * Set the pig zombie's current anger level. 17 | * 18 | * @param level The anger level. Higher levels of anger take longer to 19 | * wear off. 20 | */ 21 | void setAnger(int level); 22 | 23 | /** 24 | * Shorthand; sets to either 0 or the default level. 25 | * 26 | * @param angry Whether the zombie should be angry. 27 | */ 28 | void setAngry(boolean angry); 29 | 30 | /** 31 | * Shorthand; gets whether the zombie is angry. 32 | * 33 | * @return True if the zombie is angry, otherwise false. 34 | */ 35 | boolean isAngry(); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/PoweredMinecart.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * @deprecated This class has been moved into a sub package; {@link 5 | * org.bukkit.entity.minecart.PoweredMinecart} should be used instead. 6 | * @see org.bukkit.entity.minecart.PoweredMinecart 7 | */ 8 | @Deprecated 9 | public interface PoweredMinecart extends org.bukkit.entity.minecart.PoweredMinecart {} 10 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Sheep.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | import org.bukkit.material.Colorable; 4 | 5 | /** 6 | * Represents a Sheep. 7 | */ 8 | public interface Sheep extends Animals, Colorable { 9 | 10 | /** 11 | * @return Whether the sheep is sheared. 12 | */ 13 | public boolean isSheared(); 14 | 15 | /** 16 | * @param flag Whether to shear the sheep 17 | */ 18 | public void setSheared(boolean flag); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Silverfish.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Silverfish. 5 | */ 6 | public interface Silverfish extends Monster {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Slime.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Slime. 5 | */ 6 | public interface Slime extends LivingEntity { 7 | 8 | /** 9 | * @return The size of the slime 10 | */ 11 | public int getSize(); 12 | 13 | /** 14 | * @param sz The new size of the slime. 15 | */ 16 | public void setSize(int sz); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/SmallFireball.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a small {@link Fireball} 5 | */ 6 | public interface SmallFireball extends Fireball { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Snowball.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a snowball. 5 | */ 6 | public interface Snowball extends Projectile {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Snowman.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a snowman entity 5 | */ 6 | public interface Snowman extends Golem { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Spider.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Spider. 5 | */ 6 | public interface Spider extends Monster {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Squid.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Squid. 5 | */ 6 | public interface Squid extends WaterMob {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/StorageMinecart.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * @deprecated This class has been moved into a sub package; {@link 5 | * org.bukkit.entity.minecart.StorageMinecart} should be used instead. 6 | * @see org.bukkit.entity.minecart.StorageMinecart 7 | */ 8 | @Deprecated 9 | public interface StorageMinecart extends org.bukkit.entity.minecart.StorageMinecart {} 10 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/ThrownExpBottle.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a thrown Experience bottle. 5 | */ 6 | public interface ThrownExpBottle extends Projectile { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/ThrownPotion.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | import java.util.Collection; 4 | 5 | import org.bukkit.inventory.ItemStack; 6 | import org.bukkit.potion.PotionEffect; 7 | 8 | /** 9 | * Represents a thrown potion bottle 10 | */ 11 | public interface ThrownPotion extends Projectile { 12 | 13 | /** 14 | * Returns the effects that are applied by this potion. 15 | * 16 | * @return The potion effects 17 | */ 18 | public Collection getEffects(); 19 | 20 | /** 21 | * Returns a copy of the ItemStack for this thrown potion. 22 | *

23 | * Altering this copy will not alter the thrown potion directly. If you 24 | * want to alter the thrown potion, you must use the {@link 25 | * #setItem(ItemStack) setItemStack} method. 26 | * 27 | * @return A copy of the ItemStack for this thrown potion. 28 | */ 29 | public ItemStack getItem(); 30 | 31 | /** 32 | * Set the ItemStack for this thrown potion. 33 | *

34 | * The ItemStack must be a potion, otherwise an exception is thrown. 35 | * 36 | * @param item New ItemStack 37 | */ 38 | public void setItem(ItemStack item); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Vehicle.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | import org.bukkit.util.Vector; 4 | 5 | /** 6 | * Represents a vehicle entity. 7 | */ 8 | public interface Vehicle extends Entity { 9 | 10 | /** 11 | * Gets the vehicle's velocity. 12 | * 13 | * @return velocity vector 14 | */ 15 | public Vector getVelocity(); 16 | 17 | /** 18 | * Sets the vehicle's velocity. 19 | * 20 | * @param vel velocity vector 21 | */ 22 | public void setVelocity(Vector vel); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/WaterMob.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Water Mob 5 | */ 6 | public interface WaterMob extends Creature {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Weather.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Weather related entity, such as a storm 5 | */ 6 | public interface Weather extends Entity {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Witch.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Witch 5 | */ 6 | public interface Witch extends Monster { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Wither.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Wither boss 5 | */ 6 | public interface Wither extends Monster { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/WitherSkull.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a wither skull {@link Fireball}. 5 | */ 6 | public interface WitherSkull extends Fireball { 7 | 8 | /** 9 | * Sets the charged status of the wither skull. 10 | * 11 | * @param charged whether it should be charged 12 | */ 13 | public void setCharged(boolean charged); 14 | 15 | /** 16 | * Gets whether or not the wither skull is charged. 17 | * 18 | * @return whether the wither skull is charged 19 | */ 20 | public boolean isCharged(); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/Zombie.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity; 2 | 3 | /** 4 | * Represents a Zombie. 5 | */ 6 | public interface Zombie extends Monster { 7 | 8 | /** 9 | * Gets whether the zombie is a baby 10 | * 11 | * @return Whether the zombie is a baby 12 | */ 13 | public boolean isBaby(); 14 | 15 | /** 16 | * Sets whether the zombie is a baby 17 | * 18 | * @param flag Whether the zombie is a baby 19 | */ 20 | public void setBaby(boolean flag); 21 | 22 | /** 23 | * Gets whether the zombie is a villager 24 | * 25 | * @return Whether the zombie is a villager 26 | */ 27 | public boolean isVillager(); 28 | 29 | /** 30 | * Sets whether the zombie is a villager 31 | * 32 | * @param flag Whether the zombie is a villager 33 | */ 34 | public void setVillager(boolean flag); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity.minecart; 2 | 3 | import org.bukkit.entity.Minecart; 4 | 5 | /** 6 | * Represents a Minecart with TNT inside it that can explode when triggered. 7 | */ 8 | public interface ExplosiveMinecart extends Minecart { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/minecart/HopperMinecart.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity.minecart; 2 | 3 | import org.bukkit.entity.Minecart; 4 | import org.bukkit.inventory.InventoryHolder; 5 | 6 | /** 7 | * Represents a Minecart with a Hopper inside it 8 | */ 9 | public interface HopperMinecart extends Minecart, InventoryHolder { 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/minecart/PoweredMinecart.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity.minecart; 2 | 3 | import org.bukkit.entity.Minecart; 4 | 5 | /** 6 | * Represents a powered minecart. A powered minecart moves on its own when a 7 | * player deposits {@link org.bukkit.Material#COAL fuel}. 8 | */ 9 | public interface PoweredMinecart extends Minecart { 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/minecart/RideableMinecart.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity.minecart; 2 | 3 | import org.bukkit.entity.Minecart; 4 | 5 | /** 6 | * Represents a minecart that can have certain {@link 7 | * org.bukkit.entity.Entity entities} as passengers. Normal passengers 8 | * include all {@link org.bukkit.entity.LivingEntity living entities} with 9 | * the exception of {@link org.bukkit.entity.IronGolem iron golems}. 10 | * Non-player entities that meet normal passenger criteria automatically 11 | * mount these minecarts when close enough. 12 | */ 13 | public interface RideableMinecart extends Minecart { 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/minecart/SpawnerMinecart.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity.minecart; 2 | 3 | import org.bukkit.entity.Minecart; 4 | 5 | /** 6 | * Represents a Minecart with an {@link org.bukkit.block.CreatureSpawner 7 | * entity spawner} inside it. 8 | */ 9 | public interface SpawnerMinecart extends Minecart { 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/entity/minecart/StorageMinecart.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.entity.minecart; 2 | 3 | import org.bukkit.entity.Minecart; 4 | import org.bukkit.inventory.InventoryHolder; 5 | 6 | /** 7 | * Represents a minecart with a chest. These types of {@link Minecart 8 | * minecarts} have their own inventory that can be accessed using methods 9 | * from the {@link InventoryHolder} interface. 10 | */ 11 | public interface StorageMinecart extends Minecart, InventoryHolder { 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/Cancellable.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event; 2 | 3 | public interface Cancellable { 4 | 5 | /** 6 | * Gets the cancellation state of this event. A cancelled event will not 7 | * be executed in the server, but will still pass to other plugins 8 | * 9 | * @return true if this event is cancelled 10 | */ 11 | public boolean isCancelled(); 12 | 13 | /** 14 | * Sets the cancellation state of this event. A cancelled event will not 15 | * be executed in the server, but will still pass to other plugins. 16 | * 17 | * @param cancel true if you wish to cancel this event 18 | */ 19 | public void setCancelled(boolean cancel); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/EventHandler.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * An annotation to mark methods as being event handler methods 10 | */ 11 | @Target(ElementType.METHOD) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | public @interface EventHandler { 14 | 15 | /** 16 | * Define the priority of the event. 17 | *

18 | * First priority to the last priority executed: 19 | *

    20 | *
  1. LOWEST 21 | *
  2. LOW 22 | *
  3. NORMAL 23 | *
  4. HIGH 24 | *
  5. HIGHEST 25 | *
  6. MONITOR 26 | *
27 | */ 28 | EventPriority priority() default EventPriority.NORMAL; 29 | 30 | /** 31 | * Define if the handler ignores a cancelled event. 32 | *

33 | * If ignoreCancelled is true and the event is cancelled, the method is 34 | * not called. Otherwise, the method is always called. 35 | */ 36 | boolean ignoreCancelled() default false; 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/EventPriority.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event; 2 | 3 | /** 4 | * Represents an event's priority in execution 5 | */ 6 | public enum EventPriority { 7 | 8 | /** 9 | * Event call is of very low importance and should be ran first, to allow 10 | * other plugins to further customise the outcome 11 | */ 12 | LOWEST(0), 13 | /** 14 | * Event call is of low importance 15 | */ 16 | LOW(1), 17 | /** 18 | * Event call is neither important nor unimportant, and may be ran 19 | * normally 20 | */ 21 | NORMAL(2), 22 | /** 23 | * Event call is of high importance 24 | */ 25 | HIGH(3), 26 | /** 27 | * Event call is critical and must have the final say in what happens 28 | * to the event 29 | */ 30 | HIGHEST(4), 31 | /** 32 | * Event is listened to purely for monitoring the outcome of an event. 33 | *

34 | * No modifications to the event should be made under this priority 35 | */ 36 | MONITOR(5); 37 | 38 | private final int slot; 39 | 40 | private EventPriority(int slot) { 41 | this.slot = slot; 42 | } 43 | 44 | public int getSlot() { 45 | return slot; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/Listener.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event; 2 | 3 | /** 4 | * Simple interface for tagging all EventListeners 5 | */ 6 | public interface Listener {} 7 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/block/Action.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.block; 2 | 3 | public enum Action { 4 | 5 | /** 6 | * Left-clicking a block 7 | */ 8 | LEFT_CLICK_BLOCK, 9 | /** 10 | * Right-clicking a block 11 | */ 12 | RIGHT_CLICK_BLOCK, 13 | /** 14 | * Left-clicking the air 15 | */ 16 | LEFT_CLICK_AIR, 17 | /** 18 | * Right-clicking the air 19 | */ 20 | RIGHT_CLICK_AIR, 21 | /** 22 | * Stepping onto or into a block (Ass-pressure) 23 | * 24 | * Examples: 25 | *

31 | */ 32 | PHYSICAL, 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/block/BlockBurnEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.block; 2 | 3 | import org.bukkit.block.Block; 4 | import org.bukkit.event.Cancellable; 5 | import org.bukkit.event.HandlerList; 6 | 7 | /** 8 | * Called when a block is destroyed as a result of being burnt by fire. 9 | *

10 | * If a Block Burn event is cancelled, the block will not be destroyed as a 11 | * result of being burnt by fire. 12 | */ 13 | public class BlockBurnEvent extends BlockEvent implements Cancellable { 14 | private static final HandlerList handlers = new HandlerList(); 15 | private boolean cancelled; 16 | 17 | public BlockBurnEvent(final Block block) { 18 | super(block); 19 | this.cancelled = false; 20 | } 21 | 22 | public boolean isCancelled() { 23 | return cancelled; 24 | } 25 | 26 | public void setCancelled(boolean cancel) { 27 | this.cancelled = cancel; 28 | } 29 | 30 | @Override 31 | public HandlerList getHandlers() { 32 | return handlers; 33 | } 34 | 35 | public static HandlerList getHandlerList() { 36 | return handlers; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/block/BlockEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.block; 2 | 3 | import org.bukkit.block.Block; 4 | import org.bukkit.event.Event; 5 | 6 | /** 7 | * Represents a block related event. 8 | */ 9 | public abstract class BlockEvent extends Event { 10 | protected Block block; 11 | 12 | public BlockEvent(final Block theBlock) { 13 | block = theBlock; 14 | } 15 | 16 | /** 17 | * Gets the block involved in this event. 18 | * 19 | * @return The Block which block is involved in this event 20 | */ 21 | public final Block getBlock() { 22 | return block; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/block/BlockExpEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.block; 2 | 3 | import org.bukkit.block.Block; 4 | import org.bukkit.event.HandlerList; 5 | 6 | /** 7 | * An event that's called when a block yields experience. 8 | */ 9 | public class BlockExpEvent extends BlockEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | private int exp; 12 | 13 | public BlockExpEvent(Block block, int exp) { 14 | super(block); 15 | 16 | this.exp = exp; 17 | } 18 | 19 | /** 20 | * Get the experience dropped by the block after the event has processed 21 | * 22 | * @return The experience to drop 23 | */ 24 | public int getExpToDrop() { 25 | return exp; 26 | } 27 | 28 | /** 29 | * Set the amount of experience dropped by the block after the event has 30 | * processed 31 | * 32 | * @param exp 1 or higher to drop experience, else nothing will drop 33 | */ 34 | public void setExpToDrop(int exp) { 35 | this.exp = exp; 36 | } 37 | 38 | public HandlerList getHandlers() { 39 | return handlers; 40 | } 41 | 42 | public static HandlerList getHandlerList() { 43 | return handlers; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/block/BlockFormEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.block; 2 | 3 | import org.bukkit.block.Block; 4 | import org.bukkit.block.BlockState; 5 | import org.bukkit.event.Cancellable; 6 | import org.bukkit.event.HandlerList; 7 | 8 | /** 9 | * Called when a block is formed or spreads based on world conditions. 10 | *

11 | * Use {@link BlockSpreadEvent} to catch blocks that actually spread and don't 12 | * just "randomly" form. 13 | *

14 | * Examples: 15 | *

19 | *

20 | * If a Block Form event is cancelled, the block will not be formed. 21 | * 22 | * @see BlockSpreadEvent 23 | */ 24 | public class BlockFormEvent extends BlockGrowEvent implements Cancellable { 25 | private static final HandlerList handlers = new HandlerList(); 26 | 27 | public BlockFormEvent(final Block block, final BlockState newState) { 28 | super(block, newState); 29 | } 30 | 31 | @Override 32 | public HandlerList getHandlers() { 33 | return handlers; 34 | } 35 | 36 | public static HandlerList getHandlerList() { 37 | return handlers; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.block; 2 | 3 | import org.bukkit.Location; 4 | import org.bukkit.block.Block; 5 | import org.bukkit.block.BlockFace; 6 | import org.bukkit.event.HandlerList; 7 | 8 | /** 9 | * Called when a piston retracts 10 | */ 11 | public class BlockPistonRetractEvent extends BlockPistonEvent { 12 | private static final HandlerList handlers = new HandlerList(); 13 | public BlockPistonRetractEvent(final Block block, final BlockFace direction) { 14 | super(block, direction); 15 | } 16 | 17 | /** 18 | * Gets the location where the possible moving block might be if the 19 | * retracting piston is sticky. 20 | * 21 | * @return The possible location of the possibly moving block. 22 | */ 23 | public Location getRetractLocation() { 24 | return getBlock().getRelative(getDirection(), 2).getLocation(); 25 | } 26 | 27 | @Override 28 | public HandlerList getHandlers() { 29 | return handlers; 30 | } 31 | 32 | public static HandlerList getHandlerList() { 33 | return handlers; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/block/EntityBlockFormEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.block; 2 | 3 | import org.bukkit.block.Block; 4 | import org.bukkit.block.BlockState; 5 | import org.bukkit.entity.Entity; 6 | 7 | /** 8 | * Called when a block is formed by entities. 9 | *

10 | * Examples: 11 | *

14 | */ 15 | public class EntityBlockFormEvent extends BlockFormEvent { 16 | private final Entity entity; 17 | 18 | public EntityBlockFormEvent(final Entity entity, final Block block, final BlockState blockstate) { 19 | super(block, blockstate); 20 | 21 | this.entity = entity; 22 | } 23 | 24 | /** 25 | * Get the entity that formed the block. 26 | * 27 | * @return Entity involved in event 28 | */ 29 | public Entity getEntity() { 30 | return entity; 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/block/LeavesDecayEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.block; 2 | 3 | import org.bukkit.block.Block; 4 | import org.bukkit.event.Cancellable; 5 | import org.bukkit.event.HandlerList; 6 | 7 | /** 8 | * Called when leaves are decaying naturally. 9 | *

10 | * If a Leaves Decay event is cancelled, the leaves will not decay. 11 | */ 12 | public class LeavesDecayEvent extends BlockEvent implements Cancellable { 13 | private static final HandlerList handlers = new HandlerList(); 14 | private boolean cancel = false; 15 | 16 | public LeavesDecayEvent(final Block block) { 17 | super(block); 18 | } 19 | 20 | public boolean isCancelled() { 21 | return cancel; 22 | } 23 | 24 | public void setCancelled(boolean cancel) { 25 | this.cancel = cancel; 26 | } 27 | 28 | @Override 29 | public HandlerList getHandlers() { 30 | return handlers; 31 | } 32 | 33 | public static HandlerList getHandlerList() { 34 | return handlers; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.entity; 2 | 3 | import org.bukkit.Material; 4 | import org.bukkit.block.Block; 5 | import org.bukkit.entity.Entity; 6 | import org.bukkit.entity.LivingEntity; 7 | 8 | /** 9 | * Called when an {@link Entity} breaks a door 10 | *

11 | * Cancelling the event will cause the event to be delayed 12 | */ 13 | public class EntityBreakDoorEvent extends EntityChangeBlockEvent { 14 | public EntityBreakDoorEvent(final LivingEntity entity, final Block targetBlock) { 15 | super(entity, targetBlock, Material.AIR, (byte) 0); 16 | } 17 | 18 | @Override 19 | public LivingEntity getEntity() { 20 | return (LivingEntity) entity; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/entity/EntityCombustByBlockEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.entity; 2 | 3 | import org.bukkit.block.Block; 4 | import org.bukkit.entity.Entity; 5 | 6 | /** 7 | * Called when a block causes an entity to combust. 8 | */ 9 | public class EntityCombustByBlockEvent extends EntityCombustEvent { 10 | private final Block combuster; 11 | 12 | public EntityCombustByBlockEvent(final Block combuster, final Entity combustee, final int duration) { 13 | super(combustee, duration); 14 | this.combuster = combuster; 15 | } 16 | 17 | /** 18 | * The combuster can be lava or a block that is on fire. 19 | *

20 | * WARNING: block may be null. 21 | * 22 | * @return the Block that set the combustee alight. 23 | */ 24 | public Block getCombuster() { 25 | return combuster; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/entity/EntityCombustByEntityEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.entity; 2 | 3 | import org.bukkit.entity.Entity; 4 | 5 | /** 6 | * Called when an entity causes another entity to combust. 7 | */ 8 | public class EntityCombustByEntityEvent extends EntityCombustEvent { 9 | private final Entity combuster; 10 | 11 | public EntityCombustByEntityEvent(final Entity combuster, final Entity combustee, final int duration) { 12 | super(combustee, duration); 13 | this.combuster = combuster; 14 | } 15 | 16 | /** 17 | * Get the entity that caused the combustion event. 18 | * 19 | * @return the Entity that set the combustee alight. 20 | */ 21 | public Entity getCombuster() { 22 | return combuster; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/entity/EntityEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.entity; 2 | 3 | import org.bukkit.entity.Entity; 4 | import org.bukkit.entity.EntityType; 5 | import org.bukkit.event.Event; 6 | 7 | /** 8 | * Represents an Entity-related event 9 | */ 10 | public abstract class EntityEvent extends Event { 11 | protected Entity entity; 12 | 13 | public EntityEvent(final Entity what) { 14 | entity = what; 15 | } 16 | 17 | /** 18 | * Returns the Entity involved in this event 19 | * 20 | * @return Entity who is involved in this event 21 | */ 22 | public Entity getEntity() { 23 | return entity; 24 | } 25 | 26 | /** 27 | * Gets the EntityType of the Entity involved in this event. 28 | * 29 | * @return EntityType of the Entity involved in this event 30 | */ 31 | public EntityType getEntityType() { 32 | return entity.getType(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/entity/EntityInteractEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.entity; 2 | 3 | import org.bukkit.block.Block; 4 | import org.bukkit.entity.Entity; 5 | import org.bukkit.event.Cancellable; 6 | import org.bukkit.event.HandlerList; 7 | 8 | /** 9 | * Called when an entity interacts with an object 10 | */ 11 | public class EntityInteractEvent extends EntityEvent implements Cancellable { 12 | private static final HandlerList handlers = new HandlerList(); 13 | protected Block block; 14 | private boolean cancelled; 15 | 16 | public EntityInteractEvent(final Entity entity, final Block block) { 17 | super(entity); 18 | this.block = block; 19 | } 20 | 21 | public boolean isCancelled() { 22 | return cancelled; 23 | } 24 | 25 | public void setCancelled(boolean cancel) { 26 | cancelled = cancel; 27 | } 28 | 29 | /** 30 | * Returns the involved block 31 | * 32 | * @return the block clicked with this item. 33 | */ 34 | public Block getBlock() { 35 | return block; 36 | } 37 | 38 | @Override 39 | public HandlerList getHandlers() { 40 | return handlers; 41 | } 42 | 43 | public static HandlerList getHandlerList() { 44 | return handlers; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.entity; 2 | 3 | import org.bukkit.entity.Entity; 4 | import org.bukkit.Location; 5 | import org.bukkit.event.HandlerList; 6 | 7 | /** 8 | * Called when an entity comes into contact with a portal 9 | */ 10 | public class EntityPortalEnterEvent extends EntityEvent { 11 | private static final HandlerList handlers = new HandlerList(); 12 | private final Location location; 13 | 14 | public EntityPortalEnterEvent(final Entity entity, final Location location) { 15 | super(entity); 16 | this.location = location; 17 | } 18 | 19 | /** 20 | * Gets the portal block the entity is touching 21 | * 22 | * @return The portal block the entity is touching 23 | */ 24 | public Location getLocation() { 25 | return location; 26 | } 27 | 28 | @Override 29 | public HandlerList getHandlers() { 30 | return handlers; 31 | } 32 | 33 | public static HandlerList getHandlerList() { 34 | return handlers; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.entity; 2 | 3 | import org.bukkit.entity.Entity; 4 | import org.bukkit.entity.LivingEntity; 5 | 6 | /** 7 | * Called when an Entity targets a {@link LivingEntity} and can only target 8 | * LivingEntity's. 9 | */ 10 | public class EntityTargetLivingEntityEvent extends EntityTargetEvent{ 11 | public EntityTargetLivingEntityEvent(final Entity entity, final LivingEntity target, final TargetReason reason) { 12 | super(entity, target, reason); 13 | } 14 | 15 | public LivingEntity getTarget() { 16 | return (LivingEntity) super.getTarget(); 17 | } 18 | 19 | /** 20 | * Set the Entity that you want the mob to target. 21 | *

22 | * It is possible to be null, null will cause the entity to be 23 | * target-less. 24 | *

25 | * Must be a LivingEntity, or null. 26 | * 27 | * @param target The entity to target 28 | */ 29 | public void setTarget(Entity target) { 30 | if (target == null || target instanceof LivingEntity) { 31 | super.setTarget(target); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.entity; 2 | 3 | import org.bukkit.Location; 4 | import org.bukkit.entity.Item; 5 | 6 | /** 7 | * Called when an item is spawned into a world 8 | */ 9 | public class ItemSpawnEvent extends EntitySpawnEvent { 10 | public ItemSpawnEvent(final Item spawnee) { 11 | super(spawnee); 12 | } 13 | 14 | @Deprecated 15 | public ItemSpawnEvent(final Item spawnee, final Location loc) { 16 | this(spawnee); 17 | } 18 | 19 | @Override 20 | public Item getEntity() { 21 | return (Item) entity; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.entity; 2 | 3 | import org.bukkit.entity.Projectile; 4 | import org.bukkit.event.HandlerList; 5 | 6 | /** 7 | * Called when a projectile hits an object 8 | */ 9 | public class ProjectileHitEvent extends EntityEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | 12 | public ProjectileHitEvent(final Projectile projectile) { 13 | super(projectile); 14 | } 15 | 16 | @Override 17 | public Projectile getEntity() { 18 | return (Projectile) entity; 19 | } 20 | 21 | @Override 22 | public HandlerList getHandlers() { 23 | return handlers; 24 | } 25 | 26 | public static HandlerList getHandlerList() { 27 | return handlers; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/entity/ProjectileLaunchEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.entity; 2 | 3 | import org.bukkit.entity.Entity; 4 | import org.bukkit.entity.Projectile; 5 | import org.bukkit.event.Cancellable; 6 | import org.bukkit.event.HandlerList; 7 | 8 | /** 9 | * Called when a projectile is launched. 10 | */ 11 | public class ProjectileLaunchEvent extends EntityEvent implements Cancellable { 12 | private static final HandlerList handlers = new HandlerList(); 13 | private boolean cancelled; 14 | 15 | public ProjectileLaunchEvent(Entity what) { 16 | super(what); 17 | } 18 | 19 | public boolean isCancelled() { 20 | return cancelled; 21 | } 22 | 23 | public void setCancelled(boolean cancel) { 24 | cancelled = cancel; 25 | } 26 | 27 | @Override 28 | public Projectile getEntity() { 29 | return (Projectile) entity; 30 | } 31 | 32 | @Override 33 | public HandlerList getHandlers() { 34 | return handlers; 35 | } 36 | 37 | public static HandlerList getHandlerList() { 38 | return handlers; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/entity/SheepRegrowWoolEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.entity; 2 | 3 | import org.bukkit.entity.Sheep; 4 | import org.bukkit.event.Cancellable; 5 | import org.bukkit.event.HandlerList; 6 | 7 | /** 8 | * Called when a sheep regrows its wool 9 | */ 10 | public class SheepRegrowWoolEvent extends EntityEvent implements Cancellable { 11 | private static final HandlerList handlers = new HandlerList(); 12 | private boolean cancel; 13 | 14 | public SheepRegrowWoolEvent(final Sheep sheep) { 15 | super(sheep); 16 | this.cancel = false; 17 | } 18 | 19 | public boolean isCancelled() { 20 | return cancel; 21 | } 22 | 23 | public void setCancelled(boolean cancel) { 24 | this.cancel = cancel; 25 | } 26 | 27 | @Override 28 | public Sheep getEntity() { 29 | return (Sheep) entity; 30 | } 31 | 32 | @Override 33 | public HandlerList getHandlers() { 34 | return handlers; 35 | } 36 | 37 | public static HandlerList getHandlerList() { 38 | return handlers; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.entity; 2 | 3 | import org.bukkit.block.CreatureSpawner; 4 | import org.bukkit.entity.Entity; 5 | 6 | /** 7 | * Called when an entity is spawned into a world by a spawner. 8 | *

9 | * If a Spawner Spawn event is cancelled, the entity will not spawn. 10 | */ 11 | public class SpawnerSpawnEvent extends EntitySpawnEvent { 12 | private final CreatureSpawner spawner; 13 | 14 | public SpawnerSpawnEvent(final Entity spawnee, final CreatureSpawner spawner) { 15 | super(spawnee); 16 | this.spawner = spawner; 17 | } 18 | 19 | public CreatureSpawner getSpawner() { 20 | return spawner; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/hanging/HangingBreakByEntityEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.hanging; 2 | 3 | import org.bukkit.entity.Entity; 4 | import org.bukkit.entity.Hanging; 5 | 6 | /** 7 | * Triggered when a hanging entity is removed by an entity 8 | */ 9 | public class HangingBreakByEntityEvent extends HangingBreakEvent { 10 | private final Entity remover; 11 | 12 | public HangingBreakByEntityEvent(final Hanging hanging, final Entity remover) { 13 | super(hanging, HangingBreakEvent.RemoveCause.ENTITY); 14 | this.remover = remover; 15 | } 16 | 17 | /** 18 | * Gets the entity that removed the hanging entity 19 | * 20 | * @return the entity that removed the hanging entity 21 | */ 22 | public Entity getRemover() { 23 | return remover; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/hanging/HangingEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.hanging; 2 | 3 | import org.bukkit.entity.Hanging; 4 | import org.bukkit.event.Event; 5 | 6 | /** 7 | * Represents a hanging entity-related event. 8 | */ 9 | public abstract class HangingEvent extends Event { 10 | protected Hanging hanging; 11 | 12 | protected HangingEvent(final Hanging painting) { 13 | this.hanging = painting; 14 | } 15 | 16 | /** 17 | * Gets the hanging entity involved in this event. 18 | * 19 | * @return the hanging entity 20 | */ 21 | public Hanging getEntity() { 22 | return hanging; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/inventory/DragType.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.inventory; 2 | 3 | /** 4 | * Represents the effect of a drag that will be applied to an Inventory in an 5 | * InventoryDragEvent. 6 | */ 7 | public enum DragType { 8 | /** 9 | * One item from the cursor is placed in each selected slot. 10 | */ 11 | SINGLE, 12 | /** 13 | * The cursor is split evenly across all selected slots, not to exceed the 14 | * Material's max stack size, with the remainder going to the cursor. 15 | */ 16 | EVEN, 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java: -------------------------------------------------------------------------------- 1 | 2 | package org.bukkit.event.inventory; 3 | 4 | import org.bukkit.entity.HumanEntity; 5 | import org.bukkit.event.HandlerList; 6 | import org.bukkit.inventory.InventoryView; 7 | 8 | /** 9 | * Represents a player related inventory event 10 | */ 11 | public class InventoryCloseEvent extends InventoryEvent { 12 | private static final HandlerList handlers = new HandlerList(); 13 | 14 | public InventoryCloseEvent(InventoryView transaction) { 15 | super(transaction); 16 | } 17 | 18 | /** 19 | * Returns the player involved in this event 20 | * 21 | * @return Player who is involved in this event 22 | */ 23 | public final HumanEntity getPlayer() { 24 | return transaction.getPlayer(); 25 | } 26 | 27 | @Override 28 | public HandlerList getHandlers() { 29 | return handlers; 30 | } 31 | 32 | public static HandlerList getHandlerList() { 33 | return handlers; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/inventory/InventoryCreativeEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.inventory; 2 | 3 | import org.bukkit.event.inventory.InventoryType.SlotType; 4 | import org.bukkit.inventory.InventoryView; 5 | import org.bukkit.inventory.ItemStack; 6 | 7 | /** 8 | * This event is called when a player in creative mode puts down or picks up 9 | * an item in their inventory / hotbar and when they drop items from their 10 | * Inventory while in creative mode. 11 | */ 12 | public class InventoryCreativeEvent extends InventoryClickEvent { 13 | private ItemStack item; 14 | 15 | public InventoryCreativeEvent(InventoryView what, SlotType type, int slot, ItemStack newItem) { 16 | super(what, type, slot, ClickType.CREATIVE, InventoryAction.PLACE_ALL); 17 | this.item = newItem; 18 | } 19 | 20 | public ItemStack getCursor() { 21 | return item; 22 | } 23 | 24 | public void setCursor(ItemStack item) { 25 | this.item = item; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/painting/PaintingBreakByEntityEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.painting; 2 | 3 | import org.bukkit.Warning; 4 | import org.bukkit.entity.Entity; 5 | import org.bukkit.entity.Painting; 6 | 7 | /** 8 | * Triggered when a painting is removed by an entity 9 | * 10 | * @deprecated Use {@link org.bukkit.event.hanging.HangingBreakByEntityEvent} 11 | * instead. 12 | */ 13 | @Deprecated 14 | @Warning(reason="This event has been replaced by HangingBreakByEntityEvent") 15 | public class PaintingBreakByEntityEvent extends PaintingBreakEvent { 16 | private final Entity remover; 17 | 18 | public PaintingBreakByEntityEvent(final Painting painting, final Entity remover) { 19 | super(painting, RemoveCause.ENTITY); 20 | this.remover = remover; 21 | } 22 | 23 | /** 24 | * Gets the entity that removed the painting 25 | * 26 | * @return the entity that removed the painting. 27 | */ 28 | public Entity getRemover() { 29 | return remover; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/painting/PaintingEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.painting; 2 | 3 | import org.bukkit.Warning; 4 | import org.bukkit.entity.Painting; 5 | import org.bukkit.event.Event; 6 | 7 | /** 8 | * Represents a painting-related event. 9 | * 10 | * @deprecated Use {@link org.bukkit.event.hanging.HangingEvent} instead. 11 | */ 12 | @Deprecated 13 | @Warning(reason="This event has been replaced by HangingEvent") 14 | public abstract class PaintingEvent extends Event { 15 | protected Painting painting; 16 | 17 | protected PaintingEvent(final Painting painting) { 18 | this.painting = painting; 19 | } 20 | 21 | /** 22 | * Gets the painting involved in this event. 23 | * 24 | * @return the painting 25 | */ 26 | public Painting getPainting() { 27 | return painting; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerAnimationType.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | /** 4 | * Different types of player animations 5 | */ 6 | public enum PlayerAnimationType { 7 | ARM_SWING 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.block.Block; 4 | import org.bukkit.entity.Player; 5 | import org.bukkit.event.HandlerList; 6 | 7 | /** 8 | * This event is fired when the player is leaving a bed. 9 | */ 10 | public class PlayerBedLeaveEvent extends PlayerEvent { 11 | private static final HandlerList handlers = new HandlerList(); 12 | private final Block bed; 13 | 14 | public PlayerBedLeaveEvent(final Player who, final Block bed) { 15 | super(who); 16 | this.bed = bed; 17 | } 18 | 19 | /** 20 | * Returns the bed block involved in this event. 21 | * 22 | * @return the bed block involved in this event 23 | */ 24 | public Block getBed() { 25 | return bed; 26 | } 27 | 28 | @Override 29 | public HandlerList getHandlers() { 30 | return handlers; 31 | } 32 | 33 | public static HandlerList getHandlerList() { 34 | return handlers; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.Material; 4 | import org.bukkit.block.Block; 5 | import org.bukkit.block.BlockFace; 6 | import org.bukkit.entity.Player; 7 | import org.bukkit.event.HandlerList; 8 | import org.bukkit.inventory.ItemStack; 9 | 10 | /** 11 | * Called when a player empties a bucket 12 | */ 13 | public class PlayerBucketEmptyEvent extends PlayerBucketEvent { 14 | private static final HandlerList handlers = new HandlerList(); 15 | 16 | public PlayerBucketEmptyEvent(final Player who, final Block blockClicked, final BlockFace blockFace, final Material bucket, final ItemStack itemInHand) { 17 | super(who, blockClicked, blockFace, bucket, itemInHand); 18 | } 19 | 20 | @Override 21 | public HandlerList getHandlers() { 22 | return handlers; 23 | } 24 | 25 | public static HandlerList getHandlerList() { 26 | return handlers; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.Material; 4 | import org.bukkit.block.Block; 5 | import org.bukkit.block.BlockFace; 6 | import org.bukkit.entity.Player; 7 | import org.bukkit.event.HandlerList; 8 | import org.bukkit.inventory.ItemStack; 9 | 10 | /** 11 | * Called when a player fills a bucket 12 | */ 13 | public class PlayerBucketFillEvent extends PlayerBucketEvent { 14 | private static final HandlerList handlers = new HandlerList(); 15 | 16 | public PlayerBucketFillEvent(final Player who, final Block blockClicked, final BlockFace blockFace, final Material bucket, final ItemStack itemInHand) { 17 | super(who, blockClicked, blockFace, bucket, itemInHand); 18 | } 19 | 20 | @Override 21 | public HandlerList getHandlers() { 22 | return handlers; 23 | } 24 | 25 | public static HandlerList getHandlerList() { 26 | return handlers; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerChangedWorldEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.World; 4 | import org.bukkit.entity.Player; 5 | import org.bukkit.event.HandlerList; 6 | 7 | /** 8 | * Called when a player switches to another world. 9 | */ 10 | public class PlayerChangedWorldEvent extends PlayerEvent { 11 | private static final HandlerList handlers = new HandlerList(); 12 | private final World from; 13 | 14 | public PlayerChangedWorldEvent(final Player player, final World from) { 15 | super(player); 16 | this.from = from; 17 | } 18 | 19 | /** 20 | * Gets the world the player is switching from. 21 | * 22 | * @return player's previous world 23 | */ 24 | public World getFrom() { 25 | return from; 26 | } 27 | 28 | @Override 29 | public HandlerList getHandlers() { 30 | return handlers; 31 | } 32 | 33 | public static HandlerList getHandlerList() { 34 | return handlers; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerChannelEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.entity.Player; 4 | import org.bukkit.event.HandlerList; 5 | 6 | /** 7 | * This event is called after a player registers or unregisters a new plugin 8 | * channel. 9 | */ 10 | public abstract class PlayerChannelEvent extends PlayerEvent { 11 | private static final HandlerList handlers = new HandlerList(); 12 | private final String channel; 13 | 14 | public PlayerChannelEvent(final Player player, final String channel) { 15 | super(player); 16 | this.channel = channel; 17 | } 18 | 19 | public final String getChannel() { 20 | return channel; 21 | } 22 | 23 | @Override 24 | public HandlerList getHandlers() { 25 | return handlers; 26 | } 27 | 28 | public static HandlerList getHandlerList() { 29 | return handlers; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerDropItemEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.entity.Item; 4 | import org.bukkit.entity.Player; 5 | import org.bukkit.event.Cancellable; 6 | import org.bukkit.event.HandlerList; 7 | 8 | /** 9 | * Thrown when a player drops an item from their inventory 10 | */ 11 | public class PlayerDropItemEvent extends PlayerEvent implements Cancellable { 12 | private static final HandlerList handlers = new HandlerList(); 13 | private final Item drop; 14 | private boolean cancel = false; 15 | 16 | public PlayerDropItemEvent(final Player player, final Item drop) { 17 | super(player); 18 | this.drop = drop; 19 | } 20 | 21 | /** 22 | * Gets the ItemDrop created by the player 23 | * 24 | * @return ItemDrop created by the player 25 | */ 26 | public Item getItemDrop() { 27 | return drop; 28 | } 29 | 30 | public boolean isCancelled() { 31 | return cancel; 32 | } 33 | 34 | public void setCancelled(boolean cancel) { 35 | this.cancel = cancel; 36 | } 37 | 38 | @Override 39 | public HandlerList getHandlers() { 40 | return handlers; 41 | } 42 | 43 | public static HandlerList getHandlerList() { 44 | return handlers; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.entity.Player; 4 | import org.bukkit.event.Event; 5 | 6 | /** 7 | * Represents a player related event 8 | */ 9 | public abstract class PlayerEvent extends Event { 10 | protected Player player; 11 | 12 | public PlayerEvent(final Player who) { 13 | player = who; 14 | } 15 | 16 | PlayerEvent(final Player who, boolean async) { 17 | super(async); 18 | player = who; 19 | 20 | } 21 | 22 | /** 23 | * Returns the player involved in this event 24 | * 25 | * @return Player who is involved in this event 26 | */ 27 | public final Player getPlayer() { 28 | return player; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.entity.Player; 4 | import org.bukkit.event.HandlerList; 5 | 6 | /** 7 | * Called when a players experience changes naturally 8 | */ 9 | public class PlayerExpChangeEvent extends PlayerEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | private int exp; 12 | 13 | public PlayerExpChangeEvent(final Player player, final int expAmount) { 14 | super(player); 15 | exp = expAmount; 16 | } 17 | 18 | /** 19 | * Get the amount of experience the player will receive 20 | * 21 | * @return The amount of experience 22 | */ 23 | public int getAmount() { 24 | return exp; 25 | } 26 | 27 | /** 28 | * Set the amount of experience the player will receive 29 | * 30 | * @param amount The amount of experience to set 31 | */ 32 | public void setAmount(int amount) { 33 | exp = amount; 34 | } 35 | 36 | @Override 37 | public HandlerList getHandlers() { 38 | return handlers; 39 | } 40 | 41 | public static HandlerList getHandlerList() { 42 | return handlers; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerItemBreakEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.entity.Player; 4 | import org.bukkit.event.HandlerList; 5 | import org.bukkit.inventory.ItemStack; 6 | 7 | /** 8 | * Fired when a player's item breaks (such as a shovel or flint and steel). 9 | *

10 | * The item that's breaking will exist in the inventory with a stack size of 11 | * 0. After the event, the item's durability will be reset to 0. 12 | */ 13 | public class PlayerItemBreakEvent extends PlayerEvent { 14 | private static final HandlerList handlers = new HandlerList(); 15 | private final ItemStack brokenItem; 16 | 17 | public PlayerItemBreakEvent(final Player player, final ItemStack brokenItem) { 18 | super(player); 19 | this.brokenItem = brokenItem; 20 | } 21 | 22 | /** 23 | * Gets the item that broke 24 | * 25 | * @return The broken item 26 | */ 27 | public ItemStack getBrokenItem() { 28 | return brokenItem; 29 | } 30 | 31 | @Override 32 | public HandlerList getHandlers() { 33 | return handlers; 34 | } 35 | 36 | public static HandlerList getHandlerList() { 37 | return handlers; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerJoinEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.entity.Player; 4 | import org.bukkit.event.HandlerList; 5 | 6 | /** 7 | * Called when a player joins a server 8 | */ 9 | public class PlayerJoinEvent extends PlayerEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | private String joinMessage; 12 | 13 | public PlayerJoinEvent(final Player playerJoined, final String joinMessage) { 14 | super(playerJoined); 15 | this.joinMessage = joinMessage; 16 | } 17 | 18 | /** 19 | * Gets the join message to send to all online players 20 | * 21 | * @return string join message 22 | */ 23 | public String getJoinMessage() { 24 | return joinMessage; 25 | } 26 | 27 | /** 28 | * Sets the join message to send to all online players 29 | * 30 | * @param joinMessage join message 31 | */ 32 | public void setJoinMessage(String joinMessage) { 33 | this.joinMessage = joinMessage; 34 | } 35 | 36 | @Override 37 | public HandlerList getHandlers() { 38 | return handlers; 39 | } 40 | 41 | public static HandlerList getHandlerList() { 42 | return handlers; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerLevelChangeEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.entity.Player; 4 | import org.bukkit.event.HandlerList; 5 | 6 | /** 7 | * Called when a players level changes 8 | */ 9 | public class PlayerLevelChangeEvent extends PlayerEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | private final int oldLevel; 12 | private final int newLevel; 13 | 14 | public PlayerLevelChangeEvent(final Player player, final int oldLevel, final int newLevel) { 15 | super(player); 16 | this.oldLevel = oldLevel; 17 | this.newLevel = newLevel; 18 | } 19 | 20 | /** 21 | * Gets the old level of the player 22 | * 23 | * @return The old level of the player 24 | */ 25 | public int getOldLevel() { 26 | return oldLevel; 27 | } 28 | 29 | /** 30 | * Gets the new level of the player 31 | * 32 | * @return The new (current) level of the player 33 | */ 34 | public int getNewLevel() { 35 | return newLevel; 36 | } 37 | 38 | @Override 39 | public HandlerList getHandlers() { 40 | return handlers; 41 | } 42 | 43 | public static HandlerList getHandlerList() { 44 | return handlers; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerQuitEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.entity.Player; 4 | import org.bukkit.event.HandlerList; 5 | 6 | /** 7 | * Called when a player leaves a server 8 | */ 9 | public class PlayerQuitEvent extends PlayerEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | private String quitMessage; 12 | 13 | public PlayerQuitEvent(final Player who, final String quitMessage) { 14 | super(who); 15 | this.quitMessage = quitMessage; 16 | } 17 | 18 | /** 19 | * Gets the quit message to send to all online players 20 | * 21 | * @return string quit message 22 | */ 23 | public String getQuitMessage() { 24 | return quitMessage; 25 | } 26 | 27 | /** 28 | * Sets the quit message to send to all online players 29 | * 30 | * @param quitMessage quit message 31 | */ 32 | public void setQuitMessage(String quitMessage) { 33 | this.quitMessage = quitMessage; 34 | } 35 | 36 | @Override 37 | public HandlerList getHandlers() { 38 | return handlers; 39 | } 40 | 41 | public static HandlerList getHandlerList() { 42 | return handlers; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerRegisterChannelEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.entity.Player; 4 | 5 | /** 6 | * This is called immediately after a player registers for a plugin channel. 7 | */ 8 | public class PlayerRegisterChannelEvent extends PlayerChannelEvent { 9 | 10 | public PlayerRegisterChannelEvent(final Player player, final String channel) { 11 | super(player, channel); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerUnleashEntityEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.entity.Entity; 4 | import org.bukkit.entity.Player; 5 | import org.bukkit.event.Cancellable; 6 | import org.bukkit.event.entity.EntityUnleashEvent; 7 | 8 | /** 9 | * Called prior to an entity being unleashed due to a player's action. 10 | */ 11 | public class PlayerUnleashEntityEvent extends EntityUnleashEvent implements Cancellable { 12 | private final Player player; 13 | private boolean cancelled = false; 14 | 15 | public PlayerUnleashEntityEvent(Entity entity, Player player) { 16 | super(entity, UnleashReason.PLAYER_UNLEASH); 17 | this.player = player; 18 | } 19 | 20 | /** 21 | * Returns the player who is unleashing the entity. 22 | * 23 | * @return The player 24 | */ 25 | public Player getPlayer() { 26 | return player; 27 | } 28 | 29 | public boolean isCancelled() { 30 | return cancelled; 31 | } 32 | 33 | public void setCancelled(boolean cancel) { 34 | this.cancelled = cancel; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/player/PlayerUnregisterChannelEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.player; 2 | 3 | import org.bukkit.entity.Player; 4 | 5 | /** 6 | * This is called immediately after a player unregisters for a plugin channel. 7 | */ 8 | public class PlayerUnregisterChannelEvent extends PlayerChannelEvent { 9 | 10 | public PlayerUnregisterChannelEvent(final Player player, final String channel) { 11 | super(player, channel); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/server/MapInitializeEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.server; 2 | 3 | import org.bukkit.event.HandlerList; 4 | import org.bukkit.map.MapView; 5 | 6 | /** 7 | * Called when a map is initialized. 8 | */ 9 | public class MapInitializeEvent extends ServerEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | private final MapView mapView; 12 | 13 | public MapInitializeEvent(final MapView mapView) { 14 | this.mapView = mapView; 15 | } 16 | 17 | /** 18 | * Gets the map initialized in this event. 19 | * 20 | * @return Map for this event 21 | */ 22 | public MapView getMap() { 23 | return mapView; 24 | } 25 | 26 | @Override 27 | public HandlerList getHandlers() { 28 | return handlers; 29 | } 30 | 31 | public static HandlerList getHandlerList() { 32 | return handlers; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/server/PluginDisableEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.server; 2 | 3 | import org.bukkit.event.HandlerList; 4 | import org.bukkit.plugin.Plugin; 5 | 6 | /** 7 | * Called when a plugin is disabled. 8 | */ 9 | public class PluginDisableEvent extends PluginEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | 12 | public PluginDisableEvent(final Plugin plugin) { 13 | super(plugin); 14 | } 15 | 16 | @Override 17 | public HandlerList getHandlers() { 18 | return handlers; 19 | } 20 | 21 | public static HandlerList getHandlerList() { 22 | return handlers; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/server/PluginEnableEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.server; 2 | 3 | import org.bukkit.event.HandlerList; 4 | import org.bukkit.plugin.Plugin; 5 | 6 | /** 7 | * Called when a plugin is enabled. 8 | */ 9 | public class PluginEnableEvent extends PluginEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | 12 | public PluginEnableEvent(final Plugin plugin) { 13 | super(plugin); 14 | } 15 | 16 | @Override 17 | public HandlerList getHandlers() { 18 | return handlers; 19 | } 20 | 21 | public static HandlerList getHandlerList() { 22 | return handlers; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/server/PluginEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.server; 2 | 3 | import org.bukkit.plugin.Plugin; 4 | 5 | /** 6 | * Used for plugin enable and disable events 7 | */ 8 | public abstract class PluginEvent extends ServerEvent { 9 | private final Plugin plugin; 10 | 11 | public PluginEvent(final Plugin plugin) { 12 | this.plugin = plugin; 13 | } 14 | 15 | /** 16 | * Gets the plugin involved in this event 17 | * 18 | * @return Plugin for this event 19 | */ 20 | public Plugin getPlugin() { 21 | return plugin; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/server/RemoteServerCommandEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.server; 2 | 3 | import org.bukkit.command.CommandSender; 4 | import org.bukkit.event.HandlerList; 5 | 6 | /** 7 | * This event is called when a command is recieved over RCON. See the javadocs 8 | * of {@link ServerCommandEvent} for more information. 9 | */ 10 | public class RemoteServerCommandEvent extends ServerCommandEvent { 11 | private static final HandlerList handlers = new HandlerList(); 12 | 13 | public RemoteServerCommandEvent(final CommandSender sender, final String command) { 14 | super(sender, command); 15 | } 16 | 17 | @Override 18 | public HandlerList getHandlers() { 19 | return handlers; 20 | } 21 | 22 | public static HandlerList getHandlerList() { 23 | return handlers; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/server/ServerEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.server; 2 | 3 | import org.bukkit.event.Event; 4 | 5 | /** 6 | * Miscellaneous server events 7 | */ 8 | public abstract class ServerEvent extends Event { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/server/ServiceEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.server; 2 | 3 | import org.bukkit.plugin.RegisteredServiceProvider; 4 | 5 | /** 6 | * An event relating to a registered service. This is called in a {@link 7 | * org.bukkit.plugin.ServicesManager} 8 | */ 9 | public abstract class ServiceEvent extends ServerEvent { 10 | private final RegisteredServiceProvider provider; 11 | 12 | public ServiceEvent(final RegisteredServiceProvider provider) { 13 | this.provider = provider; 14 | } 15 | 16 | public RegisteredServiceProvider getProvider() { 17 | return provider; 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/server/ServiceRegisterEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.server; 2 | 3 | import org.bukkit.event.HandlerList; 4 | import org.bukkit.plugin.RegisteredServiceProvider; 5 | 6 | /** 7 | * This event is called when a service is registered. 8 | *

9 | * Warning: The order in which register and unregister events are called 10 | * should not be relied upon. 11 | */ 12 | public class ServiceRegisterEvent extends ServiceEvent { 13 | private static final HandlerList handlers = new HandlerList(); 14 | 15 | public ServiceRegisterEvent(RegisteredServiceProvider registeredProvider) { 16 | super(registeredProvider); 17 | } 18 | 19 | @Override 20 | public HandlerList getHandlers() { 21 | return handlers; 22 | } 23 | 24 | public static HandlerList getHandlerList() { 25 | return handlers; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/server/ServiceUnregisterEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.server; 2 | 3 | import org.bukkit.event.HandlerList; 4 | import org.bukkit.plugin.RegisteredServiceProvider; 5 | 6 | /** 7 | * This event is called when a service is unregistered. 8 | *

9 | * Warning: The order in which register and unregister events are called 10 | * should not be relied upon. 11 | */ 12 | public class ServiceUnregisterEvent extends ServiceEvent { 13 | private static final HandlerList handlers = new HandlerList(); 14 | 15 | public ServiceUnregisterEvent(RegisteredServiceProvider serviceProvider) { 16 | super(serviceProvider); 17 | } 18 | 19 | @Override 20 | public HandlerList getHandlers() { 21 | return handlers; 22 | } 23 | 24 | public static HandlerList getHandlerList() { 25 | return handlers; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/vehicle/VehicleBlockCollisionEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.vehicle; 2 | 3 | import org.bukkit.block.Block; 4 | import org.bukkit.entity.Vehicle; 5 | import org.bukkit.event.HandlerList; 6 | 7 | /** 8 | * Raised when a vehicle collides with a block. 9 | */ 10 | public class VehicleBlockCollisionEvent extends VehicleCollisionEvent { 11 | private static final HandlerList handlers = new HandlerList(); 12 | private final Block block; 13 | 14 | public VehicleBlockCollisionEvent(final Vehicle vehicle, final Block block) { 15 | super(vehicle); 16 | this.block = block; 17 | } 18 | 19 | /** 20 | * Gets the block the vehicle collided with 21 | * 22 | * @return the block the vehicle collided with 23 | */ 24 | public Block getBlock() { 25 | return block; 26 | } 27 | 28 | @Override 29 | public HandlerList getHandlers() { 30 | return handlers; 31 | } 32 | 33 | public static HandlerList getHandlerList() { 34 | return handlers; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/vehicle/VehicleCollisionEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.vehicle; 2 | 3 | import org.bukkit.entity.Vehicle; 4 | 5 | /** 6 | * Raised when a vehicle collides. 7 | */ 8 | public abstract class VehicleCollisionEvent extends VehicleEvent { 9 | public VehicleCollisionEvent(final Vehicle vehicle) { 10 | super(vehicle); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/vehicle/VehicleCreateEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.vehicle; 2 | 3 | import org.bukkit.entity.Vehicle; 4 | import org.bukkit.event.HandlerList; 5 | 6 | /** 7 | * Raised when a vehicle is created. 8 | */ 9 | public class VehicleCreateEvent extends VehicleEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | 12 | public VehicleCreateEvent(final Vehicle vehicle) { 13 | super(vehicle); 14 | } 15 | 16 | @Override 17 | public HandlerList getHandlers() { 18 | return handlers; 19 | } 20 | 21 | public static HandlerList getHandlerList() { 22 | return handlers; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/vehicle/VehicleEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.vehicle; 2 | 3 | import org.bukkit.entity.Vehicle; 4 | import org.bukkit.event.Event; 5 | 6 | /** 7 | * Represents a vehicle-related event. 8 | */ 9 | public abstract class VehicleEvent extends Event { 10 | protected Vehicle vehicle; 11 | 12 | public VehicleEvent(final Vehicle vehicle) { 13 | this.vehicle = vehicle; 14 | } 15 | 16 | /** 17 | * Get the vehicle. 18 | * 19 | * @return the vehicle 20 | */ 21 | public final Vehicle getVehicle() { 22 | return vehicle; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/vehicle/VehicleMoveEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.vehicle; 2 | 3 | import org.bukkit.Location; 4 | import org.bukkit.entity.Vehicle; 5 | import org.bukkit.event.HandlerList; 6 | 7 | /** 8 | * Raised when a vehicle moves. 9 | */ 10 | public class VehicleMoveEvent extends VehicleEvent { 11 | private static final HandlerList handlers = new HandlerList(); 12 | private final Location from; 13 | private final Location to; 14 | 15 | public VehicleMoveEvent(final Vehicle vehicle, final Location from, final Location to) { 16 | super(vehicle); 17 | 18 | this.from = from; 19 | this.to = to; 20 | } 21 | 22 | /** 23 | * Get the previous position. 24 | * 25 | * @return Old position. 26 | */ 27 | public Location getFrom() { 28 | return from; 29 | } 30 | 31 | /** 32 | * Get the next position. 33 | * 34 | * @return New position. 35 | */ 36 | public Location getTo() { 37 | return to; 38 | } 39 | 40 | 41 | @Override 42 | public HandlerList getHandlers() { 43 | return handlers; 44 | } 45 | 46 | public static HandlerList getHandlerList() { 47 | return handlers; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/vehicle/VehicleUpdateEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.vehicle; 2 | 3 | import org.bukkit.entity.Vehicle; 4 | import org.bukkit.event.HandlerList; 5 | 6 | /** 7 | * Called when a vehicle updates 8 | */ 9 | public class VehicleUpdateEvent extends VehicleEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | 12 | public VehicleUpdateEvent(final Vehicle vehicle) { 13 | super(vehicle); 14 | } 15 | 16 | @Override 17 | public HandlerList getHandlers() { 18 | return handlers; 19 | } 20 | 21 | public static HandlerList getHandlerList() { 22 | return handlers; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/weather/ThunderChangeEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.weather; 2 | 3 | import org.bukkit.World; 4 | import org.bukkit.event.Cancellable; 5 | import org.bukkit.event.HandlerList; 6 | 7 | /** 8 | * Stores data for thunder state changing in a world 9 | */ 10 | public class ThunderChangeEvent extends WeatherEvent implements Cancellable { 11 | private static final HandlerList handlers = new HandlerList(); 12 | private boolean canceled; 13 | private final boolean to; 14 | 15 | public ThunderChangeEvent(final World world, final boolean to) { 16 | super(world); 17 | this.to = to; 18 | } 19 | 20 | public boolean isCancelled() { 21 | return canceled; 22 | } 23 | 24 | public void setCancelled(boolean cancel) { 25 | canceled = cancel; 26 | } 27 | 28 | /** 29 | * Gets the state of thunder that the world is being set to 30 | * 31 | * @return true if the weather is being set to thundering, false otherwise 32 | */ 33 | public boolean toThunderState() { 34 | return to; 35 | } 36 | 37 | @Override 38 | public HandlerList getHandlers() { 39 | return handlers; 40 | } 41 | 42 | public static HandlerList getHandlerList() { 43 | return handlers; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/weather/WeatherChangeEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.weather; 2 | 3 | import org.bukkit.World; 4 | import org.bukkit.event.Cancellable; 5 | import org.bukkit.event.HandlerList; 6 | 7 | /** 8 | * Stores data for weather changing in a world 9 | */ 10 | public class WeatherChangeEvent extends WeatherEvent implements Cancellable { 11 | private static final HandlerList handlers = new HandlerList(); 12 | private boolean canceled; 13 | private final boolean to; 14 | 15 | public WeatherChangeEvent(final World world, final boolean to) { 16 | super(world); 17 | this.to = to; 18 | } 19 | 20 | public boolean isCancelled() { 21 | return canceled; 22 | } 23 | 24 | public void setCancelled(boolean cancel) { 25 | canceled = cancel; 26 | } 27 | 28 | /** 29 | * Gets the state of weather that the world is being set to 30 | * 31 | * @return true if the weather is being set to raining, false otherwise 32 | */ 33 | public boolean toWeatherState() { 34 | return to; 35 | } 36 | 37 | @Override 38 | public HandlerList getHandlers() { 39 | return handlers; 40 | } 41 | 42 | public static HandlerList getHandlerList() { 43 | return handlers; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/weather/WeatherEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.weather; 2 | 3 | import org.bukkit.World; 4 | import org.bukkit.event.Event; 5 | 6 | /** 7 | * Represents a Weather-related event 8 | */ 9 | public abstract class WeatherEvent extends Event { 10 | protected World world; 11 | 12 | public WeatherEvent(final World where) { 13 | world = where; 14 | } 15 | 16 | /** 17 | * Returns the World where this event is occurring 18 | * 19 | * @return World this event is occurring in 20 | */ 21 | public final World getWorld() { 22 | return world; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/world/ChunkEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.world; 2 | 3 | import org.bukkit.Chunk; 4 | 5 | /** 6 | * Represents a Chunk related event 7 | */ 8 | public abstract class ChunkEvent extends WorldEvent { 9 | protected Chunk chunk; 10 | 11 | protected ChunkEvent(final Chunk chunk) { 12 | super(chunk.getWorld()); 13 | this.chunk = chunk; 14 | } 15 | 16 | /** 17 | * Gets the chunk being loaded/unloaded 18 | * 19 | * @return Chunk that triggered this event 20 | */ 21 | public Chunk getChunk() { 22 | return chunk; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/world/ChunkLoadEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.world; 2 | 3 | import org.bukkit.Chunk; 4 | import org.bukkit.event.HandlerList; 5 | 6 | /** 7 | * Called when a chunk is loaded 8 | */ 9 | public class ChunkLoadEvent extends ChunkEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | private final boolean newChunk; 12 | 13 | public ChunkLoadEvent(final Chunk chunk, final boolean newChunk) { 14 | super(chunk); 15 | this.newChunk = newChunk; 16 | } 17 | 18 | /** 19 | * Gets if this chunk was newly created or not. 20 | *

21 | * Note that if this chunk is new, it will not be populated at this time. 22 | * 23 | * @return true if the chunk is new, otherwise false 24 | */ 25 | public boolean isNewChunk() { 26 | return newChunk; 27 | } 28 | 29 | @Override 30 | public HandlerList getHandlers() { 31 | return handlers; 32 | } 33 | 34 | public static HandlerList getHandlerList() { 35 | return handlers; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/world/ChunkPopulateEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.world; 2 | 3 | import org.bukkit.Chunk; 4 | import org.bukkit.event.HandlerList; 5 | import org.bukkit.generator.BlockPopulator; 6 | 7 | /** 8 | * Thrown when a new chunk has finished being populated. 9 | *

10 | * If your intent is to populate the chunk using this event, please see {@link 11 | * BlockPopulator} 12 | */ 13 | public class ChunkPopulateEvent extends ChunkEvent { 14 | private static final HandlerList handlers = new HandlerList(); 15 | 16 | public ChunkPopulateEvent(final Chunk chunk) { 17 | super(chunk); 18 | } 19 | 20 | @Override 21 | public HandlerList getHandlers() { 22 | return handlers; 23 | } 24 | 25 | public static HandlerList getHandlerList() { 26 | return handlers; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.world; 2 | 3 | import org.bukkit.Chunk; 4 | import org.bukkit.event.Cancellable; 5 | import org.bukkit.event.HandlerList; 6 | 7 | /** 8 | * Called when a chunk is unloaded 9 | */ 10 | public class ChunkUnloadEvent extends ChunkEvent implements Cancellable { 11 | private static final HandlerList handlers = new HandlerList(); 12 | private boolean cancel = false; 13 | 14 | public ChunkUnloadEvent(final Chunk chunk) { 15 | super(chunk); 16 | } 17 | 18 | public boolean isCancelled() { 19 | return cancel; 20 | } 21 | 22 | public void setCancelled(boolean cancel) { 23 | this.cancel = cancel; 24 | } 25 | 26 | @Override 27 | public HandlerList getHandlers() { 28 | return handlers; 29 | } 30 | 31 | public static HandlerList getHandlerList() { 32 | return handlers; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/world/SpawnChangeEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.world; 2 | 3 | import org.bukkit.World; 4 | import org.bukkit.Location; 5 | import org.bukkit.event.HandlerList; 6 | 7 | /** 8 | * An event that is called when a world's spawn changes. The world's previous 9 | * spawn location is included. 10 | */ 11 | public class SpawnChangeEvent extends WorldEvent { 12 | private static final HandlerList handlers = new HandlerList(); 13 | private final Location previousLocation; 14 | 15 | public SpawnChangeEvent(final World world, final Location previousLocation) { 16 | super(world); 17 | this.previousLocation = previousLocation; 18 | } 19 | 20 | /** 21 | * Gets the previous spawn location 22 | * 23 | * @return Location that used to be spawn 24 | */ 25 | public Location getPreviousLocation() { 26 | return previousLocation; 27 | } 28 | 29 | @Override 30 | public HandlerList getHandlers() { 31 | return handlers; 32 | } 33 | 34 | public static HandlerList getHandlerList() { 35 | return handlers; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/world/WorldEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.world; 2 | 3 | import org.bukkit.World; 4 | import org.bukkit.event.Event; 5 | 6 | /** 7 | * Represents events within a world 8 | */ 9 | public abstract class WorldEvent extends Event { 10 | private final World world; 11 | 12 | public WorldEvent(final World world) { 13 | this.world = world; 14 | } 15 | 16 | /** 17 | * Gets the world primarily involved with this event 18 | * 19 | * @return World which caused this event 20 | */ 21 | public World getWorld() { 22 | return world; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/world/WorldInitEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.world; 2 | 3 | import org.bukkit.World; 4 | import org.bukkit.event.HandlerList; 5 | 6 | /** 7 | * Called when a World is initializing 8 | */ 9 | public class WorldInitEvent extends WorldEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | 12 | public WorldInitEvent(final World world) { 13 | super(world); 14 | } 15 | 16 | @Override 17 | public HandlerList getHandlers() { 18 | return handlers; 19 | } 20 | 21 | public static HandlerList getHandlerList() { 22 | return handlers; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/world/WorldLoadEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.world; 2 | 3 | import org.bukkit.World; 4 | import org.bukkit.event.HandlerList; 5 | 6 | /** 7 | * Called when a World is loaded 8 | */ 9 | public class WorldLoadEvent extends WorldEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | 12 | public WorldLoadEvent(final World world) { 13 | super(world); 14 | } 15 | 16 | @Override 17 | public HandlerList getHandlers() { 18 | return handlers; 19 | } 20 | 21 | public static HandlerList getHandlerList() { 22 | return handlers; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/world/WorldSaveEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.world; 2 | 3 | import org.bukkit.World; 4 | import org.bukkit.event.HandlerList; 5 | 6 | /** 7 | * Called when a World is saved. 8 | */ 9 | public class WorldSaveEvent extends WorldEvent { 10 | private static final HandlerList handlers = new HandlerList(); 11 | 12 | public WorldSaveEvent(final World world) { 13 | super(world); 14 | } 15 | 16 | @Override 17 | public HandlerList getHandlers() { 18 | return handlers; 19 | } 20 | 21 | public static HandlerList getHandlerList() { 22 | return handlers; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/event/world/WorldUnloadEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event.world; 2 | 3 | import org.bukkit.World; 4 | import org.bukkit.event.Cancellable; 5 | import org.bukkit.event.HandlerList; 6 | 7 | /** 8 | * Called when a World is unloaded 9 | */ 10 | public class WorldUnloadEvent extends WorldEvent implements Cancellable { 11 | private static final HandlerList handlers = new HandlerList(); 12 | private boolean isCancelled; 13 | 14 | public WorldUnloadEvent(final World world) { 15 | super(world); 16 | } 17 | 18 | public boolean isCancelled() { 19 | return this.isCancelled; 20 | } 21 | 22 | public void setCancelled(boolean cancel) { 23 | this.isCancelled = cancel; 24 | } 25 | 26 | @Override 27 | public HandlerList getHandlers() { 28 | return handlers; 29 | } 30 | 31 | public static HandlerList getHandlerList() { 32 | return handlers; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/generator/BlockPopulator.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.generator; 2 | 3 | import java.util.Random; 4 | import org.bukkit.Chunk; 5 | import org.bukkit.World; 6 | 7 | /** 8 | * A block populator is responsible for generating a small area of blocks. 9 | *

10 | * For example, generating glowstone inside the nether or generating dungeons 11 | * full of treasure 12 | */ 13 | public abstract class BlockPopulator { 14 | 15 | /** 16 | * Populates an area of blocks at or around the given chunk. 17 | *

18 | * The chunks on each side of the specified chunk must already exist; that 19 | * is, there must be one north, east, south and west of the specified 20 | * chunk. The "corner" chunks may not exist, in which scenario the 21 | * populator should record any changes required for those chunks and 22 | * perform the changes when they are ready. 23 | * 24 | * @param world The world to generate in 25 | * @param random The random generator to use 26 | * @param source The chunk to generate for 27 | */ 28 | public abstract void populate(World world, Random random, Chunk source); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/AnvilInventory.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory; 2 | 3 | /** 4 | * Interface to the inventory of an Anvil. 5 | */ 6 | public interface AnvilInventory extends Inventory { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/BeaconInventory.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory; 2 | 3 | /** 4 | * Interface to the inventory of a Beacon. 5 | */ 6 | public interface BeaconInventory extends Inventory { 7 | 8 | /** 9 | * Set the item powering the beacon. 10 | * 11 | * @param item The new item 12 | */ 13 | void setItem(ItemStack item); 14 | 15 | /** 16 | * Get the item powering the beacon. 17 | * 18 | * @return The current item. 19 | */ 20 | ItemStack getItem(); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/BrewerInventory.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory; 2 | 3 | import org.bukkit.block.BrewingStand; 4 | 5 | /** 6 | * Interface to the inventory of a Brewing Stand. 7 | */ 8 | public interface BrewerInventory extends Inventory { 9 | 10 | /** 11 | * Get the current ingredient for brewing. 12 | * 13 | * @return The ingredient. 14 | */ 15 | ItemStack getIngredient(); 16 | 17 | /** 18 | * Set the current ingredient for brewing. 19 | * 20 | * @param ingredient The ingredient 21 | */ 22 | void setIngredient(ItemStack ingredient); 23 | 24 | BrewingStand getHolder(); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/DoubleChestInventory.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory; 2 | 3 | import org.bukkit.block.DoubleChest; 4 | 5 | /** 6 | * Interface to the inventory of a Double Chest. 7 | */ 8 | public interface DoubleChestInventory extends Inventory { 9 | 10 | /** 11 | * Get the left half of this double chest. 12 | * 13 | * @return The left side inventory 14 | */ 15 | Inventory getLeftSide(); 16 | 17 | /** 18 | * Get the right side of this double chest. 19 | * 20 | * @return The right side inventory 21 | */ 22 | Inventory getRightSide(); 23 | 24 | DoubleChest getHolder(); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/EnchantingInventory.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory; 2 | 3 | /** 4 | * Interface to the inventory of an Enchantment Table. 5 | */ 6 | public interface EnchantingInventory extends Inventory { 7 | 8 | /** 9 | * Set the item being enchanted. 10 | * 11 | * @param item The new item 12 | */ 13 | void setItem(ItemStack item); 14 | 15 | /** 16 | * Get the item being enchanted. 17 | * 18 | * @return The current item. 19 | */ 20 | ItemStack getItem(); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/FurnaceInventory.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory; 2 | 3 | import org.bukkit.block.Furnace; 4 | 5 | /** 6 | * Interface to the inventory of a Furnace. 7 | */ 8 | public interface FurnaceInventory extends Inventory { 9 | 10 | /** 11 | * Get the current item in the result slot. 12 | * 13 | * @return The item 14 | */ 15 | ItemStack getResult(); 16 | 17 | /** 18 | * Get the current fuel. 19 | * 20 | * @return The item 21 | */ 22 | ItemStack getFuel(); 23 | 24 | /** 25 | * Get the item currently smelting. 26 | * 27 | * @return The item 28 | */ 29 | ItemStack getSmelting(); 30 | 31 | /** 32 | * Set the current fuel. 33 | * 34 | * @param stack The item 35 | */ 36 | void setFuel(ItemStack stack); 37 | 38 | /** 39 | * Set the current item in the result slot. 40 | * 41 | * @param stack The item 42 | */ 43 | void setResult(ItemStack stack); 44 | 45 | /** 46 | * Set the item currently smelting. 47 | * 48 | * @param stack The item 49 | */ 50 | void setSmelting(ItemStack stack); 51 | 52 | Furnace getHolder(); 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/HorseInventory.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory; 2 | 3 | /** 4 | * An interface to the inventory of a Horse. 5 | */ 6 | public interface HorseInventory extends Inventory { 7 | 8 | /** 9 | * Gets the item in the horse's saddle slot. 10 | * 11 | * @return the saddle item 12 | */ 13 | ItemStack getSaddle(); 14 | 15 | /** 16 | * Gets the item in the horse's armor slot. 17 | * 18 | * @return the armor item 19 | */ 20 | ItemStack getArmor(); 21 | 22 | /** 23 | * Sets the item in the horse's saddle slot. 24 | * 25 | * @param stack the new item 26 | */ 27 | void setSaddle(ItemStack stack); 28 | 29 | /** 30 | * Sets the item in the horse's armor slot. 31 | * 32 | * @param stack the new item 33 | */ 34 | void setArmor(ItemStack stack); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/InventoryHolder.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory; 2 | 3 | public interface InventoryHolder { 4 | 5 | /** 6 | * Get the object's inventory. 7 | * 8 | * @return The inventory. 9 | */ 10 | public Inventory getInventory(); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/MerchantInventory.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory; 2 | 3 | public interface MerchantInventory extends Inventory { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/Recipe.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory; 2 | 3 | /** 4 | * Represents some type of crafting recipe. 5 | */ 6 | public interface Recipe { 7 | 8 | /** 9 | * Get the result of this recipe. 10 | * 11 | * @return The result stack 12 | */ 13 | ItemStack getResult(); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/meta/FireworkEffectMeta.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory.meta; 2 | 3 | import org.bukkit.FireworkEffect; 4 | import org.bukkit.Material; 5 | 6 | /** 7 | * Represents a meta that can store a single FireworkEffect. An example 8 | * includes {@link Material#FIREWORK_CHARGE}. 9 | */ 10 | public interface FireworkEffectMeta extends ItemMeta { 11 | 12 | /** 13 | * Sets the firework effect for this meta. 14 | * 15 | * @param effect the effect to set, or null to indicate none. 16 | */ 17 | void setEffect(FireworkEffect effect); 18 | 19 | /** 20 | * Checks if this meta has an effect. 21 | * 22 | * @return true if this meta has an effect, false otherwise 23 | */ 24 | boolean hasEffect(); 25 | 26 | /** 27 | * Gets the firework effect for this meta. 28 | * 29 | * @return the current effect, or null if none 30 | */ 31 | FireworkEffect getEffect(); 32 | 33 | FireworkEffectMeta clone(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory.meta; 2 | 3 | import org.bukkit.Color; 4 | import org.bukkit.Material; 5 | import org.bukkit.inventory.ItemFactory; 6 | 7 | /** 8 | * Represents leather armor ({@link Material#LEATHER_BOOTS}, {@link 9 | * Material#LEATHER_CHESTPLATE}, {@link Material#LEATHER_HELMET}, or {@link 10 | * Material#LEATHER_LEGGINGS}) that can be colored. 11 | */ 12 | public interface LeatherArmorMeta extends ItemMeta { 13 | 14 | /** 15 | * Gets the color of the armor. If it has not been set otherwise, it will 16 | * be {@link ItemFactory#getDefaultLeatherColor()}. 17 | * 18 | * @return the color of the armor, never null 19 | */ 20 | Color getColor(); 21 | 22 | /** 23 | * Sets the color of the armor. 24 | * 25 | * @param color the color to set. Setting it to null is equivalent to 26 | * setting it to {@link ItemFactory#getDefaultLeatherColor()}. 27 | */ 28 | void setColor(Color color); 29 | 30 | LeatherArmorMeta clone(); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/meta/MapMeta.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory.meta; 2 | 3 | /** 4 | * Represents a map that can be scalable. 5 | */ 6 | public interface MapMeta extends ItemMeta { 7 | 8 | /** 9 | * Checks to see if this map is scaling. 10 | * 11 | * @return true if this map is scaling 12 | */ 13 | boolean isScaling(); 14 | 15 | /** 16 | * Sets if this map is scaling or not. 17 | * 18 | * @param value true to scale 19 | */ 20 | void setScaling(boolean value); 21 | 22 | MapMeta clone(); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/meta/Repairable.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory.meta; 2 | 3 | /** 4 | * Represents an item that can be repaired at an anvil. 5 | */ 6 | public interface Repairable { 7 | 8 | /** 9 | * Checks to see if this has a repair penalty 10 | * 11 | * @return true if this has a repair penalty 12 | */ 13 | boolean hasRepairCost(); 14 | 15 | /** 16 | * Gets the repair penalty 17 | * 18 | * @return the repair penalty 19 | */ 20 | int getRepairCost(); 21 | 22 | /** 23 | * Sets the repair penalty 24 | * 25 | * @param cost repair penalty 26 | */ 27 | void setRepairCost(int cost); 28 | 29 | @SuppressWarnings("javadoc") 30 | Repairable clone(); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/inventory/meta/SkullMeta.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.inventory.meta; 2 | 3 | import org.bukkit.Material; 4 | 5 | /** 6 | * Represents a skull ({@link Material#SKULL_ITEM}) that can have an owner. 7 | */ 8 | public interface SkullMeta extends ItemMeta { 9 | 10 | /** 11 | * Gets the owner of the skull. 12 | * 13 | * @return the owner if the skull 14 | */ 15 | String getOwner(); 16 | 17 | /** 18 | * Checks to see if the skull has an owner. 19 | * 20 | * @return true if the skull has an owner 21 | */ 22 | boolean hasOwner(); 23 | 24 | /** 25 | * Sets the owner of the skull. 26 | *

27 | * Plugins should check that hasOwner() returns true before calling this 28 | * plugin. 29 | * 30 | * @param owner the new owner of the skull 31 | * @return true if the owner was successfully set 32 | */ 33 | boolean setOwner(String owner); 34 | 35 | SkullMeta clone(); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/material/Attachable.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.material; 2 | 3 | import org.bukkit.block.BlockFace; 4 | 5 | /** 6 | * Indicates that a block can be attached to another block 7 | */ 8 | public interface Attachable extends Directional { 9 | 10 | /** 11 | * Gets the face that this block is attached on 12 | * 13 | * @return BlockFace attached to 14 | */ 15 | public BlockFace getAttachedFace(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/material/Colorable.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.material; 2 | 3 | import org.bukkit.DyeColor; 4 | 5 | /** 6 | * An object that can be colored. 7 | */ 8 | public interface Colorable { 9 | 10 | /** 11 | * Gets the color of this object. 12 | * 13 | * @return The DyeColor of this object. 14 | */ 15 | public DyeColor getColor(); 16 | 17 | /** 18 | * Sets the color of this object to the specified DyeColor. 19 | * 20 | * @param color The color of the object, as a DyeColor. 21 | */ 22 | public void setColor(DyeColor color); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/material/Directional.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.material; 2 | 3 | import org.bukkit.block.BlockFace; 4 | 5 | public interface Directional { 6 | 7 | /** 8 | * Sets the direction that this block is facing in 9 | * 10 | * @param face The facing direction 11 | */ 12 | public void setFacingDirection(BlockFace face); 13 | 14 | /** 15 | * Gets the direction this block is facing 16 | * 17 | * @return the direction this block is facing 18 | */ 19 | public BlockFace getFacing(); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/material/FurnaceAndDispenser.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.material; 2 | 3 | import org.bukkit.Material; 4 | 5 | /** 6 | * Represents a furnace or dispenser, two types of directional containers 7 | */ 8 | public class FurnaceAndDispenser extends DirectionalContainer { 9 | 10 | /** 11 | * 12 | * @deprecated Magic value 13 | */ 14 | @Deprecated 15 | public FurnaceAndDispenser(final int type) { 16 | super(type); 17 | } 18 | 19 | public FurnaceAndDispenser(final Material type) { 20 | super(type); 21 | } 22 | 23 | /** 24 | * 25 | * @deprecated Magic value 26 | */ 27 | @Deprecated 28 | public FurnaceAndDispenser(final int type, final byte data) { 29 | super(type, data); 30 | } 31 | 32 | /** 33 | * 34 | * @deprecated Magic value 35 | */ 36 | @Deprecated 37 | public FurnaceAndDispenser(final Material type, final byte data) { 38 | super(type, data); 39 | } 40 | 41 | @Override 42 | public FurnaceAndDispenser clone() { 43 | return (FurnaceAndDispenser) super.clone(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/material/Openable.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.material; 2 | 3 | public interface Openable { 4 | 5 | /** 6 | * Check to see if the door is open. 7 | * 8 | * @return true if the door has swung counterclockwise around its hinge. 9 | */ 10 | boolean isOpen(); 11 | 12 | /** 13 | * Configure this door to be either open or closed; 14 | * 15 | * @param isOpen True to open the door. 16 | */ 17 | void setOpen(boolean isOpen); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/material/PressureSensor.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.material; 2 | 3 | public interface PressureSensor { 4 | public boolean isPressed(); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/material/Redstone.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.material; 2 | 3 | /** 4 | * Indicated a Material that may carry or create a Redstone current 5 | */ 6 | public interface Redstone { 7 | 8 | /** 9 | * Gets the current state of this Material, indicating if it's powered or 10 | * unpowered 11 | * 12 | * @return true if powered, otherwise false 13 | */ 14 | public boolean isPowered(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/metadata/MetadataConversionException.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.metadata; 2 | 3 | /** 4 | * A MetadataConversionException is thrown any time a {@link 5 | * LazyMetadataValue} attempts to convert a metadata value to an inappropriate 6 | * data type. 7 | */ 8 | @SuppressWarnings("serial") 9 | public class MetadataConversionException extends RuntimeException { 10 | MetadataConversionException(String message) { 11 | super(message); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/metadata/MetadataEvaluationException.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.metadata; 2 | 3 | /** 4 | * A MetadataEvaluationException is thrown any time a {@link 5 | * LazyMetadataValue} fails to evaluate its value due to an exception. The 6 | * originating exception will be included as this exception's cause. 7 | */ 8 | @SuppressWarnings("serial") 9 | public class MetadataEvaluationException extends RuntimeException { 10 | MetadataEvaluationException(Throwable cause) { 11 | super(cause); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/permissions/PermissionRemovedExecutor.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.permissions; 2 | 3 | /** 4 | * Represents a class which is to be notified when a {@link 5 | * PermissionAttachment} is removed from a {@link Permissible} 6 | */ 7 | public interface PermissionRemovedExecutor { 8 | 9 | /** 10 | * Called when a {@link PermissionAttachment} is removed from a {@link 11 | * Permissible} 12 | * 13 | * @param attachment Attachment which was removed 14 | */ 15 | public void attachmentRemoved(PermissionAttachment attachment); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/permissions/ServerOperator.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.permissions; 2 | 3 | import org.bukkit.entity.Player; 4 | 5 | /** 6 | * Represents an object that may become a server operator, such as a {@link 7 | * Player} 8 | */ 9 | public interface ServerOperator { 10 | 11 | /** 12 | * Checks if this object is a server operator 13 | * 14 | * @return true if this is an operator, otherwise false 15 | */ 16 | public boolean isOp(); 17 | 18 | /** 19 | * Sets the operator status of this object 20 | * 21 | * @param value New operator value 22 | */ 23 | public void setOp(boolean value); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/plugin/AuthorNagException.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin; 2 | 3 | @SuppressWarnings("serial") 4 | public class AuthorNagException extends RuntimeException { 5 | private final String message; 6 | 7 | /** 8 | * Constructs a new AuthorNagException based on the given Exception 9 | * 10 | * @param message Brief message explaining the cause of the exception 11 | */ 12 | public AuthorNagException(final String message) { 13 | this.message = message; 14 | } 15 | 16 | @Override 17 | public String getMessage() { 18 | return message; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/plugin/EventExecutor.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin; 2 | 3 | import org.bukkit.event.Event; 4 | import org.bukkit.event.EventException; 5 | import org.bukkit.event.Listener; 6 | 7 | /** 8 | * Interface which defines the class for event call backs to plugins 9 | */ 10 | public interface EventExecutor { 11 | public void execute(Listener listener, Event event) throws EventException; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/plugin/IllegalPluginAccessException.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin; 2 | 3 | /** 4 | * Thrown when a plugin attempts to interact with the server when it is not 5 | * enabled 6 | */ 7 | @SuppressWarnings("serial") 8 | public class IllegalPluginAccessException extends RuntimeException { 9 | 10 | /** 11 | * Creates a new instance of IllegalPluginAccessException 12 | * without detail message. 13 | */ 14 | public IllegalPluginAccessException() {} 15 | 16 | /** 17 | * Constructs an instance of IllegalPluginAccessException 18 | * with the specified detail message. 19 | * 20 | * @param msg the detail message. 21 | */ 22 | public IllegalPluginAccessException(String msg) { 23 | super(msg); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/plugin/PluginAwareness.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin; 2 | 3 | import java.util.Set; 4 | 5 | import org.bukkit.plugin.java.JavaPlugin; 6 | 7 | /** 8 | * Represents a concept that a plugin is aware of. 9 | *

10 | * The internal representation may be singleton, or be a parameterized 11 | * instance, but must be immutable. 12 | */ 13 | public interface PluginAwareness { 14 | /** 15 | * Each entry here represents a particular plugin's awareness. These can 16 | * be checked by using {@link PluginDescriptionFile#getAwareness()}.{@link 17 | * Set#contains(Object) contains(flag)}. 18 | */ 19 | public enum Flags implements PluginAwareness { 20 | /** 21 | * This specifies that all (text) resources stored in a plugin's jar 22 | * use UTF-8 encoding. 23 | * 24 | * @see JavaPlugin#getTextResource(String) 25 | */ 26 | UTF8, 27 | ; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/plugin/PluginBase.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin; 2 | 3 | /** 4 | * Represents a base {@link Plugin} 5 | *

6 | * Extend this class if your plugin is not a {@link 7 | * org.bukkit.plugin.java.JavaPlugin} 8 | */ 9 | public abstract class PluginBase implements Plugin { 10 | @Override 11 | public final int hashCode() { 12 | return getName().hashCode(); 13 | } 14 | 15 | @Override 16 | public final boolean equals(Object obj) { 17 | if (this == obj) { 18 | return true; 19 | } 20 | if (obj == null) { 21 | return false; 22 | } 23 | if (!(obj instanceof Plugin)) { 24 | return false; 25 | } 26 | return getName().equals(((Plugin) obj).getName()); 27 | } 28 | 29 | public final String getName() { 30 | return getDescription().getName(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/plugin/PluginLoadOrder.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin; 2 | 3 | /** 4 | * Represents the order in which a plugin should be initialized and enabled 5 | */ 6 | public enum PluginLoadOrder { 7 | 8 | /** 9 | * Indicates that the plugin will be loaded at startup 10 | */ 11 | STARTUP, 12 | /** 13 | * Indicates that the plugin will be loaded after the first/default world 14 | * was created 15 | */ 16 | POSTWORLD 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/plugin/ServicePriority.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin; 2 | 3 | /** 4 | * Represents various priorities of a provider. 5 | */ 6 | public enum ServicePriority { 7 | Lowest, 8 | Low, 9 | Normal, 10 | High, 11 | Highest 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/plugin/messaging/ChannelNameTooLongException.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin.messaging; 2 | 3 | /** 4 | * Thrown if a Plugin Channel is too long. 5 | */ 6 | @SuppressWarnings("serial") 7 | public class ChannelNameTooLongException extends RuntimeException { 8 | public ChannelNameTooLongException() { 9 | super("Attempted to send a Plugin Message to a channel that was too large. The maximum length a channel may be is " + Messenger.MAX_CHANNEL_SIZE + " chars."); 10 | } 11 | 12 | public ChannelNameTooLongException(String channel) { 13 | super("Attempted to send a Plugin Message to a channel that was too large. The maximum length a channel may be is " + Messenger.MAX_CHANNEL_SIZE + " chars (attempted " + channel.length() + " - '" + channel + "."); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/plugin/messaging/ChannelNotRegisteredException.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin.messaging; 2 | 3 | /** 4 | * Thrown if a Plugin attempts to send a message on an unregistered channel. 5 | */ 6 | @SuppressWarnings("serial") 7 | public class ChannelNotRegisteredException extends RuntimeException { 8 | public ChannelNotRegisteredException() { 9 | this("Attempted to send a plugin message through an unregistered channel."); 10 | } 11 | 12 | public ChannelNotRegisteredException(String channel) { 13 | super("Attempted to send a plugin message through the unregistered channel `" + channel + "'."); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/plugin/messaging/MessageTooLargeException.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin.messaging; 2 | 3 | /** 4 | * Thrown if a Plugin Message is sent that is too large to be sent. 5 | */ 6 | @SuppressWarnings("serial") 7 | public class MessageTooLargeException extends RuntimeException { 8 | public MessageTooLargeException() { 9 | this("Attempted to send a plugin message that was too large. The maximum length a plugin message may be is " + Messenger.MAX_MESSAGE_SIZE + " bytes."); 10 | } 11 | 12 | public MessageTooLargeException(byte[] message) { 13 | this(message.length); 14 | } 15 | 16 | public MessageTooLargeException(int length) { 17 | this("Attempted to send a plugin message that was too large. The maximum length a plugin message may be is " + Messenger.MAX_MESSAGE_SIZE + " bytes (tried to send one that is " + length + " bytes long)."); 18 | } 19 | 20 | public MessageTooLargeException(String msg) { 21 | super(msg); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/plugin/messaging/PluginChannelDirection.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin.messaging; 2 | 3 | /** 4 | * Represents the different directions a plugin channel may go. 5 | */ 6 | public enum PluginChannelDirection { 7 | 8 | /** 9 | * The plugin channel is being sent to the server from a client. 10 | */ 11 | INCOMING, 12 | 13 | /** 14 | * The plugin channel is being sent to a client from the server. 15 | */ 16 | OUTGOING 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/plugin/messaging/PluginMessageListener.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin.messaging; 2 | 3 | import org.bukkit.entity.Player; 4 | 5 | /** 6 | * A listener for a specific Plugin Channel, which will receive notifications 7 | * of messages sent from a client. 8 | */ 9 | public interface PluginMessageListener { 10 | 11 | /** 12 | * A method that will be thrown when a PluginMessageSource sends a plugin 13 | * message on a registered channel. 14 | * 15 | * @param channel Channel that the message was sent through. 16 | * @param player Source of the message. 17 | * @param message The raw message that was sent. 18 | */ 19 | public void onPluginMessageReceived(String channel, Player player, byte[] message); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/plugin/messaging/ReservedChannelException.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin.messaging; 2 | 3 | /** 4 | * Thrown if a plugin attempts to register for a reserved channel (such as 5 | * "REGISTER") 6 | */ 7 | @SuppressWarnings("serial") 8 | public class ReservedChannelException extends RuntimeException { 9 | public ReservedChannelException() { 10 | this("Attempted to register for a reserved channel name."); 11 | } 12 | 13 | public ReservedChannelException(String name) { 14 | super("Attempted to register for a reserved channel name ('" + name + "')"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/potion/PotionBrewer.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.potion; 2 | 3 | import java.util.Collection; 4 | 5 | /** 6 | * Represents a brewer that can create {@link PotionEffect}s. 7 | */ 8 | public interface PotionBrewer { 9 | 10 | /** 11 | * Creates a {@link PotionEffect} from the given {@link PotionEffectType}, 12 | * applying duration modifiers and checks. 13 | * 14 | * @param potion The type of potion 15 | * @param duration The duration in ticks 16 | * @param amplifier The amplifier of the effect 17 | * @return The resulting potion effect 18 | */ 19 | public PotionEffect createEffect(PotionEffectType potion, int duration, int amplifier); 20 | 21 | /** 22 | * Returns a collection of {@link PotionEffect} that would be applied from 23 | * a potion with the given data value. 24 | * 25 | * @param damage The data value of the potion 26 | * @return The list of effects 27 | * @deprecated Magic value 28 | */ 29 | @Deprecated 30 | public Collection getEffectsFromDamage(int damage); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.potion; 2 | 3 | public class PotionEffectTypeWrapper extends PotionEffectType { 4 | protected PotionEffectTypeWrapper(int id) { 5 | super(id); 6 | } 7 | 8 | @Override 9 | public double getDurationModifier() { 10 | return getType().getDurationModifier(); 11 | } 12 | 13 | @Override 14 | public String getName() { 15 | return getType().getName(); 16 | } 17 | 18 | /** 19 | * Get the potion type bound to this wrapper. 20 | * 21 | * @return The potion effect type 22 | */ 23 | public PotionEffectType getType() { 24 | return PotionEffectType.getById(getId()); 25 | } 26 | 27 | @Override 28 | public boolean isInstant() { 29 | return getType().isInstant(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/projectiles/BlockProjectileSource.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.projectiles; 2 | 3 | import org.bukkit.block.Block; 4 | 5 | public interface BlockProjectileSource extends ProjectileSource { 6 | 7 | /** 8 | * Gets the block this projectile source belongs to. 9 | * 10 | * @return Block for the projectile source 11 | */ 12 | public Block getBlock(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/projectiles/ProjectileSource.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.projectiles; 2 | 3 | import org.bukkit.entity.Projectile; 4 | import org.bukkit.util.Vector; 5 | 6 | /** 7 | * Represents a valid source of a projectile. 8 | */ 9 | public interface ProjectileSource { 10 | 11 | /** 12 | * Launches a {@link Projectile} from the ProjectileSource. 13 | * 14 | * @param projectile class of the projectile to launch 15 | * @return the launched projectile 16 | */ 17 | public T launchProjectile(Class projectile); 18 | 19 | /** 20 | * Launches a {@link Projectile} from the ProjectileSource with an 21 | * initial velocity. 22 | * 23 | * @param projectile class of the projectile to launch 24 | * @param velocity the velocity with which to launch 25 | * @return the launched projectile 26 | */ 27 | public T launchProjectile(Class projectile, Vector velocity); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/scheduler/BukkitTask.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.scheduler; 2 | 3 | import org.bukkit.plugin.Plugin; 4 | 5 | /** 6 | * Represents a task being executed by the scheduler 7 | */ 8 | public interface BukkitTask { 9 | 10 | /** 11 | * Returns the taskId for the task. 12 | * 13 | * @return Task id number 14 | */ 15 | public int getTaskId(); 16 | 17 | /** 18 | * Returns the Plugin that owns this task. 19 | * 20 | * @return The Plugin that owns the task 21 | */ 22 | public Plugin getOwner(); 23 | 24 | /** 25 | * Returns true if the Task is a sync task. 26 | * 27 | * @return true if the task is run by main thread 28 | */ 29 | public boolean isSync(); 30 | 31 | /** 32 | * Will attempt to cancel this task. 33 | */ 34 | public void cancel(); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/scheduler/BukkitWorker.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.scheduler; 2 | 3 | import org.bukkit.plugin.Plugin; 4 | 5 | /** 6 | * Represents a worker thread for the scheduler. This gives information about 7 | * the Thread object for the task, owner of the task and the taskId. 8 | *

9 | * Workers are used to execute async tasks. 10 | */ 11 | public interface BukkitWorker { 12 | 13 | /** 14 | * Returns the taskId for the task being executed by this worker. 15 | * 16 | * @return Task id number 17 | */ 18 | public int getTaskId(); 19 | 20 | /** 21 | * Returns the Plugin that owns this task. 22 | * 23 | * @return The Plugin that owns the task 24 | */ 25 | public Plugin getOwner(); 26 | 27 | /** 28 | * Returns the thread for the worker. 29 | * 30 | * @return The Thread object for the worker 31 | */ 32 | public Thread getThread(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/scoreboard/Criterias.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.scoreboard; 2 | 3 | /** 4 | * Criteria names which trigger an objective to be modified by actions in-game 5 | */ 6 | public class Criterias { 7 | public static final String HEALTH; 8 | public static final String PLAYER_KILLS; 9 | public static final String TOTAL_KILLS; 10 | public static final String DEATHS; 11 | 12 | static { 13 | HEALTH="health"; 14 | PLAYER_KILLS="playerKillCount"; 15 | TOTAL_KILLS="totalKillCount"; 16 | DEATHS="deathCount"; 17 | } 18 | 19 | private Criterias() {} 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/scoreboard/DisplaySlot.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.scoreboard; 2 | 3 | /** 4 | * Locations for displaying objectives to the player 5 | */ 6 | public enum DisplaySlot { 7 | BELOW_NAME, 8 | PLAYER_LIST, 9 | SIDEBAR; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/scoreboard/ScoreboardManager.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.scoreboard; 2 | 3 | import java.lang.ref.WeakReference; 4 | 5 | /** 6 | * Manager of Scoreboards 7 | */ 8 | public interface ScoreboardManager { 9 | 10 | /** 11 | * Gets the primary Scoreboard controlled by the server. 12 | *

13 | * This Scoreboard is saved by the server, is affected by the /scoreboard 14 | * command, and is the scoreboard shown by default to players. 15 | * 16 | * @return the default sever scoreboard 17 | */ 18 | Scoreboard getMainScoreboard(); 19 | 20 | /** 21 | * Gets a new Scoreboard to be tracked by the server. This scoreboard will 22 | * be tracked as long as a reference is kept, either by a player or by a 23 | * plugin. 24 | * 25 | * @return the registered Scoreboard 26 | * @see WeakReference 27 | */ 28 | Scoreboard getNewScoreboard(); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/util/CachedServerIcon.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.util; 2 | 3 | import org.bukkit.Server; 4 | import org.bukkit.event.server.ServerListPingEvent; 5 | 6 | /** 7 | * This is a cached version of a server-icon. It's internal representation 8 | * and implementation is undefined. 9 | * 10 | * @see Server#getServerIcon() 11 | * @see Server#loadServerIcon(java.awt.image.BufferedImage) 12 | * @see Server#loadServerIcon(java.io.File) 13 | * @see ServerListPingEvent#setServerIcon(CachedServerIcon) 14 | */ 15 | public interface CachedServerIcon {} 16 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/util/Java15Compat.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.util; 2 | 3 | import java.lang.reflect.Array; 4 | 5 | public class Java15Compat { 6 | @SuppressWarnings("unchecked") 7 | public static T[] Arrays_copyOfRange(T[] original, int start, int end) { 8 | if (original.length >= start && 0 <= start) { 9 | if (start <= end) { 10 | int length = end - start; 11 | int copyLength = Math.min(length, original.length - start); 12 | T[] copy = (T[]) Array.newInstance(original.getClass().getComponentType(), length); 13 | 14 | System.arraycopy(original, start, copy, 0, copyLength); 15 | return copy; 16 | } 17 | throw new IllegalArgumentException(); 18 | } 19 | throw new ArrayIndexOutOfBoundsException(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/util/io/Wrapper.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.util.io; 2 | 3 | import java.io.Serializable; 4 | import java.util.Map; 5 | 6 | import org.bukkit.configuration.serialization.ConfigurationSerializable; 7 | import org.bukkit.configuration.serialization.ConfigurationSerialization; 8 | 9 | import com.google.common.collect.ImmutableMap; 10 | 11 | class Wrapper & Serializable> implements Serializable { 12 | private static final long serialVersionUID = -986209235411767547L; 13 | 14 | final T map; 15 | 16 | static Wrapper> newWrapper(ConfigurationSerializable obj) { 17 | return new Wrapper>(ImmutableMap.builder().put(ConfigurationSerialization.SERIALIZED_TYPE_KEY, ConfigurationSerialization.getAlias(obj.getClass())).putAll(obj.serialize()).build()); 18 | } 19 | 20 | private Wrapper(T map) { 21 | this.map = map; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/bukkit/util/permissions/BroadcastPermissions.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.util.permissions; 2 | 3 | import org.bukkit.permissions.Permission; 4 | import org.bukkit.permissions.PermissionDefault; 5 | 6 | public final class BroadcastPermissions { 7 | private static final String ROOT = "bukkit.broadcast"; 8 | private static final String PREFIX = ROOT + "."; 9 | 10 | private BroadcastPermissions() {} 11 | 12 | public static Permission registerPermissions(Permission parent) { 13 | Permission broadcasts = DefaultPermissions.registerPermission(ROOT, "Allows the user to receive all broadcast messages", parent); 14 | 15 | DefaultPermissions.registerPermission(PREFIX + "admin", "Allows the user to receive administrative broadcasts", PermissionDefault.OP, broadcasts); 16 | DefaultPermissions.registerPermission(PREFIX + "user", "Allows the user to receive user broadcasts", PermissionDefault.TRUE, broadcasts); 17 | 18 | broadcasts.recalculatePermissibles(); 19 | 20 | return broadcasts; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java: -------------------------------------------------------------------------------- 1 | package org.spigotmc.event.entity; 2 | 3 | import org.bukkit.entity.Entity; 4 | import org.bukkit.event.HandlerList; 5 | import org.bukkit.event.entity.EntityEvent; 6 | 7 | /** 8 | * Called when an entity stops riding another entity. 9 | * 10 | */ 11 | public class EntityDismountEvent extends EntityEvent 12 | { 13 | 14 | private static final HandlerList handlers = new HandlerList(); 15 | private boolean cancelled; 16 | private final Entity dismounted; 17 | 18 | public EntityDismountEvent(Entity what, Entity dismounted) 19 | { 20 | super( what ); 21 | this.dismounted = dismounted; 22 | } 23 | 24 | public Entity getDismounted() 25 | { 26 | return dismounted; 27 | } 28 | 29 | @Override 30 | public HandlerList getHandlers() 31 | { 32 | return handlers; 33 | } 34 | 35 | public static HandlerList getHandlerList() 36 | { 37 | return handlers; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/spigotmc/event/entity/EntityMountEvent.java: -------------------------------------------------------------------------------- 1 | package org.spigotmc.event.entity; 2 | 3 | import org.bukkit.entity.Entity; 4 | import org.bukkit.event.Cancellable; 5 | import org.bukkit.event.HandlerList; 6 | import org.bukkit.event.entity.EntityEvent; 7 | 8 | /** 9 | * Called when an entity attempts to ride another entity. 10 | * 11 | */ 12 | public class EntityMountEvent extends EntityEvent implements Cancellable 13 | { 14 | 15 | private static final HandlerList handlers = new HandlerList(); 16 | private boolean cancelled; 17 | private final Entity mount; 18 | 19 | public EntityMountEvent(Entity what, Entity mount) 20 | { 21 | super( what ); 22 | this.mount = mount; 23 | } 24 | 25 | public Entity getMount() 26 | { 27 | return mount; 28 | } 29 | 30 | @Override 31 | public boolean isCancelled() 32 | { 33 | return cancelled; 34 | } 35 | 36 | @Override 37 | public void setCancelled(boolean cancel) 38 | { 39 | this.cancelled = cancel; 40 | } 41 | 42 | @Override 43 | public HandlerList getHandlers() 44 | { 45 | return handlers; 46 | } 47 | 48 | public static HandlerList getHandlerList() 49 | { 50 | return handlers; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/block/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes used to manipulate the voxels in a {@link org.bukkit.World world}, 3 | * including special states. 4 | *

5 | */ 6 | package org.bukkit.block; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/command/defaults/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Commands for emulating the Minecraft commands and other necessary ones for 3 | * use by a Bukkit implementation. 4 | *

5 | */ 6 | package org.bukkit.command.defaults; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/command/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes relating to handling specialized non-chat player input. 3 | *

4 | */ 5 | package org.bukkit.command; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/configuration/file/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes dedicated facilitating {@link 3 | * org.bukkit.configuration.Configuration configurations} to be read and 4 | * stored on the filesystem. 5 | *

6 | */ 7 | package org.bukkit.configuration.file; 8 | 9 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/configuration/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes dedicated to handling a plugin's runtime configuration. 3 | *

4 | */ 5 | package org.bukkit.configuration; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/configuration/serialization/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes dedicated to being able to perform serialization specialized for 3 | * the Bukkit {@link org.bukkit.configuration.Configuration configuration} 4 | * implementation. 5 | *

6 | */ 7 | package org.bukkit.configuration.serialization; 8 | 9 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/conversations/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes dedicated to facilitate direct player-to-plugin communication. 3 | *

4 | */ 5 | package org.bukkit.conversations; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/enchantments/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes relating to the specialized enhancements to {@link 3 | * org.bukkit.inventory.ItemStack item stacks}, as part of the {@link 4 | * org.bukkit.inventory.meta.ItemMeta meta data}. 5 | *

6 | */ 7 | package org.bukkit.enchantments; 8 | 9 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/entity/minecart/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Interfaces for various {@link org.bukkit.entity.Minecart} types. 3 | *

4 | */ 5 | package org.bukkit.entity.minecart; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/entity/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Interfaces for non-voxel objects that can exist in a {@link 3 | * org.bukkit.World world}, including all players, monsters, projectiles, etc. 4 | *

5 | */ 6 | package org.bukkit.entity; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/event/block/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link org.bukkit.event.Event Events} relating to when a {@link 3 | * org.bukkit.block.Block block} is changed or interacts with the {@link 4 | * org.bukkit.World world}. 5 | *

6 | */ 7 | package org.bukkit.event.block; 8 | 9 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/event/enchantment/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link org.bukkit.event.Event Events} triggered from an {@link 3 | * org.bukkit.inventory.EnchantingInventory enchantment table}. 4 | *

5 | */ 6 | package org.bukkit.event.enchantment; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/event/entity/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link org.bukkit.event.Event Events} relating to {@link 3 | * org.bukkit.entity.Entity entities}, excluding some directly referencing 4 | * some more specific entity types. 5 | *

6 | */ 7 | package org.bukkit.event.entity; 8 | 9 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/event/hanging/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link org.bukkit.event.Event Events} relating to {@link 3 | * org.bukkit.entity.Hanging entities that hang}. 4 | *

5 | */ 6 | package org.bukkit.event.hanging; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/event/inventory/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link org.bukkit.event.Event Events} relating to {@link 3 | * org.bukkit.inventory.Inventory inventory} manipulation. 4 | *

5 | */ 6 | package org.bukkit.event.inventory; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/event/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes dedicated to handling triggered code executions. 3 | *

4 | */ 5 | package org.bukkit.event; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/event/painting/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link org.bukkit.event.Event Events} relating to {@link 3 | * org.bukkit.entity.Painting paintings}, but deprecated for more general 4 | * {@link org.bukkit.event.hanging hanging} events. 5 | *

6 | */ 7 | package org.bukkit.event.painting; 8 | 9 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/event/player/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link org.bukkit.event.Event Events} relating to {@link 3 | * org.bukkit.entity.Player players}. 4 | *

5 | */ 6 | package org.bukkit.event.player; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/event/server/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link org.bukkit.event.Event Events} relating to programmatic state 3 | * changes on the server. 4 | *

5 | */ 6 | package org.bukkit.event.server; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/event/vehicle/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link org.bukkit.event.Event Events} relating to {@link 3 | * org.bukkit.entity.Vehicle vehicular entities}. 4 | *

5 | */ 6 | package org.bukkit.event.vehicle; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/event/weather/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link org.bukkit.event.Event Events} relating to weather. 3 | *

4 | */ 5 | package org.bukkit.event.weather; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/event/world/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@link org.bukkit.event.Event Events} triggered by various {@link 3 | * org.bukkit.World world} states or changes. 4 | *

5 | */ 6 | package org.bukkit.event.world; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/generator/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes to facilitate {@link org.bukkit.World world} generation 3 | * implementation. 4 | *

5 | */ 6 | package org.bukkit.generator; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/help/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes used to manipulate the default command and topic assistance system. 3 | *

4 | */ 5 | package org.bukkit.help; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/inventory/meta/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The interfaces used when manipulating extra data can can be stored inside 3 | * {@link org.bukkit.inventory.ItemStack item stacks}. 4 | *

5 | */ 6 | package org.bukkit.inventory.meta; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/inventory/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes involved in manipulating player inventories and item interactions. 3 | *

4 | */ 5 | package org.bukkit.inventory; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/map/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes to facilitate plugin handling of {@link org.bukkit.Material#MAP 3 | * map} displays. 4 | *

5 | */ 6 | package org.bukkit.map; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/material/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes that represents various voxel types and states. 3 | *

4 | */ 5 | package org.bukkit.material; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/metadata/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes dedicated to providing a layer of plugin specified data on various 3 | * Minecraft concepts. 4 | *

5 | */ 6 | package org.bukkit.metadata; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * More generalized classes in the API. 3 | *

4 | */ 5 | package org.bukkit; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/permissions/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes dedicated to providing binary state properties to players. 3 | *

4 | */ 5 | package org.bukkit.permissions; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/plugin/java/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes for handling {@link org.bukkit.plugin.Plugin plugins} written in 3 | * java. 4 | *

5 | */ 6 | package org.bukkit.plugin.java; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/plugin/messaging/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes dedicated to specialized plugin to client protocols. 3 | *

4 | */ 5 | package org.bukkit.plugin.messaging; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/plugin/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes specifically relating to loading software modules at runtime. 3 | *

4 | */ 5 | package org.bukkit.plugin; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/potion/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes to represent various {@link org.bukkit.Material#POTION potion} 3 | * properties and manipulation. 4 | *

5 | */ 6 | package org.bukkit.potion; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/projectiles/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes to represent the source of a projectile 3 | *

4 | */ 5 | package org.bukkit.projectiles; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/scheduler/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes dedicated to letting {@link org.bukkit.plugin.Plugin plugins} run 3 | * code at specific time intervals, including thread safety. 4 | *

5 | */ 6 | package org.bukkit.scheduler; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/scoreboard/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Interfaces used to manage the client side score display system. 3 | *

4 | */ 5 | package org.bukkit.scoreboard; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/util/io/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes used to facilitate stream processing for specific Bukkit concepts. 3 | *

4 | */ 5 | package org.bukkit.util.io; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/util/noise/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes dedicated to facilitating deterministic noise. 3 | *

4 | */ 5 | package org.bukkit.util.noise; 6 | 7 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/util/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Multi and single purpose classes to facilitate various programmatic 3 | * concepts. 4 | *

5 | */ 6 | package org.bukkit.util; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/org/bukkit/util/permissions/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Static methods for miscellaneous {@link org.bukkit.permissions.Permission 3 | * permission} functionality. 4 | *

5 | */ 6 | package org.bukkit.util.permissions; 7 | 8 | -------------------------------------------------------------------------------- /src/main/javadoc/overview.html: -------------------------------------------------------------------------------- 1 | 2 |

Bukkit, the plugin development framework.

3 | 4 |

5 | The documentation is for developing plugins and is split into the 6 | respective packages for each subject matter. This documentation does not 7 | cover running a server, contributing code back to the project, or setting 8 | up a workspace. Working knowledge of the Java language is a prerequisite 9 | for developing plugins. 10 |

11 | For basic plugin development, see the {@link org.bukkit.plugin plugin 12 | package}. It covers the basic requirements of a plugin jar. 13 |

14 | For handling events and triggered code, see the {@link org.bukkit.event 15 | event package}. 16 |

17 | 18 | -------------------------------------------------------------------------------- /src/site/apt/index.apt: -------------------------------------------------------------------------------- 1 | Welcome to the Bukkit Maven mini-site! 2 | 3 | This website is automatically generated by Maven 3. 4 | As such, it is updated when the main build system (http://ci.bukkit.org) executes the site lifecycle on the Maven job. 5 | For more information about Bukkit, please see the links above. 6 | 7 | Javadocs 8 | 9 | For Javadocs, please select the "Project Reports" then "JavaDocs" option on the left-hand menu. 10 | -------------------------------------------------------------------------------- /src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bukkit 5 | http://bukkit.org/logo.png 6 | http://bukkit.org/ 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/ArtTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | import static org.hamcrest.CoreMatchers.is; 4 | import static org.hamcrest.Matchers.greaterThan; 5 | import static org.junit.Assert.assertThat; 6 | 7 | import org.junit.Test; 8 | 9 | public class ArtTest { 10 | 11 | @Test(expected = IllegalArgumentException.class) 12 | public void getByNullName() { 13 | Art.getByName(null); 14 | } 15 | 16 | @Test 17 | public void getById() { 18 | for (Art art : Art.values()) { 19 | assertThat(Art.getById(art.getId()), is(art)); 20 | } 21 | } 22 | 23 | @Test 24 | public void getByName() { 25 | for (Art art : Art.values()) { 26 | assertThat(Art.getByName(art.toString()), is(art)); 27 | } 28 | } 29 | 30 | @Test 31 | public void dimensionSanityCheck() { 32 | for (Art art : Art.values()) { 33 | assertThat(art.getBlockHeight(), is(greaterThan(0))); 34 | assertThat(art.getBlockWidth(), is(greaterThan(0))); 35 | } 36 | } 37 | 38 | @Test 39 | public void getByNameWithMixedCase() { 40 | Art subject = Art.values()[0]; 41 | String name = subject.toString().replace('E', 'e'); 42 | 43 | assertThat(Art.getByName(name), is(subject)); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/CoalTypeTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | import static org.hamcrest.CoreMatchers.is; 4 | import static org.junit.Assert.assertThat; 5 | 6 | import org.junit.Test; 7 | 8 | public class CoalTypeTest { 9 | @Test 10 | public void getByData() { 11 | for (CoalType coalType : CoalType.values()) { 12 | assertThat(CoalType.getByData(coalType.getData()), is(coalType)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/CropStateTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | import static org.hamcrest.CoreMatchers.is; 4 | import static org.junit.Assert.assertThat; 5 | 6 | import org.junit.Test; 7 | 8 | public class CropStateTest { 9 | @Test 10 | public void getByData() { 11 | for (CropState cropState : CropState.values()) { 12 | assertThat(CropState.getByData(cropState.getData()), is(cropState)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/DifficultyTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | import static org.hamcrest.CoreMatchers.is; 4 | import static org.junit.Assert.assertThat; 5 | 6 | import org.junit.Test; 7 | 8 | public class DifficultyTest { 9 | @Test 10 | public void getByValue() { 11 | for (Difficulty difficulty : Difficulty.values()) { 12 | assertThat(Difficulty.getByValue(difficulty.getValue()), is(difficulty)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/EffectTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | import static org.hamcrest.CoreMatchers.is; 4 | import static org.junit.Assert.assertThat; 5 | 6 | import org.junit.Test; 7 | 8 | public class EffectTest { 9 | @Test 10 | public void getById() { 11 | for (Effect effect : Effect.values()) { 12 | if (effect.getType() != Effect.Type.PARTICLE) { 13 | assertThat(Effect.getById(effect.getId()), is(effect)); 14 | } else { 15 | assertThat(Effect.getByName(effect.getName()), is(effect)); 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/EntityEffectTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | import static org.hamcrest.CoreMatchers.is; 4 | import static org.junit.Assert.assertThat; 5 | 6 | import org.junit.Test; 7 | 8 | public class EntityEffectTest { 9 | @Test 10 | public void getByData() { 11 | for (EntityEffect entityEffect : EntityEffect.values()) { 12 | assertThat(EntityEffect.getByData(entityEffect.getData()), is(entityEffect)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/GameModeTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | import static org.hamcrest.CoreMatchers.is; 4 | import static org.junit.Assert.assertThat; 5 | 6 | import org.junit.Test; 7 | 8 | public class GameModeTest { 9 | @Test 10 | public void getByValue() { 11 | for (GameMode gameMode : GameMode.values()) { 12 | assertThat(GameMode.getByValue(gameMode.getValue()), is(gameMode)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/GrassSpeciesTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | import static org.hamcrest.CoreMatchers.is; 4 | import static org.junit.Assert.assertThat; 5 | 6 | import org.junit.Test; 7 | 8 | public class GrassSpeciesTest { 9 | @Test 10 | public void getByData() { 11 | for (GrassSpecies grassSpecies : GrassSpecies.values()) { 12 | assertThat(GrassSpecies.getByData(grassSpecies.getData()), is(grassSpecies)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/InstrumentTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | import static org.hamcrest.CoreMatchers.is; 4 | import static org.junit.Assert.assertThat; 5 | 6 | import org.junit.Test; 7 | 8 | public class InstrumentTest { 9 | @Test 10 | public void getByType() { 11 | for (Instrument instrument : Instrument.values()) { 12 | assertThat(Instrument.getByType(instrument.getType()), is(instrument)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/TreeSpeciesTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | import static org.hamcrest.CoreMatchers.is; 4 | import static org.junit.Assert.assertThat; 5 | 6 | import org.junit.Test; 7 | 8 | public class TreeSpeciesTest { 9 | @Test 10 | public void getByData() { 11 | for (TreeSpecies treeSpecies : TreeSpecies.values()) { 12 | assertThat(TreeSpecies.getByData(treeSpecies.getData()), is(treeSpecies)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/WorldTypeTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit; 2 | 3 | import static org.hamcrest.CoreMatchers.is; 4 | import static org.junit.Assert.assertThat; 5 | 6 | import org.junit.Test; 7 | 8 | public class WorldTypeTest { 9 | @Test 10 | public void getByName() { 11 | for (WorldType worldType : WorldType.values()) { 12 | assertThat(WorldType.getByName(worldType.getName()), is(worldType)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/configuration/MemoryConfigurationTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.configuration; 2 | 3 | public class MemoryConfigurationTest extends ConfigurationTest { 4 | @Override 5 | public Configuration getConfig() { 6 | return new MemoryConfiguration(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/configuration/MemorySectionTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.configuration; 2 | 3 | public class MemorySectionTest extends ConfigurationSectionTest { 4 | @Override 5 | public ConfigurationSection getConfigurationSection() { 6 | return new MemoryConfiguration().createSection("section"); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/conversations/ConversationContextTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.conversations; 2 | 3 | import org.junit.Test; 4 | import static org.junit.Assert.*; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | /** 10 | */ 11 | public class ConversationContextTest { 12 | @Test 13 | public void TestFromWhom() { 14 | Conversable conversable = new FakeConversable(); 15 | ConversationContext context = new ConversationContext(null, conversable, new HashMap()); 16 | assertEquals(conversable, context.getForWhom()); 17 | } 18 | 19 | @Test 20 | public void TestPlugin() { 21 | Conversable conversable = new FakeConversable(); 22 | ConversationContext context = new ConversationContext(null, conversable, new HashMap()); 23 | assertEquals(null, context.getPlugin()); 24 | } 25 | 26 | @Test 27 | public void TestSessionData() { 28 | Conversable conversable = new FakeConversable(); 29 | Map session = new HashMap(); 30 | session.put("key", "value"); 31 | ConversationContext context = new ConversationContext(null, conversable, session); 32 | assertEquals("value", context.getSessionData("key")); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/event/PlayerChatTabCompleteEventTest.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event; 2 | 3 | import static org.hamcrest.CoreMatchers.is; 4 | import static org.junit.Assert.assertThat; 5 | 6 | import org.bukkit.event.player.PlayerChatTabCompleteEvent; 7 | import org.bukkit.plugin.messaging.TestPlayer; 8 | import org.junit.Test; 9 | 10 | import com.google.common.collect.ImmutableList; 11 | 12 | public class PlayerChatTabCompleteEventTest { 13 | 14 | @Test 15 | public void testGetLastToken() { 16 | assertThat(getToken("Hello everyone!"), is("everyone!")); 17 | assertThat(getToken(" welcome to the show..."), is("show...")); 18 | assertThat(getToken("The whitespace is here "), is("")); 19 | assertThat(getToken("Too much whitespace is here "), is("")); 20 | assertThat(getToken("The_whitespace_is_missing"), is("The_whitespace_is_missing")); 21 | assertThat(getToken(""), is("")); 22 | assertThat(getToken(" "), is("")); 23 | } 24 | 25 | private String getToken(String message) { 26 | return new PlayerChatTabCompleteEvent(TestPlayer.getInstance(), message, ImmutableList.of()).getLastToken(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/event/TestEvent.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.event; 2 | 3 | 4 | public class TestEvent extends Event { 5 | private static final HandlerList handlers = new HandlerList(); 6 | 7 | public TestEvent(boolean async) { 8 | super(async); 9 | } 10 | 11 | @Override 12 | public HandlerList getHandlers() { 13 | return handlers; 14 | } 15 | 16 | public static HandlerList getHandlerList() { 17 | return handlers; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/java/org/bukkit/plugin/messaging/TestMessageListener.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin.messaging; 2 | 3 | import org.bukkit.entity.Player; 4 | import static org.junit.Assert.*; 5 | 6 | public class TestMessageListener implements PluginMessageListener { 7 | private final String channel; 8 | private final byte[] message; 9 | private boolean received = false; 10 | 11 | public TestMessageListener(String channel, byte[] message) { 12 | this.channel = channel; 13 | this.message = message; 14 | } 15 | 16 | public void onPluginMessageReceived(String channel, Player player, byte[] message) { 17 | assertEquals(this.channel, channel); 18 | assertArrayEquals(this.message, message); 19 | this.received = true; 20 | } 21 | 22 | public boolean hasReceived() { 23 | return received; 24 | } 25 | 26 | public void reset() { 27 | received = false; 28 | } 29 | } 30 | --------------------------------------------------------------------------------