Commit Graph

525 Commits

Author SHA1 Message Date
garbagemule
d6c1f97415 Implement boss drops. 2014-08-01 21:26:00 +02:00
garbagemule
7766260154 Switch boss health from ints to doubles - fixes "Health must be between" bugs for bosses. 2014-08-01 20:01:52 +02:00
garbagemule
ebbc069128 Clear all monster equipment on spawn to prevent unexpected tank zombies. 2014-07-31 17:51:45 +02:00
garbagemule
11714ad2ab Merge branch 'bleeding' of github.com:garbagemule/MobArena into bleeding 2014-07-24 05:00:05 +02:00
garbagemule
f269b07998 Actually fix the config-reset bug.
Some of the config-file resets were fixed in a previous commit:
4330885d46

The resets fixed previously were ones where snakeyaml would throw a fit
due to tabs. Because an exception is thrown, the call to saveConfig()
is never reached, which means the config-file is never reset.

However, errors resulting from other illegal characters were not caught
because the built-in reloadConfig() method catches, prints and then
simply does nothing about any exceptions thrown, which means the actual
YamlConfiguration would be empty. Saving this empty file would result
in a reset, because MobArena, during initialization, sees missing bits
and pieces and tries to insert them. Thus, the resets were not an issue
with MobArena's attempt to keep the config-file tidy, but the reckless
handling of errors in the built-in config methods in JavaPlugin.

This commit completely overrides the methods in JavaPlugin that would
result in these resets, and the MobArena plugin class stores its own
reference to the config file and an associated FileConfiguration. When
the reloadConfig() and saveConfig() methods are called, the checked
exceptions are caught and rethrown as unchecked exceptions, causing the
plugin to crash when it needs to do so.
2014-07-24 04:59:08 +02:00
garbagemule
460cec0fb8 Add max health guard for players. 2014-07-11 00:17:30 -04:00
garbagemule
5dc35728c1 Make potion splash handling witch-aware. 2014-07-10 22:33:37 -04:00
garbagemule
4330885d46 Implement check for tabs in config-file. Fixes resets.
This commit creates a fail-fast exception-throwing guard inside the
method for handling config-reloading in the main plugin class.

If a config-file contains a tab, an exception will be thrown when
the plugin loads (as it did before), which means the plugin will not
load correctly. However, upon reloading with the reload command, an
exception is thrown before the current settings are overwritten.

