Quantcast
Channel: Server Mods from Bukkit.org
Viewing all articles
Browse latest Browse all 2356

BKCommonLib

$
0
0

Plugin Notice. Please read.

Latest version: 1.42

CraftBukkit build: CB 1.4.6-R0.2

License

This library uses an open license. Feel free to use whatever code you need from it, you do not have to ask me either. If you want me to add certain features, that is fine too. Everyone is allowed to use this Library as a dependency. I do recommend extending 'PluginBase' instead of 'JavaPlugin' then, as it allows you to automatically deal with the BKCommonLib versioning checks.

Features

BKCommonLib is a programming library that features the following utilities:

  • For entities
    • Get information like mob, animal, monster and type names
    • Get and Set Entity trackers for entities
    • Entity add and Entity remove events are supplied
    • Replace native entities using one function
    • Get entities by UUID, get them from Bukkit entities and more of this logic
  • For blocks
    • Get and Set block properties, like attached and directional faces
    • Helper utilities to compare block/material types
    • BlockLocation with BlockMap and BlockSet to store Block coordinates offline
  • For worlds
    • Quick world, chunk and entity getters and iterators (Operation class)
    • Getting the native chunk or world from Bukkit chunk or world
  • For configuration
    • Configuration with nodes that have headers
    • WorldProperty to make per-world configurations and defaults
    • Data writing and reading with and without compression
    • Helper functions for reading and writing objects from/to data streams
  • For scheduling
    • Task class to handle synchronized Bukkit tasks easily
    • AsyncTask to handle multithreading easily
    • nextTick function to schedule runnables for the next tick easily
  • For strings
    • Enum, Time and numeric parsing from Strings
    • Material and Material data parsing from Strings
    • Item parsing using a custom format
    • String manipulation utilities, like listing and appending
    • StringReplaceBundle to store many replacement operations and perform them at once
  • For items
    • Inventory transferring, getting, setting and transformations
    • Item Stack transferring, iterating, getting and matching
    • IInventory implementations to merge inventories and provide abstractions
  • Math and logic
    • Functions like lerp, clamp, look-at, set length, length, lengthsquared, atan(2), more
    • BlockFace utilities to rotate and combine faces
    • CircularInteger and IntRemainder fur unique Integer logic
  • Reflection
    • SafeField, SafeMethod and ClassTemplate to deal with reflection
    • A lot of reflection fields for internal CraftBukkit classes you usually can't get to
  • Misc
    • Common routines like broadcasting, try-casting and numeric contains checks
    • MessageBuilder to make indented and colourful messages to players
    • Packet sending and creation utilities
    • Static getters for plugins by name, server(configuration) and classes
    • StopWatch class to measure execution times
    • Command class, which can be used as a base for OOP-based commands
    • PluginBase which automatically handles permissions, configuration and dependencies

Description

It basically shares all the common code needs in my plugins, and having them in one library heavily reduces the amount of duplicated code in my plugins. Which, of course, reduces the amount of classes and methods the JVM has to deal with. Which is always great to improve performance.

BKCommonLib has versioning on a per-plugin basis, so when a certain plugin needs version 2, and version 1 is installed, the server owner is automatically notified and the plugin is not enabled. This prevents the common mishaps with outdated BKCommonLib versions.

Plugins that require BKCommonLib to be installed:

Bugs

If you have a bug, you can report it in the comments for now. There is no feature element in BKCommonLib, so bugs are rare. Incompatibilities between CraftBukkit builds DO happen, so if you get an error in BKCommonLib related to missing fields or methods, inform me.

Banner

I use a banner in my depending plugins. This banner is automatically updated when a new version of BKCommonLib is out. It is a quick and efficient way to keep track of updates for this library. This was needed, too, because a lot of people were using outdated BKCommonLib versions, which resulted in bug reports...too many of them. And I do not want to waste your time with invalid reports. You have a plugin that uses BKCommonLib? Feel free to use the banner on your download page.

Go to the BKCommonLib Dev-bukkit page Code (WikiCreole):

[[http://dev.bukkit.org/server-mods/bkcommonlib/|{{https://dl.dropbox.com/u/3681706/BKCommonLibVersion.png|Go to the BKCommonLib Dev-bukkit page}}]]

Viewing all articles
Browse latest Browse all 2356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>