Add support for angry bees.

This commit introduces a new type variant, `angry-bee`, which is a bee
whose anger level is maximized upon spawning, much in the same vein as
its angry wolf cousin.

Note that bees are not available prior to Minecraft 1.15, so a sentinel
`null` name is used in the registration to prevent warnings from being
logged on server versions that don't have a concept of bees.

Closes #584
This commit is contained in:
Andreas Troelsen 2021-07-30 18:10:24 +02:00
parent c1716709f3
commit 286071871f
2 changed files with 6 additions and 0 deletions

View File

@ -12,6 +12,7 @@ These changes will (most likely) be included in the next version.
## [Unreleased]
### Added
- New monster variant `angry-bees` can be used to spawn angry bees.
- (API) MobArena's internal command handler now supports registering pre-instantiated subcommand instances. This should make it easier for extensions to avoid the Singleton anti-pattern for command dependencies.
- (API) MobArena now fires MobArenaPreReloadEvent and MobArenaReloadEvent before and after, respectively, reloading its config-file. This should allow extensions and other plugins to better respond to configuration changes.

View File

@ -7,6 +7,7 @@ import org.bukkit.DyeColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Bee;
import org.bukkit.entity.Creature;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.EntityType;
@ -101,6 +102,9 @@ public class MACreature {
case "poweredcreeper":
((Creeper) e).setPowered(true);
break;
case "angrybee":
((Bee) e).setAnger(Integer.MAX_VALUE);
break;
case "angrywolf":
((Wolf) e).setAngry(true);
break;
@ -232,6 +236,7 @@ public class MACreature {
// spawn time. For example, "angry-wolf" is just a normal wolf with
// its anger property is set to true.
//
put("angrybee", "angrybees", "BEE", null);
put("angrywolf", "angrywolves", "WOLF");
put("babyzombie", "babyzombies", "ZOMBIE");
put("babyzombievillager", "babyzombievillagers", "ZOMBIE_VILLAGER");