This fixes a long-standing issue with config-files resetting upon
reload with invalid syntax. Verification is needed, as this commit
has only been tested on OS X where tabs and carriage returns are
injected via vim.
2014-06-05 18:14:04 +02:00
garbagemule
a02804a0e7 Fix NPEs when not using scoreboards. 2014-05-23 00:48:21 +02:00
garbagemule
ffa88cc545 Move scoreboard death() call for consistency. 2014-05-06 01:17:52 +02:00
garbagemule
8f95745b50 Add zero-score fix to the dead players on the scoreboards. 2014-05-06 01:16:47 +02:00
garbagemule
9e3848ce41 Disallow MA commands while conversing (guard for Setup Mode). 2014-05-06 01:13:02 +02:00
garbagemule
fb4bf3ad27 Guard against pressure plates in Setup Mode. 2014-05-06 01:12:16 +02:00
garbagemule
f633b77a9d Make mounts spawn as adults - sometimes ;) 2014-05-03 23:16:49 +02:00
garbagemule
2d4b6f20f2 Prevent mounted players from unmounting. 2014-05-03 22:32:24 +02:00
garbagemule
021b43179f Refactor weapon/armor checking, fix skulls resetting on damage. 2014-05-01 01:55:33 +02:00
garbagemule
0182132337 Keep dead players on scoreboards, but make them gray. 2014-05-01 01:34:10 +02:00
garbagemule
bd1e1b879e Remove dead players from scoreboards. 2014-04-27 00:00:53 +02:00
garbagemule
aa77255b18 Add option of showing both regions in Setup Mode. 2014-04-26 23:27:30 +02:00
garbagemule
9fb579b2ff Make start-delay stop auto-start. 2014-04-23 03:51:56 +02:00
garbagemule
2e366f4bee Prevent splash potions from hurting other players. 2014-04-23 03:42:17 +02:00
garbagemule
fec6debf8a Add ArenaPlayerReadyEvent. 2014-04-12 16:26:49 +02:00
garbagemule
fefb3f1c0d Stop start-delay-timer instead of auto-start-timer on empty lobby.
Due to the start-delay-timer holding a reference to the
auto-start-timer as its internal callback, the start-delay-timer
should be stopped, when both timers should be stopped.
2014-04-12 16:17:58 +02:00
garbagemule
df9c0c2704 Add explicit comment to denote idempotence of method call. 2014-04-12 16:13:48 +02:00
garbagemule
7de3e55d58 Guard against null messages. 2014-04-12 15:52:47 +02:00
garbagemule
4ce99aaa05 Return null before trying to add enchantments to null items. 2014-04-07 16:40:31 +02:00
garbagemule
f96eb5ac47 Manually copy arena container contents; fixes reduce-to-0 bug. 2014-04-07 00:55:17 +02:00
garbagemule
c954234229 Only show death messages to arena players. 2014-04-03 22:47:59 +02:00
garbagemule
71fe565316 Make Obsidian Bomb skip non-air blocks and look upwards for one. 2014-03-17 04:17:08 +01:00
garbagemule
515fbc6a22 Force monster targetting to be restricted to arena players. 2014-03-17 04:15:59 +01:00
garbagemule
ca6ee0ea3e Fix arrows not getting removed at arena end. 2014-03-03 16:38:54 +01:00
garbagemule
3e025ef8be Enforce English locale for decimal formatting in config-file. 2014-03-01 13:58:24 +01:00
garbagemule
8a17c72b4b Make sure to copy all the important bits of a wave... This system needs refactoring... 2014-02-26 08:32:19 +01:00
garbagemule
7d14b1b10a Implement start-delay-timer.
The StartDelayTimer wraps the AutoStartTimer and provides a means of
"locking" the lobby until a configurable time has passed. During this
time, it is possible for other players to join the lobby and ready up,
but the arena will not start until the StartDelayTimer has run out,
after which the AutoStartTimer is started (if applicable).

New per-arena setting: start-delay-timer: [seconds]
New announcement: arena-start-delay
2014-02-25 04:36:35 +01:00
garbagemule
5e83c4e7e9 Use correct announcement in AutoStartTimer. 2014-02-25 04:33:43 +01:00
garbagemule
4299353ded Get rid of unnecessary inner classes in AutoStartTimer. 2014-02-25 04:21:58 +01:00
garbagemule
066341ba30 Replace the old AutoStartTimer with the new one. 2014-02-25 03:41:32 +01:00
garbagemule
00060ad5a4 Add new AutoStartTimer using timer framework.
This commit only adds the new timer, but doesn't put it into use.
2014-02-25 03:34:35 +01:00
garbagemule
67535eed93 Null internal timer in CountdownTimer on finish. 2014-02-25 03:32:44 +01:00
garbagemule
bf8c244fce Add utility class for timer package. 2014-02-25 02:11:43 +01:00
garbagemule
937faea5e0 Add setDuration(long) method to CountdownTimer.
The purpose of this method is to allow initialization of the duration
post-construction for convenience.
2014-02-25 02:05:49 +01:00
garbagemule
f8460d5030 Add documentation to TimerCallback 2014-02-25 01:21:26 +01:00
garbagemule
a95ab27d5e Add Timer framework.
This framework consists of interfaces and classes for managing various
kinds of timers. The Timer interface models a timer with configurable
tick intervals. The TimerCallback interface provides a means of adding
logic to the following timer events: onStart, onStop, onFinish and
onTick.

Timer implementations include a CountdownTimer (kitchen timer), and a
StopwatchTimer, which should both be self-explanatory.

The purpose of this framework is to add a means of creating a very
generalized approach to timers, in hopes of abstracting away some of
the Bukkit scheduling for easy maintenance and increased portability.

