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>
|
<groupId>com.rsscripting</groupId>
|
||||||
<artifactId>rs-mobstand</artifactId>
|
<artifactId>rs-mobstand</artifactId>
|
||||||
<version>1.0.5</version>
|
<version>1.1.0</version>
|
||||||
|
|
||||||
<name>RS-MobStand</name>
|
<name>RS-MobStand</name>
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class StandMenu {
|
|||||||
new RSMenuHolder(
|
new RSMenuHolder(
|
||||||
"MAIN"
|
"MAIN"
|
||||||
),
|
),
|
||||||
18,
|
27,
|
||||||
MENU_TITLE
|
MENU_TITLE
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -66,6 +66,9 @@ public class StandMenu {
|
|||||||
boolean paused =
|
boolean paused =
|
||||||
standManager.isPaused(armorStand);
|
standManager.isPaused(armorStand);
|
||||||
|
|
||||||
|
boolean arms =
|
||||||
|
armorStand.hasArms();
|
||||||
|
|
||||||
ItemStack filler =
|
ItemStack filler =
|
||||||
new ItemStack(Material.WHITE_STAINED_GLASS_PANE);
|
new ItemStack(Material.WHITE_STAINED_GLASS_PANE);
|
||||||
|
|
||||||
@@ -362,6 +365,53 @@ public class StandMenu {
|
|||||||
|
|
||||||
inventory.setItem(11, gravityItem);
|
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);
|
player.openInventory(inventory);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -828,6 +828,34 @@ public class MenuListener implements Listener {
|
|||||||
return;
|
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
|
// Open leave Alive Menu
|
||||||
if (event.getSlot() == 13) {
|
if (event.getSlot() == 13) {
|
||||||
|
|
||||||
|
|||||||
@@ -302,6 +302,8 @@ public class StandManager {
|
|||||||
|
|
||||||
armorStand.setCustomNameVisible(false);
|
armorStand.setCustomNameVisible(false);
|
||||||
|
|
||||||
|
armorStand.setArms(false);
|
||||||
|
|
||||||
armorStand.setGravity(true);
|
armorStand.setGravity(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,6 +124,12 @@ public class SlaughterTask extends BukkitRunnable {
|
|||||||
|
|
||||||
String entityName = entityType.name();
|
String entityName = entityType.name();
|
||||||
|
|
||||||
|
boolean configuredAdult =
|
||||||
|
adultMobs.contains(entityName);
|
||||||
|
|
||||||
|
boolean configuredBaby =
|
||||||
|
babyMobs.contains(entityName);
|
||||||
|
|
||||||
boolean killAll = false;
|
boolean killAll = false;
|
||||||
|
|
||||||
boolean shouldKill;
|
boolean shouldKill;
|
||||||
@@ -134,6 +140,10 @@ public class SlaughterTask extends BukkitRunnable {
|
|||||||
// Adult mob
|
// Adult mob
|
||||||
if (ageable.isAdult()) {
|
if (ageable.isAdult()) {
|
||||||
|
|
||||||
|
if (!configuredAdult) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
List<String> disabledAdultMobs =
|
List<String> disabledAdultMobs =
|
||||||
standManager.getDisabledAdultMobs(
|
standManager.getDisabledAdultMobs(
|
||||||
armorStand
|
armorStand
|
||||||
@@ -161,6 +171,10 @@ public class SlaughterTask extends BukkitRunnable {
|
|||||||
// Baby mob
|
// Baby mob
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
if (!configuredBaby) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
List<String> disabledBabyMobs =
|
List<String> disabledBabyMobs =
|
||||||
standManager.getDisabledBabyMobs(
|
standManager.getDisabledBabyMobs(
|
||||||
armorStand
|
armorStand
|
||||||
@@ -190,6 +204,10 @@ public class SlaughterTask extends BukkitRunnable {
|
|||||||
// Non-ageable mobs
|
// Non-ageable mobs
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
if (!configuredAdult) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
List<String> disabledAdultMobs =
|
List<String> disabledAdultMobs =
|
||||||
standManager.getDisabledAdultMobs(
|
standManager.getDisabledAdultMobs(
|
||||||
armorStand
|
armorStand
|
||||||
|
|||||||
Reference in new issue
Block a user