Commit Graph

525 Commits

Author SHA1 Message Date
Andreas Troelsen
692d7f52dc Add support for a per-arena default class. 2017-02-18 03:27:50 +01:00
Andreas Troelsen
d2fd8b4fc2 Add support for bringing your own items into the arena.
This implementation uses a sublcass of ArenaClass to make an implicit My Items class, which restores the player's inventory when granting items.
2017-02-18 03:27:10 +01:00
Andreas Troelsen
51f907218e Use a hardcoded potion map to deal with potion metas. Fixes #312 #343
Thanks slipcor!
2017-02-18 02:43:12 +01:00
Andreas Troelsen
48a85a7e85 Use a copy of the block list in BlockExplodeEvent for the fake EntityExplodeEvent. Fixes #356
The blockList() call returns the actual List<Block> object in the explode event, which means it'll be shared between the the fake event and the original event. As a result, the call to blockList().clear() will clear the shared list, and the following call to blockList().addAll(fake.blockList()) results in trying to add the empty list to itself.

This commit makes sure to copy the original event's block list before sending it to the fake event.
2017-02-14 17:26:20 +01:00
Andreas Troelsen
c66321ec78 Remove over-dramatic warning about harmless state inconsistency in start timers. Fixes #317
Okay, "Fixes" would be lying, and that's terrible, but here's something to help you shrug it off: The timer module is a bit of a mess, and since there isn't actually anything "dangerous" about this, let's just calm our tits and focus on other stuff.
2017-02-10 21:47:41 +01:00
Andreas Troelsen
f40e54f8bb Minor refactoring of class chests handling. Fixes #318 2017-02-10 21:40:02 +01:00
Andreas Troelsen
acbeb3d77f Guard against null scores for players who manage to die in the lobby. Fixes #319 2017-02-10 21:32:56 +01:00
Andreas Troelsen
7e049cdae6 Ignore off-hand interactions for class signs and ready blocks. Fixes #340 2017-02-10 15:52:44 +01:00
Andreas Troelsen
b7472dbc94 Prevent mobs from picking up dropped items and blocks. Fixes #344 2017-02-10 15:45:12 +01:00
Andreas Troelsen
788cfefa00 Give all mounts saddles - not just the normal horses. 2016-12-30 01:32:16 +01:00
Andreas Troelsen
fb1a87f71b Make sure all mounts are invincible, not just normal horses. 2016-12-30 01:11:56 +01:00
Andreas Troelsen
b40b73ea25 Remove support for llamas as mounts (they can't be controlled so no point yet). 2016-12-30 00:34:56 +01:00
Andreas Troelsen
41f0a892c4 Refactor mount spawning due to API changes; fixes an exception thrown when trying to use barding on non-normal horses.
This commit adds support for llamas and removes barding and saddles from non-horse mounts.
2016-12-29 21:56:29 +01:00
garbagemule
df43712964 Remove Shulker bullets on session cleanup. 2016-12-29 17:56:43 +01:00
garbagemule
8705b5c9f7 Add support for off-hand items. 2016-12-29 17:56:32 +01:00
garbagemule
558681a2f2 Remove redundant setContents() calls from class chest handlers.
Before, these redundant calls didn't really do anything. Now they mess everything up, because setContents() doesn't set inventory contents only, but the entire inventory instead, because that's so super useful. Well done, boys!

#notsalty
2016-12-29 17:55:46 +01:00
garbagemule
93ce8b9667 Fix Spigot's semi-breaking inventory change.
Because it is clearly impossible to change JavaDocs to correctly describe what a method does, the method setContents() has now been changed to a useless, over-aggressive, inventory-wiping piece of junk that must be invoked before anything else. This commit ensures that armor contents are set after the setContents() method is called, overwriting the nulls that the setContents() method creates.
2016-12-29 17:55:30 +01:00
Andreas Troelsen
11fb0ed573 Give strays a bow just like their normal skeleton friends. 2016-12-17 01:58:46 +01:00
garbagemule
60a173d447 Merge pull request #327 from slipcor/offhand-2
Ignore off-hand interact events in Setup Mode (since Minecraft/Spigot 1.9). Fixes #299
2016-12-17 01:44:43 +01:00
garbagemule
65f33ae1a4 Merge pull request #328 from slipcor/empty-inventory
Always check for both null stacks and "air stacks" (ItemStack ID 0) when checking for empty inventories. Fixes #302
2016-12-17 01:43:46 +01:00
garbagemule
bc7c321d28 Merge pull request #329 from slipcor/pets-2
Make pets (ocelots included) sit before teleporting players to the lobby. Fixes #247
2016-12-17 01:41:55 +01:00
slipcor
333a23ecdd fix skeletons only punching with the bow they already have by giving them a new one 2016-12-16 20:36:57 +01:00
slipcor
f81921efcd address github issue #247 (sit pets before teleporting) and include cats/ocelots as pets 2016-12-15 22:32:55 +01:00
slipcor
cbac56e199 address github issue #302 (joining with empty inventory) 2016-12-15 20:08:00 +01:00
slipcor
e6e4782de8 address github issue #299 (ignore offhand interact events thrown since Spigot 1.9) 2016-12-15 18:49:30 +01:00
slipcor
3b88b889d6 update to Spigot 1.11, fix entity spawning errors, remove redundant definitions 2016-12-15 13:13:21 +01:00
garbagemule
dbff678660 Add support for killer bunnies. 2015-09-16 18:51:43 +02:00
garbagemule
4d2b6927d4 Add support for elder guardians. 2015-08-23 15:34:22 +02:00
garbagemule
3a20be3db9 Make root-target find the nearest ground block to root to. 2015-07-28 20:25:08 +02:00
garbagemule
39196c7b61 Unwrap potential Player proxies in commands. 2015-07-17 17:50:51 +02:00
garbagemule
79ca18aa41 Fix default boss health value. 2015-07-17 16:41:58 +02:00
garbagemule
d32cd22a98 Make monster types case-insensitive. 2015-07-17 16:12:23 +02:00
garbagemule
a9eab13842 Fix Spigot block explosion issue. 2015-07-17 16:11:00 +02:00
garbagemule
95aebcf333 Merge branch 'ma-creature' 2015-07-17 04:45:57 +02:00
garbagemule
d3c5535f61 Cast null instead of creating a new set. 2015-07-17 04:45:48 +02:00
garbagemule
eda6e6e1f3 Static map initializer before constants. 2015-07-17 04:44:59 +02:00
garbagemule
0e814b9c0f Convert MACreature to class. 2015-07-17 04:25:24 +02:00
garbagemule
aafeb93d38 Update for Spigot and mavenize. 2015-07-17 03:38:41 +02:00
garbagemule
e663a10a2a Fix Spigot issue with skeleton/wolf targetting. 2014-12-13 20:29:02 +01:00
garbagemule
2e397fd123 Really fix the Spigot health issue (with a twist). 2014-12-13 20:28:14 +01:00
garbagemule
a8755ea496 Add a guard for ridiculous Spigot health issue. 2014-12-08 19:37:11 +01:00
garbagemule
246c05e7a9 Initial work on fix for water not removing properly. NOT ACTIVATED. 2014-12-08 19:23:21 +01:00
garbagemule
bca1d387a4 Allow for spaces between comma-separated potion effects. 2014-12-08 16:48:53 +01:00
garbagemule
243c5ea6ea Make numeric regexes require at least one number to match. 2014-12-08 16:45:05 +01:00
garbagemule
55e0500bae Allow for lower case potion effect names. 2014-12-08 16:43:15 +01:00
garbagemule
409c3f6c14 Swap amplifier and duration parameters in effect parser.
This changes the format from:

  <effect>:<duration>:<amplifier>

to a (pressumably) more user-friendly format of:

  <effect>:<amplifier>:<duration>

The reason for this swap is that the duration is more likely to be
wanted left at default than the amplifier. From previous user input
on the matter, it sounds like users generally want the bosses to have
"permanent" or "infinite duration" effects, and this change makes it
a little easier on them, not having to specify a duration.
2014-12-08 16:38:33 +01:00
graywolf336
47f22f75ab If no duration provided, potion effects on bosses will last forever. 2014-11-27 22:05:38 -06:00
graywolf336
1090550a3b Add potion effects to bosses when they spawn.
With this feature you can add potions to the bosses when they spawn,
adding the ability to add strength to the boss for the first 30 seconds
making it harder for the first few seconds and once the effect wears
goes away the boss becomes easier. The syntax is in the same style as
potion items, except it uses either the potion effect enum name or the
potion effect id.

POTION_EFFECT:duration in seconds:amplifer

SLOW:360:4;INVISIBILITY:36000:0

If no duration is given, the plugin will default to sixty seconds. If
the amplifer was not provided, the plugin will default to zero. The
potion effect amplifcation starts at 0 being level 1.
2014-11-27 03:37:14 -06:00
garbagemule
0649d1ba1f Version 0.96.7 2014-08-02 07:34:04 +02:00
garbagemule
ea2cb4baf2 Fix auto-ignite-tnt not working with protect: false 2014-08-02 07:01:56 +02:00
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