Future work:
- Port auto-start-timer
- Port boss abilities
- Port spawner
- Create 'delay-timer' as per DBO ticket request.
- Create various types of cooldowns, delays, etc.
2014-02-25 01:09:03 +01:00
garbagemule
f85f9e20d7 Add copy() method to Wave interface.
When the WaveManager is queried for the next wave to be spawned via
the next() method, it now returns a copy of the wave instead of the
wave itself. This is because waves (boss waves in particular) have
state, and this state is transferred to the next occurrence of the
given wave. This caused recurrent boss waves to inconsistently share
state, which resulted in the BossAbilityThread bailing early after
the first occurrence of the boss wave it belonged to. By copying
the initial wave state in the WaveManager, the issue is fixed.

Fixes: http://dev.bukkit.org/bukkit-plugins/mobarena/tickets/1220/
2014-02-24 17:22:20 +01:00
garbagemule
92c4ce1a8b Fix per-arena protect flag. 2014-02-11 17:27:37 +01:00
garbagemule
ea497e42c2 Fix typo in join-arena-is-running announcement. 2014-02-10 01:10:38 +01:00
garbagemule
a527c4a842 Remove obsolete item storing for RepairableContainer. 2014-02-06 04:41:21 +01:00
garbagemule
96870e826b Fix NPE in upgrade map parsing. 2014-02-06 01:07:29 +01:00
garbagemule
7b51fb678c Add command for picking classes in the lobby. 2014-02-02 00:49:59 +01:00
garbagemule
e02f437c2a Fix per-wave spawnpoints-node. 2014-01-27 23:36:48 +01:00
garbagemule
fd7a9c0d0b Empty announcements should be the empty string, not a space. 2014-01-25 15:51:42 +01:00
garbagemule
3223de641f Add setclassprice command. 2014-01-25 15:43:55 +01:00
garbagemule
d0bb31b53d Fix item parser economy regex. 2014-01-25 15:43:16 +01:00
garbagemule
619f07f11b Add per-class option 'price'. 2014-01-25 15:42:38 +01:00
garbagemule
97e5dd0b63 Fix NPE on missing, but expected, monster maps. 2014-01-25 13:56:31 +01:00
garbagemule
d866ec50af Fix checkdata command. 2014-01-23 20:24:11 +01:00
garbagemule
2d3ba801d5 Bring version checker back up to par. 2014-01-22 15:34:48 +01:00
garbagemule
cf41a6add2 Add per-arena setting: show-death-messages 2014-01-22 13:59:17 +01:00
garbagemule
9b161cb1c2 Simplify Setup Mode listener unregistration. 2014-01-22 13:49:39 +01:00
garbagemule
9c4c42bc81 Use Curse/Bukkit API for version checking. 2014-01-22 00:03:44 +01:00
garbagemule
6d93dfa660 Fix entry-fee issue. 2014-01-20 02:59:03 +01:00
garbagemule
b14f665af0 Fix incorrect parsing of final-wave. 2013-12-17 03:55:14 +01:00
garbagemule
5ff41d20fe Use Material instead of item ID. 2013-11-28 02:12:51 +01:00
garbagemule
7d01d613be Fix entry fee issue. 2013-11-28 02:10:57 +01:00
garbagemule
93798a3e51 Remove health strategies. 2013-10-19 16:40:29 +02:00
garbagemule
41e910ad69 More help on arena-not-found with setup command. 2013-10-18 21:16:42 +02:00
garbagemule
3763b877aa Clear spectator drops on death. Fixes #210 2013-10-16 11:37:12 +02:00
garbagemule
bf30185534 Add horse variants as monster types. 2013-10-07 11:55:50 +02:00
garbagemule
56a616ee76 Implement mounts. 2013-10-07 02:05:59 +02:00
garbagemule
24caeab24f Health updates for 1.6 2013-10-07 00:35:47 +02:00
garbagemule
5b2b64d8de Revert "Rip in peace, Metrics, you magnificent bastard."
This reverts commit 096c4d4367.
2013-09-26 13:29:33 +02:00
garbagemule
451e39e3b7 Make spec warp mandatory.
This is necessary to ensure a robust /ma spec command. If no spectator
warp is set, the command will throw an NPE - it is much more safe and
sane to require the warp.
2013-09-21 15:27:41 +02:00
garbagemule
096c4d4367 Rip in peace, Metrics, you magnificent bastard. 2013-09-20 23:27:46 +02:00
garbagemule
42d656863f Attempt to fix auto-start-timer issues. 2013-09-20 23:25:38 +02:00
garbagemule
349172b3b6 Make showBlock(s) thread-safe. 2013-09-09 09:05:54 +02:00
garbagemule
acd441dd2e Try to fix flight exception with Setup Mode. 2013-09-09 09:04:52 +02:00
garbagemule
8a1e74a1a4 LinkedList -> ArrayList 2013-09-08 00:00:17 +02:00
garbagemule
80abcf5f24 Allow the items-node to have a list-value.
The items-node in the classes section now supports list values instead
of strictly string-values. This should make it easier to see exactly
which items a class has, and it should alleviate some of the problems
associated with apostrophes and such. The string-valued setup is still
supported to preserve some backwards compatibility.

