Added the ability to configure reinforcement per material types for blocks
generated across the map. This reinforcement is different than player
reinforced blocks as it is done automatically in the DAO cache when a
block of a configured material type is first broken. This type of
reinforcement does NOT get saved to the database.
The configuration is simple:
hardenedMaterials:
IRON_ORE: 3
DIAMOND_ORE: 10
This configuration would cause Iron Ore blocks to require breaking 3 times
before they actually broke. As you can guess, the second material defined
here would cause diamond ore to require 10 breaks.
I will add that the Reinforcement class should be refactored into
IReinforcement, PlayerReinforcement, and EnvironmentalReinforcement so
that this type of reinforcement, with how it is added here, isn't as
kludgey in the code.
Typo prevented removed reinforcements from actually being removed,
allowing players to harvest infinite diamond with a sand glitch. That's
removed now and chunks caches now accurately remove reinforcements.
A modicum of testing is done and many bugs have been fixed. I'm not
confident about groups since groups were added after my day.
Project-wise consistency of tabs and spaces is deferred until next
change.to avoid confusion. Whimsical naming removed.
Very minimal testing has been done, but Citadel is now no longer a
steaming heap of bricks. Aside from fixing bugs, I've changed tabs to 4
spaces in both Citadel.java and my Dao extension.
RAM caching is added by extending CitadelDao. When the plugin wants to
query the database about a block, CitadelCachingDao transparantly loads
all the reinforcement data in the same chunk as that block into the RAM,
if it's not cached already. If changes are made to reinforcements on a
cached chunk, those changes are consolidated in ram so there'll only be
hd read/write when chunks are loaded/unloaded from the RAM cache. When
new chunks are loaded into RAM, all chunks older than an age given in
the config are released (and therefore flushed). There's a hard limit
to the amount of chunks that can be held in RAM (to make
resource-wasting griefing impossible) and when that limit is met, the
entire cache is bypassed (to prevent thrashing).
Right now this is completely untested, I haven't set up MySQL yet.
Also, the craftbukkit library is now local and included relatively for
ease of development.
(not X123, just 123).
Damage values are not supported.
This is mostly for enabling items from mods to be used as reinforcement
materials, as those don't show up in the Materials enum.