Don't remove monster weapons.
Changes the way monster equipment is handled from clearing _all_ items to clearing just the armor contents. This means that monsters that naturally spawn with weapons won't need their weapons added back in. It also means that monsters that _occasionally_ spawn naturally with weapons now may do that in arenas. This is deemed acceptable, because: - occasional weapons don't have as much of an impact as occasional armor, - the forwards compatibility aspect is too valuable to pass up on, and - should occasional weapons become too much of an issue, they can be conditionally removed, i.e. we can implement the _inverse_ behavior of what we had previously. Fixes #641 Fixes #686 Co-authored-by: Andreas Troelsen <[email protected]>
This commit is contained in:
committed by
Andreas Troelsen
co-authored by
Andreas Troelsen
parent
7b9a9505b9
commit
a21f47e193
@@ -18,9 +18,11 @@ These changes will (most likely) be included in the next version.
|
|||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- MobArena now targets the Minecraft 1.17 version of the Spigot API (but still works on 1.13-1.16). This should make it easier to tackle feature requests and bug reports related to modern Minecraft.
|
- MobArena now targets the Minecraft 1.17 version of the Spigot API (but still works on 1.13-1.16). This should make it easier to tackle feature requests and bug reports related to modern Minecraft.
|
||||||
|
- Monsters are no longer stripped of the _weapons_ they spawn with naturally, only their _armor_. This should improve forwards compatibility with new weapon-reliant monsters.
|
||||||
- The regex pattern for the player list command is now less greedy, so it will only match on `/ma players`, `/ma playerlist`, and `/ma player-list`. The previous pattern matched on anything that starts with `player`, which rendered the `/ma player-stats` command in MobArenaStats impossible to invoke.
|
- The regex pattern for the player list command is now less greedy, so it will only match on `/ma players`, `/ma playerlist`, and `/ma player-list`. The previous pattern matched on anything that starts with `player`, which rendered the `/ma player-stats` command in MobArenaStats impossible to invoke.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Pillagers and vindicators no longer spawn without their much-needed weapons.
|
||||||
- Reward groups with `nothing` in them no longer cause errors when earned/granted.
|
- Reward groups with `nothing` in them no longer cause errors when earned/granted.
|
||||||
|
|
||||||
## [0.106] - 2021-05-09
|
## [0.106] - 2021-05-09
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public class MACreature {
|
|||||||
|
|
||||||
private static final Map<String,MACreature> map = new HashMap<>();
|
private static final Map<String,MACreature> map = new HashMap<>();
|
||||||
private static final List<DyeColor> colors = Arrays.asList(DyeColor.values());
|
private static final List<DyeColor> colors = Arrays.asList(DyeColor.values());
|
||||||
|
private static final ItemStack[] NO_ARMOR = new ItemStack[0];
|
||||||
|
|
||||||
static {
|
static {
|
||||||
registerEntityTypeValues();
|
registerEntityTypeValues();
|
||||||
@@ -88,8 +89,8 @@ public class MACreature {
|
|||||||
|
|
||||||
public LivingEntity spawn(Arena arena, World world, Location loc) {
|
public LivingEntity spawn(Arena arena, World world, Location loc) {
|
||||||
LivingEntity e = (LivingEntity) world.spawnEntity(loc, type);
|
LivingEntity e = (LivingEntity) world.spawnEntity(loc, type);
|
||||||
e.getEquipment().clear();
|
|
||||||
e.setCanPickupItems(false);
|
e.setCanPickupItems(false);
|
||||||
|
e.getEquipment().setArmorContents(NO_ARMOR);
|
||||||
|
|
||||||
switch (this.name) {
|
switch (this.name) {
|
||||||
case "sheep":
|
case "sheep":
|
||||||
@@ -128,10 +129,6 @@ public class MACreature {
|
|||||||
case "magmacubehuge":
|
case "magmacubehuge":
|
||||||
((Slime) e).setSize(4);
|
((Slime) e).setSize(4);
|
||||||
break;
|
break;
|
||||||
case "skeleton":
|
|
||||||
case "stray":
|
|
||||||
e.getEquipment().setItemInMainHand(new ItemStack(Material.BOW, 1));
|
|
||||||
break;
|
|
||||||
case "babyzombievillager":
|
case "babyzombievillager":
|
||||||
case "babyzombie":
|
case "babyzombie":
|
||||||
((Zombie) e).setBaby(true);
|
((Zombie) e).setBaby(true);
|
||||||
@@ -149,9 +146,6 @@ public class MACreature {
|
|||||||
case "killerbunny":
|
case "killerbunny":
|
||||||
((Rabbit) e).setRabbitType(Rabbit.Type.THE_KILLER_BUNNY);
|
((Rabbit) e).setRabbitType(Rabbit.Type.THE_KILLER_BUNNY);
|
||||||
break;
|
break;
|
||||||
case "witherskeleton":
|
|
||||||
e.getEquipment().setItemInMainHand(new ItemStack(Material.STONE_SWORD, 1));
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user