The armor-node remains untouched, but it will probably be updated to
the same system later.
2013-09-07 23:56:43 +02:00
garbagemule
70060e7dc8 Fix spacing. 2013-09-02 21:22:24 +02:00
garbagemule
354784269e Fix NPE in setclass command. 2013-08-31 05:58:55 +02:00
garbagemule
8ea4799b42 Permissions cleanup. 2013-08-29 02:29:24 +02:00
garbagemule
cd62f040c0 Remove obsolete commands, remove "selected arena"
The notion of a "selected arena" disappears with this commit. All
commands that previously did not require an arena name in the case
of multiple arenas now do, i.e. it is no longer possible to "set"
an arena to be the target of commands. This should not be an issue,
however, since Setup Mode replaces all the commands that previously
were the main reason for the notion of a selected arena.
2013-08-29 02:01:36 +02:00
garbagemule
95fc5eeb6e Create setup command.
The /ma setup <arena> command is the first step in the process of
making the setup procedure more intuitive. The command consists of
the actual command handling, as well as a multi-role inner class,
and together they constitute Setup Mode.

- Toolbox; a set of tools are provided to the user, and a handler
  for the interact event will react to the usage of these tools,
  providing the primary, interactive element of Setup Mode. The
  tools are used to set regions, warps and points.
- Text input; by typing 'exp', the user can expand a given region
  in the typical directions (up, down, out), and by typing 'show',
  the user can request red wool blocks to be displayed in place of
  region frames, warps and points.

Whilst in Setup Mode, the user cannot type any commands, because
the input is intercepted due to the Conversations API - this is
by design, and may prevent some inconsistencies.

The next step in the process will be to fully remove the commands
that Setup Mode renders obsolete. The commands include, but are
not limited to:
- set(lobby)region
- expand(lobby)region
- setwarp
- addspawn
- delspawn
- addchest
- delchest
2013-08-29 01:09:19 +02:00
garbagemule
9f7c009d85 Add more show methods to ArenaRegion. 2013-08-29 00:41:04 +02:00
garbagemule
a4218ae18c Remove debug printouts. 2013-08-29 00:40:23 +02:00
garbagemule
aae6593323 Fix desc of delspawn command. 2013-08-28 08:53:41 +02:00
garbagemule
17d9068aa0 Stop the blaze fires. 2013-08-26 00:22:16 +02:00
garbagemule
470291c626 No more breaking item frames and paintings. 2013-08-23 16:37:19 +02:00
garbagemule
0a2956fb81 Fix MagicSpells config loading issue. 2013-08-23 16:22:42 +02:00
garbagemule
402e6d4de9 Fix lobby potion stuff. 2013-08-22 15:00:50 +02:00
garbagemule
09b1eb9599 Tidy up the set lobby region command. 2013-08-20 18:16:13 +02:00
garbagemule
b11b9d3eb1 Add a setting command. 2013-08-20 17:32:53 +02:00
garbagemule
709480a80f Expose a reloadArena() command in the ArenaMaster. 2013-08-20 17:31:37 +02:00
garbagemule
eb04693c3f Tidy up commands.
- The execute() method has had its docs redefined to reflect how the
  CommandHandler now handles the return value of the method. That is,
  if the method returns false, the CommandHandler prints the usage
  message and description of the command to the command sender.
- Commands now only return false when they should, according to the
  updated docs of the execute() method.
- Most commands have been tidied up a bit, i.e. they've had some
  unnecessary code removed in the advent of the new usage printing
  of the CommandHandler.
