1.1.0
Added: - Option to enable/disable MobStands arms. Changed: - Mob Stand now ignores mobs not listed in configs.
This commit is contained in:
1 parent
6454dfb7fc
commit
8576abab53
5 files changed
+100
-2
No files matched your search
@@ -13,7 +13,7 @@
|
||||
|
||||
<groupId>com.rsscripting</groupId>
|
||||
<artifactId>rs-mobstand</artifactId>
|
||||
<version>1.0.5</version>
|
||||
<version>1.1.0</version>
|
||||
|
||||
<name>RS-MobStand</name>
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class StandMenu {
|
||||
new RSMenuHolder(
|
||||
"MAIN"
|
||||
),
|
||||
18,
|
||||
27,
|
||||
MENU_TITLE
|
||||
);
|
||||
|
||||
@@ -66,6 +66,9 @@ public class StandMenu {
|
||||
boolean paused =
|
||||
standManager.isPaused(armorStand);
|
||||
|
||||
boolean arms =
|
||||
armorStand.hasArms();
|
||||
|
||||
ItemStack filler =
|
||||
new ItemStack(Material.WHITE_STAINED_GLASS_PANE);
|
||||
|
||||
@@ -362,6 +365,53 @@ public class StandMenu {
|
||||
|
||||
inventory.setItem(11, gravityItem);
|
||||
|
||||
// Arms toggle
|
||||
ItemStack armsItem =
|
||||
new ItemStack(
|
||||
Material.IRON_SWORD
|
||||
);
|
||||
|
||||
ItemMeta armsMeta =
|
||||
armsItem.getItemMeta();
|
||||
|
||||
if (armsMeta != null) {
|
||||
|
||||
armsMeta.setDisplayName(
|
||||
(arms
|
||||
? ChatColor.GREEN
|
||||
: ChatColor.RED)
|
||||
+ "Arms"
|
||||
);
|
||||
|
||||
armsMeta.setLore(List.of(
|
||||
ChatColor.GRAY + "Current: "
|
||||
+ (arms
|
||||
? ChatColor.GREEN + "Enabled"
|
||||
: ChatColor.RED + "Disabled"),
|
||||
"",
|
||||
ChatColor.YELLOW + "Click to toggle."
|
||||
));
|
||||
|
||||
if (arms) {
|
||||
|
||||
armsMeta.addEnchant(
|
||||
Enchantment.UNBREAKING,
|
||||
1,
|
||||
true
|
||||
);
|
||||
|
||||
armsMeta.addItemFlags(
|
||||
ItemFlag.HIDE_ENCHANTS
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
armsItem.setItemMeta(armsMeta);
|
||||
|
||||
}
|
||||
|
||||
inventory.setItem(22, armsItem);
|
||||
|
||||
player.openInventory(inventory);
|
||||
|
||||
}
|
||||
|
||||
@@ -828,6 +828,34 @@ public class MenuListener implements Listener {
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
// Arms toggle
|
||||
if (event.getSlot() == 22) {
|
||||
|
||||
boolean arms =
|
||||
armorStand.hasArms();
|
||||
|
||||
arms = !arms;
|
||||
|
||||
armorStand.setArms(arms);
|
||||
|
||||
player.sendMessage(
|
||||
arms
|
||||
? ChatColor.GREEN
|
||||
+ "MobStand arms enabled."
|
||||
: ChatColor.GREEN
|
||||
+ "MobStand arms disabled."
|
||||
);
|
||||
|
||||
StandMenu.open(
|
||||
plugin,
|
||||
player,
|
||||
armorStand
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Open leave Alive Menu
|
||||
if (event.getSlot() == 13) {
|
||||
|
||||
|
||||
@@ -302,6 +302,8 @@ public class StandManager {
|
||||
|
||||
armorStand.setCustomNameVisible(false);
|
||||
|
||||
armorStand.setArms(false);
|
||||
|
||||
armorStand.setGravity(true);
|
||||
|
||||
}
|
||||
|
||||
@@ -124,6 +124,12 @@ public class SlaughterTask extends BukkitRunnable {
|
||||
|
||||
String entityName = entityType.name();
|
||||
|
||||
boolean configuredAdult =
|
||||
adultMobs.contains(entityName);
|
||||
|
||||
boolean configuredBaby =
|
||||
babyMobs.contains(entityName);
|
||||
|
||||
boolean killAll = false;
|
||||
|
||||
boolean shouldKill;
|
||||
@@ -134,6 +140,10 @@ public class SlaughterTask extends BukkitRunnable {
|
||||
// Adult mob
|
||||
if (ageable.isAdult()) {
|
||||
|
||||
if (!configuredAdult) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<String> disabledAdultMobs =
|
||||
standManager.getDisabledAdultMobs(
|
||||
armorStand
|
||||
@@ -161,6 +171,10 @@ public class SlaughterTask extends BukkitRunnable {
|
||||
// Baby mob
|
||||
else {
|
||||
|
||||
if (!configuredBaby) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<String> disabledBabyMobs =
|
||||
standManager.getDisabledBabyMobs(
|
||||
armorStand
|
||||
@@ -190,6 +204,10 @@ public class SlaughterTask extends BukkitRunnable {
|
||||
// Non-ageable mobs
|
||||
else {
|
||||
|
||||
if (!configuredAdult) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<String> disabledAdultMobs =
|
||||
standManager.getDisabledAdultMobs(
|
||||
armorStand
|
||||
|
||||
Reference in new issue
Block a user