- Some commands have had their patterns altered slightly.
- The order of command registration now matters. That is, the order
  commands are registered in will be the order in which the help
  screen will display the command usages and descriptions.
- The help screen now shows ordered commands, and separates the
  types into user, admin and setup sections for a better overview.
2013-08-20 16:36:28 +02:00
garbagemule
e7d3da4db3 Omit [MobArena] on usage messages. 2013-08-20 15:46:52 +02:00
garbagemule
4ce8dcfad3 Simplify first-join => join 2013-08-20 14:40:12 +02:00
garbagemule
6ef8bf23da Fix item glitching.
Let's see you glitch items out now, suckers!
2013-08-19 06:22:31 +02:00
garbagemule
69741a3bdc Add showlobbyregion command. 2013-08-19 04:57:51 +02:00
garbagemule
957545dfe1 Fix all issues related to the lobby region. 2013-08-19 04:56:38 +02:00
garbagemule
d3187fd2de Fix all damage bugs with lobby/spec area.
This simple little do'h has caused many issues, but no more, I say!
NO MORE!
2013-08-19 04:54:43 +02:00
garbagemule
701177a9e2 Fix last standing API. 2013-08-19 02:23:33 +02:00
garbagemule
809ee2facb Expose min- and max-player methods on Arena. 2013-08-19 02:22:44 +02:00
garbagemule
3b47ca407e Fix upgrade waves. 2013-08-18 00:28:00 +02:00
garbagemule
9c411a21ad replaceAll => replace for dollar sign compatibility. 2013-08-16 17:52:32 +02:00
garbagemule
22a8f43fce Add missing wrapper for classchest location setter. 2013-08-16 05:48:18 +02:00
garbagemule
a2328c7271 Avoid NPE with Locations in config files. 2013-08-16 05:31:32 +02:00
garbagemule
8793bd6cef Backwards compatibility for leaderboard coords. 2013-08-16 03:27:54 +02:00
garbagemule
186fc498cf Make root-target a littler rootier. 2013-08-16 01:18:00 +02:00
garbagemule
b0c630df36 Fix color code gibberishing for announcements. 2013-08-16 01:09:39 +02:00
garbagemule
e1feb5172c Fix config reloading. 2013-08-16 01:09:23 +02:00
garbagemule
b9e3a5df0b Fix typo in error message. 2013-08-15 18:11:41 +02:00
garbagemule
ef9fd267c1 Revamp the announcements system.
This commit transforms the announcements system in the following way:
- announcements.yml makes it easier to add missing nodes and remove
  obsolete ones. This way, users don't have to delete their previous
  announcements-file to get the new keys.
- Color codes are supported in the fact that when an announcement
  message is "set()", the string value has all of its &-symbols
  translated.
- No need for a defaults-file, because the enum is very easy to
  compile into a YAML file.
2013-08-15 17:55:21 +02:00
garbagemule
22723d883a Bye bye, Spout. 2013-08-15 15:12:37 +02:00
garbagemule
a3ab2203be Get rid of config adapter.
This change involves many classes because the adapter was relied upon
heavily throughout the project. The change is motivated by the fact
that the wrapper created more problems than it solved. Those problems
(listed here) are solved by this commit. Some classes have undergone
notable changes (e.g. ArenaRegion).

- The config-file will no longer overwrite and regenerate itself
  seemingly randomly.
- The config-file will now save correctly when setting points and
  expanding regions.
- The "no class items in lobby" problem has been fixed.
- The "must be inside region" problem has been fixed.
2013-08-15 14:37:10 +02:00
garbagemule
2475ae3633 Add support for arbitrary filenames... 2013-08-15 04:45:07 +02:00
garbagemule
e99a2f3d44 Fix double-print for loaded arenas. 2013-08-15 04:30:19 +02:00
garbagemule
d92e3e8925 Let's leave out the printlns... 2013-08-15 03:46:49 +02:00
garbagemule
d73a0ed707 Fix "no class items on class selected".
The fix is simply a reload of the config-file after initially loading
the config-file. For some reason it works. No clue why >_>
2013-08-15 03:44:47 +02:00
garbagemule
b6f81e0823 World-change code for set(lobby)region. 2013-08-15 03:41:21 +02:00
garbagemule
a87831a12f Set world-node when world changes. 2013-08-15 03:40:58 +02:00
garbagemule
a15f60b761 Lazy initialization of selected arena.
This fixes issues with having to restart the server for "not ready"
type messages.
2013-08-15 03:39:26 +02:00
garbagemule
8a45e0c953 Make sure we can force worlds. 2013-08-15 00:45:26 +02:00
garbagemule
f1b94fbbcc Correct leaderboards error message. 2013-08-14 22:53:36 +02:00
garbagemule
63ff94b04f Multiworld leaderboards. 2013-08-14 22:37:42 +02:00
garbagemule
f98fe0b78f Multiworld exit-warp and location formatting. 2013-08-14 22:36:12 +02:00
garbagemule
b3cb258d0b Fix lobby region expansion command. 2013-08-14 22:33:44 +02:00
garbagemule
80f091acaa Add world name to coords. 2013-08-13 15:27:33 +02:00
garbagemule
a3cef8339e StringBuffer => StringBuilder, thanks IntelliJ ^_^ 2013-08-13 14:59:11 +02:00
garbagemule
c500c4f80e Remember to add the actual command class ;) 2013-08-13 14:56:10 +02:00
garbagemule
1673078df5 Add classchest command.
The classchest command can be used to link a chest to a class directly
(although still in the same world) without having to position them in
a specific pillar under the signs.
2013-08-13 14:54:34 +02:00
garbagemule
c24f9f8ccc Switch to floating point numbers for locations.
This allows spawnpoints and warps to be specified more precisely.
2013-08-13 14:51:16 +02:00
garbagemule
a5fea824b7 Tossing IntelliJ a bone. 2013-08-10 16:57:24 +02:00
garbagemule
c282fe7000 Add baby zombie villagers 2013-08-10 16:38:44 +02:00
garbagemule
76330f06d3 Add unbreakable-weapons and unbreakable-armor. 2013-08-08 18:23:33 +02:00
garbagemule
345efc9136 ArenaCompleteEvent: s/winners/survivors 2013-08-08 17:58:19 +02:00
garbagemule
544fd91de9 Introduce "last player standing" to death event.
It is now possible to check if an arena player who died was the last
player alive in the arena. Useful for special rewards and stuff.
2013-08-08 06:09:07 +02:00
garbagemule
e3381e895d Some null checks for pet spawner. 2013-08-07 02:00:17 +02:00
garbagemule
3ae69f6cf4 ACTUALLY add the event >_> 2013-08-07 00:10:56 +02:00
garbagemule
1f91dde9e5 Add ArenaCompleteEvent
This event is fired when the final wave was completed and contains
a set of all the players who survived until the end.
2013-08-06 23:59:19 +02:00
garbagemule
0b6a017c32 Include arena in ArenaKillEvent. 2013-08-06 23:58:42 +02:00
garbagemule
2b5291b593 Fix multi-arena join/spec interleaving issues.
- When a player attempts to join or spec an arena while they are
in an arena (arena or lobby), they will be denied access.
- When a player attempts to join or spec an arena while they are
spectating an arena, they will be force-left first.
2013-08-06 12:21:06 +02:00
garbagemule
d57f47fb05 Add ArenaKillEvent
This event is fired whenever an arena player kills either a monster
or another player. Useful for plugin extensions.
2013-08-06 10:33:02 +02:00
garbagemule
312ef3c55a Expose command interface. 2013-08-05 12:42:34 +02:00
garbagemule
48686aafcb Add support for minor economy values. 2013-08-03 04:16:31 +02:00
garbagemule
029a976dc7 Uncancel sign interaction in lobby. 2013-08-03 01:14:14 +02:00
garbagemule
e6a0f30993 Add per-class lobby-permissions node. 2013-08-03 01:13:18 +02:00
garbagemule
dbe5f4d20f Add optional per-arena exit warp. 2013-08-01 16:13:24 +02:00
garbagemule
f43293a376 Attempt to fix multiworld inventory issues. 2013-07-30 23:37:03 +02:00
garbagemule
13948e7554 Add global first-join announce feature. 2013-07-30 23:04:49 +02:00
garbagemule
ea4031b0ed Add isolated chat option. 2013-07-30 22:07:57 +02:00