mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2026-04-22 19:11:23 +00:00
Compare commits
4 Commits
1176b57886
...
46db1af915
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46db1af915 | ||
|
|
772acf4332 | ||
|
|
1cd38294cc | ||
|
|
9e01726b84 |
14
pom.xml
14
pom.xml
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<groupId>lol.hyper</groupId>
|
<groupId>lol.hyper</groupId>
|
||||||
<artifactId>toolstats</artifactId>
|
<artifactId>toolstats</artifactId>
|
||||||
<version>2.0.2</version>
|
<version>2.0.3</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>ToolStats</name>
|
<name>ToolStats</name>
|
||||||
@@ -75,13 +75,17 @@
|
|||||||
<id>jitpack.io</id>
|
<id>jitpack.io</id>
|
||||||
<url>https://jitpack.io</url>
|
<url>https://jitpack.io</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>rosewood-repo</id>
|
||||||
|
<url>https://repo.rosewooddev.io/repository/public/</url>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.papermc.paper</groupId>
|
<groupId>io.papermc.paper</groupId>
|
||||||
<artifactId>paper-api</artifactId>
|
<artifactId>paper-api</artifactId>
|
||||||
<version>1.21.11-R0.1-SNAPSHOT</version>
|
<version>26.1.1.build.8-alpha</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -90,5 +94,11 @@
|
|||||||
<version>1.0.10</version>
|
<version>1.0.10</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>dev.rosewood</groupId>
|
||||||
|
<artifactId>rosestacker</artifactId>
|
||||||
|
<version>1.5.39</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import lol.hyper.hyperlib.releases.HyperUpdater;
|
|||||||
import lol.hyper.hyperlib.utils.TextUtils;
|
import lol.hyper.hyperlib.utils.TextUtils;
|
||||||
import lol.hyper.toolstats.commands.CommandToolStats;
|
import lol.hyper.toolstats.commands.CommandToolStats;
|
||||||
import lol.hyper.toolstats.events.*;
|
import lol.hyper.toolstats.events.*;
|
||||||
|
import lol.hyper.toolstats.support.rosestacker.RoseStacker;
|
||||||
import lol.hyper.toolstats.tools.*;
|
import lol.hyper.toolstats.tools.*;
|
||||||
import lol.hyper.toolstats.tools.config.ConfigTools;
|
import lol.hyper.toolstats.tools.config.ConfigTools;
|
||||||
import lol.hyper.toolstats.tools.config.ConfigUpdater;
|
import lol.hyper.toolstats.tools.config.ConfigUpdater;
|
||||||
@@ -74,6 +75,7 @@ public final class ToolStats extends JavaPlugin {
|
|||||||
public ToolStatsKeys toolStatsKeys;
|
public ToolStatsKeys toolStatsKeys;
|
||||||
public InventoryClose inventoryClose;
|
public InventoryClose inventoryClose;
|
||||||
public PlayerDrop playerDrop;
|
public PlayerDrop playerDrop;
|
||||||
|
public RoseStacker roseStacker = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
@@ -128,6 +130,10 @@ public final class ToolStats extends JavaPlugin {
|
|||||||
projectileShoot = new ProjectileShoot(this);
|
projectileShoot = new ProjectileShoot(this);
|
||||||
inventoryClose = new InventoryClose(this);
|
inventoryClose = new InventoryClose(this);
|
||||||
playerDrop = new PlayerDrop(this);
|
playerDrop = new PlayerDrop(this);
|
||||||
|
if (Bukkit.getPluginManager().isPluginEnabled("RoseStacker")) {
|
||||||
|
logger.info("RoseStacker has been detected, adding support!");
|
||||||
|
roseStacker = new RoseStacker();
|
||||||
|
}
|
||||||
|
|
||||||
Bukkit.getServer().getPluginManager().registerEvents(blockBreak, this);
|
Bukkit.getServer().getPluginManager().registerEvents(blockBreak, this);
|
||||||
Bukkit.getServer().getPluginManager().registerEvents(chunkPopulate, this);
|
Bukkit.getServer().getPluginManager().registerEvents(chunkPopulate, this);
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
import org.bukkit.projectiles.ProjectileSource;
|
import org.bukkit.projectiles.ProjectileSource;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
public class EntityDamage implements Listener {
|
public class EntityDamage implements Listener {
|
||||||
|
|
||||||
@@ -76,6 +77,9 @@ public class EntityDamage implements Listener {
|
|||||||
|
|
||||||
if (playerBeingAttacked) {
|
if (playerBeingAttacked) {
|
||||||
Player player = (Player) event.getEntity();
|
Player player = (Player) event.getEntity();
|
||||||
|
if (player.getGameMode() == GameMode.CREATIVE && !toolStats.config.getBoolean("allow-creative")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (player.isBlocking()) {
|
if (player.isBlocking()) {
|
||||||
double blockedDamage = -event.getDamage(EntityDamageEvent.DamageModifier.BLOCKING);
|
double blockedDamage = -event.getDamage(EntityDamageEvent.DamageModifier.BLOCKING);
|
||||||
updateShieldDamage(player.getInventory(), blockedDamage);
|
updateShieldDamage(player.getInventory(), blockedDamage);
|
||||||
@@ -85,6 +89,9 @@ public class EntityDamage implements Listener {
|
|||||||
// player attacks something
|
// player attacks something
|
||||||
if (playerAttacking) {
|
if (playerAttacking) {
|
||||||
Player player = (Player) damager;
|
Player player = (Player) damager;
|
||||||
|
if (player.getGameMode() == GameMode.CREATIVE && !toolStats.config.getBoolean("allow-creative")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
PlayerInventory playerAttackingInventory = player.getInventory();
|
PlayerInventory playerAttackingInventory = player.getInventory();
|
||||||
// make sure the item the player used is an item we want
|
// make sure the item the player used is an item we want
|
||||||
if (!toolStats.itemChecker.isMeleeWeapon(playerAttackingInventory.getItemInMainHand().getType())) {
|
if (!toolStats.itemChecker.isMeleeWeapon(playerAttackingInventory.getItemInMainHand().getType())) {
|
||||||
@@ -103,15 +110,15 @@ public class EntityDamage implements Listener {
|
|||||||
if (modDied) {
|
if (modDied) {
|
||||||
// player killed another player
|
// player killed another player
|
||||||
if (playerBeingAttacked) {
|
if (playerBeingAttacked) {
|
||||||
updateWeaponKills(playerAttackingInventory, "player");
|
updateWeaponKills(playerAttackingInventory, "player", null);
|
||||||
} else {
|
} else {
|
||||||
// player kills a regular mob
|
// player kills a regular mob
|
||||||
updateWeaponKills(playerAttackingInventory, "mob");
|
updateWeaponKills(playerAttackingInventory, "mob", mobBeingAttacked);
|
||||||
if (mobAttackedType == EntityType.WITHER) {
|
if (mobAttackedType == EntityType.WITHER) {
|
||||||
updateBossesKilled(playerAttackingInventory, "wither");
|
updateBossesKilled(playerAttackingInventory, "wither", mobBeingAttacked);
|
||||||
}
|
}
|
||||||
if (mobAttackedType == EntityType.ENDER_DRAGON) {
|
if (mobAttackedType == EntityType.ENDER_DRAGON) {
|
||||||
updateBossesKilled(playerAttackingInventory, "enderdragon");
|
updateBossesKilled(playerAttackingInventory, "enderdragon", mobBeingAttacked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -124,6 +131,9 @@ public class EntityDamage implements Listener {
|
|||||||
if (damager instanceof Trident trident) {
|
if (damager instanceof Trident trident) {
|
||||||
ProjectileSource source = trident.getShooter();
|
ProjectileSource source = trident.getShooter();
|
||||||
if (source instanceof Player player) {
|
if (source instanceof Player player) {
|
||||||
|
if (player.getGameMode() == GameMode.CREATIVE && !toolStats.config.getBoolean("allow-creative")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// update the trident's tracked damage
|
// update the trident's tracked damage
|
||||||
updateTridentDamage(trident, finalDamage);
|
updateTridentDamage(trident, finalDamage);
|
||||||
|
|
||||||
@@ -131,15 +141,15 @@ public class EntityDamage implements Listener {
|
|||||||
if (modDied) {
|
if (modDied) {
|
||||||
// if the trident killed a player, update the kills
|
// if the trident killed a player, update the kills
|
||||||
if (playerBeingAttacked) {
|
if (playerBeingAttacked) {
|
||||||
updateTridentKills(trident, "player");
|
updateTridentKills(trident, "player", null);
|
||||||
} else {
|
} else {
|
||||||
// the trident killed a mob, update the kills
|
// the trident killed a mob, update the kills
|
||||||
updateTridentKills(trident, "mob");
|
updateTridentKills(trident, "mob", mobBeingAttacked);
|
||||||
if (mobAttackedType == EntityType.WITHER) {
|
if (mobAttackedType == EntityType.WITHER) {
|
||||||
updateBossesKilled(player.getInventory(), "wither");
|
updateBossesKilled(player.getInventory(), "wither", mobBeingAttacked);
|
||||||
}
|
}
|
||||||
if (mobAttackedType == EntityType.ENDER_DRAGON) {
|
if (mobAttackedType == EntityType.ENDER_DRAGON) {
|
||||||
updateBossesKilled(player.getInventory(), "enderdragon");
|
updateBossesKilled(player.getInventory(), "enderdragon", mobBeingAttacked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -155,6 +165,9 @@ public class EntityDamage implements Listener {
|
|||||||
|
|
||||||
// a player shot the arrow
|
// a player shot the arrow
|
||||||
if (source instanceof Player shootingPlayer) {
|
if (source instanceof Player shootingPlayer) {
|
||||||
|
if (shootingPlayer.getGameMode() == GameMode.CREATIVE && !toolStats.config.getBoolean("allow-creative")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// update the player's bow damage
|
// update the player's bow damage
|
||||||
updateBowDamage(shootingPlayer.getInventory(), finalDamage);
|
updateBowDamage(shootingPlayer.getInventory(), finalDamage);
|
||||||
|
|
||||||
@@ -162,15 +175,15 @@ public class EntityDamage implements Listener {
|
|||||||
if (modDied) {
|
if (modDied) {
|
||||||
if (playerBeingAttacked) {
|
if (playerBeingAttacked) {
|
||||||
// player killed another player with an arrow
|
// player killed another player with an arrow
|
||||||
updateBowKills(shootingPlayer.getInventory(), "player");
|
updateBowKills(shootingPlayer.getInventory(), "player", null);
|
||||||
} else {
|
} else {
|
||||||
// player killed mob with an arrow
|
// player killed mob with an arrow
|
||||||
updateBowKills(shootingPlayer.getInventory(), "mob");
|
updateBowKills(shootingPlayer.getInventory(), "mob", mobBeingAttacked);
|
||||||
if (mobAttackedType == EntityType.WITHER) {
|
if (mobAttackedType == EntityType.WITHER) {
|
||||||
updateBossesKilledByBow(shootingPlayer.getInventory(), "wither");
|
updateBossesKilledByBow(shootingPlayer.getInventory(), "wither", mobBeingAttacked);
|
||||||
}
|
}
|
||||||
if (mobAttackedType == EntityType.ENDER_DRAGON) {
|
if (mobAttackedType == EntityType.ENDER_DRAGON) {
|
||||||
updateBossesKilledByBow(shootingPlayer.getInventory(), "enderdragon");
|
updateBossesKilledByBow(shootingPlayer.getInventory(), "enderdragon", mobBeingAttacked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -240,7 +253,7 @@ public class EntityDamage implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateBowKills(PlayerInventory playerInventory, String type) {
|
private void updateBowKills(PlayerInventory playerInventory, String type, LivingEntity entity) {
|
||||||
ItemStack heldBow = toolStats.itemChecker.getBow(playerInventory);
|
ItemStack heldBow = toolStats.itemChecker.getBow(playerInventory);
|
||||||
if (heldBow == null) {
|
if (heldBow == null) {
|
||||||
return;
|
return;
|
||||||
@@ -251,7 +264,12 @@ public class EntityDamage implements Listener {
|
|||||||
|
|
||||||
if (type.equalsIgnoreCase("mob")) {
|
if (type.equalsIgnoreCase("mob")) {
|
||||||
// player is shooting a mob
|
// player is shooting a mob
|
||||||
ItemMeta newBow = toolStats.itemLore.updateMobKills(heldBow, 1);
|
ItemMeta newBow;
|
||||||
|
int count = 1;
|
||||||
|
if (toolStats.roseStacker != null) {
|
||||||
|
count = toolStats.roseStacker.countMobs(entity);
|
||||||
|
}
|
||||||
|
newBow = toolStats.itemLore.updateMobKills(heldBow, count);
|
||||||
if (newBow != null) {
|
if (newBow != null) {
|
||||||
if (isMain && isOffHand) {
|
if (isMain && isOffHand) {
|
||||||
playerInventory.getItemInMainHand().setItemMeta(newBow);
|
playerInventory.getItemInMainHand().setItemMeta(newBow);
|
||||||
@@ -277,16 +295,20 @@ public class EntityDamage implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateTridentKills(Trident trident, String type) {
|
private void updateTridentKills(Trident trident, String type, LivingEntity entity) {
|
||||||
ItemStack newTrident = trident.getItemStack();
|
ItemStack newTrident = trident.getItemStack();
|
||||||
ItemMeta newKills;
|
ItemMeta newTridentMeta;
|
||||||
if (type.equalsIgnoreCase("player")) {
|
if (type.equalsIgnoreCase("player")) {
|
||||||
newKills = toolStats.itemLore.updatePlayerKills(trident.getItemStack(), 1);
|
newTridentMeta = toolStats.itemLore.updatePlayerKills(trident.getItemStack(), 1);
|
||||||
} else {
|
} else {
|
||||||
newKills = toolStats.itemLore.updateMobKills(trident.getItemStack(), 1);
|
int count = 1;
|
||||||
|
if (toolStats.roseStacker != null) {
|
||||||
|
count = toolStats.roseStacker.countMobs(entity);
|
||||||
|
}
|
||||||
|
newTridentMeta = toolStats.itemLore.updateMobKills(newTrident, count);
|
||||||
}
|
}
|
||||||
if (newKills != null) {
|
if (newTridentMeta != null) {
|
||||||
newTrident.setItemMeta(newKills);
|
newTrident.setItemMeta(newTridentMeta);
|
||||||
trident.setItemStack(newTrident);
|
trident.setItemStack(newTrident);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -308,29 +330,37 @@ public class EntityDamage implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateWeaponKills(PlayerInventory playerInventory, String type) {
|
private void updateWeaponKills(PlayerInventory playerInventory, String type, LivingEntity entity) {
|
||||||
ItemStack heldWeapon = playerInventory.getItemInMainHand();
|
ItemStack heldWeapon = playerInventory.getItemInMainHand();
|
||||||
ItemMeta newHeldWeaponMeta = null;
|
ItemMeta newHeldWeaponMeta = null;
|
||||||
if (type.equalsIgnoreCase("player")) {
|
if (type.equalsIgnoreCase("player")) {
|
||||||
newHeldWeaponMeta = toolStats.itemLore.updatePlayerKills(heldWeapon, 1);
|
newHeldWeaponMeta = toolStats.itemLore.updatePlayerKills(heldWeapon, 1);
|
||||||
}
|
}
|
||||||
if (type.equalsIgnoreCase("mob")) {
|
if (type.equalsIgnoreCase("mob")) {
|
||||||
newHeldWeaponMeta = toolStats.itemLore.updateMobKills(heldWeapon, 1);
|
int count = 1;
|
||||||
|
if (toolStats.roseStacker != null) {
|
||||||
|
count = toolStats.roseStacker.countMobs(entity);
|
||||||
|
}
|
||||||
|
newHeldWeaponMeta = toolStats.itemLore.updateMobKills(heldWeapon, count);
|
||||||
}
|
}
|
||||||
if (newHeldWeaponMeta != null) {
|
if (newHeldWeaponMeta != null) {
|
||||||
playerInventory.getItemInMainHand().setItemMeta(newHeldWeaponMeta);
|
playerInventory.getItemInMainHand().setItemMeta(newHeldWeaponMeta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateBossesKilled(PlayerInventory playerInventory, String boss) {
|
private void updateBossesKilled(PlayerInventory playerInventory, String boss, LivingEntity entity) {
|
||||||
ItemStack heldWeapon = playerInventory.getItemInMainHand();
|
ItemStack heldWeapon = playerInventory.getItemInMainHand();
|
||||||
ItemMeta newHeldWeaponMeta = toolStats.itemLore.updateBossesKilled(heldWeapon, 1, boss);
|
int count = 1;
|
||||||
|
if (toolStats.roseStacker != null) {
|
||||||
|
count = toolStats.roseStacker.countMobs(entity);
|
||||||
|
}
|
||||||
|
ItemMeta newHeldWeaponMeta = toolStats.itemLore.updateBossesKilled(heldWeapon, count, boss);
|
||||||
if (newHeldWeaponMeta != null) {
|
if (newHeldWeaponMeta != null) {
|
||||||
playerInventory.getItemInMainHand().setItemMeta(newHeldWeaponMeta);
|
playerInventory.getItemInMainHand().setItemMeta(newHeldWeaponMeta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateBossesKilledByBow(PlayerInventory playerInventory, String boss) {
|
private void updateBossesKilledByBow(PlayerInventory playerInventory, String boss, LivingEntity entity) {
|
||||||
ItemStack heldBow = toolStats.itemChecker.getBow(playerInventory);
|
ItemStack heldBow = toolStats.itemChecker.getBow(playerInventory);
|
||||||
if (heldBow == null) {
|
if (heldBow == null) {
|
||||||
return;
|
return;
|
||||||
@@ -339,7 +369,12 @@ public class EntityDamage implements Listener {
|
|||||||
boolean isMain = playerInventory.getItemInMainHand().getType() == Material.BOW || playerInventory.getItemInMainHand().getType() == Material.CROSSBOW;
|
boolean isMain = playerInventory.getItemInMainHand().getType() == Material.BOW || playerInventory.getItemInMainHand().getType() == Material.CROSSBOW;
|
||||||
boolean isOffHand = playerInventory.getItemInOffHand().getType() == Material.BOW || playerInventory.getItemInOffHand().getType() == Material.CROSSBOW;
|
boolean isOffHand = playerInventory.getItemInOffHand().getType() == Material.BOW || playerInventory.getItemInOffHand().getType() == Material.CROSSBOW;
|
||||||
|
|
||||||
ItemMeta newHeldWeaponMeta = toolStats.itemLore.updateBossesKilled(heldBow, 1, boss);
|
int count = 1;
|
||||||
|
if (toolStats.roseStacker != null) {
|
||||||
|
count = toolStats.roseStacker.countMobs(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemMeta newHeldWeaponMeta = toolStats.itemLore.updateBossesKilled(heldBow, count, boss);
|
||||||
if (newHeldWeaponMeta != null) {
|
if (newHeldWeaponMeta != null) {
|
||||||
if (isMain && isOffHand) {
|
if (isMain && isOffHand) {
|
||||||
playerInventory.getItemInMainHand().setItemMeta(newHeldWeaponMeta);
|
playerInventory.getItemInMainHand().setItemMeta(newHeldWeaponMeta);
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of ToolStats.
|
||||||
|
*
|
||||||
|
* ToolStats is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* ToolStats is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with ToolStats. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of ToolStats.
|
||||||
|
*
|
||||||
|
* ToolStats is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* ToolStats is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with ToolStats. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package lol.hyper.toolstats.support.rosestacker;
|
||||||
|
|
||||||
|
import dev.rosewood.rosestacker.api.RoseStackerAPI;
|
||||||
|
import dev.rosewood.rosestacker.stack.StackedEntity;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
|
||||||
|
public class RoseStacker {
|
||||||
|
|
||||||
|
private final RoseStackerAPI rsAPI;
|
||||||
|
|
||||||
|
public RoseStacker() {
|
||||||
|
this.rsAPI = RoseStackerAPI.getInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int countMobs(LivingEntity entity) {
|
||||||
|
if (!rsAPI.isEntityStacked(entity)) {
|
||||||
|
// if the entity is not stacked, ignore
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
StackedEntity stackedEntity = rsAPI.getStackedEntity(entity);
|
||||||
|
if (stackedEntity == null) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean killAll = stackedEntity.getStackSettings().shouldKillEntireStackOnDeath();
|
||||||
|
// if we kill the entire stack, add the entire stack to the count
|
||||||
|
if (killAll) {
|
||||||
|
return stackedEntity.getStackSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1410,7 +1410,6 @@ public class ItemLore {
|
|||||||
}
|
}
|
||||||
List<Component> newLore = updateItemLore(meta, oldLine, newLine);
|
List<Component> newLore = updateItemLore(meta, oldLine, newLine);
|
||||||
meta.lore(newLore);
|
meta.lore(newLore);
|
||||||
toolStats.logger.info(meta.toString());
|
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,3 +30,9 @@ permissions:
|
|||||||
toolstats.remove:
|
toolstats.remove:
|
||||||
description: Allows the usage of /toolstats remove.
|
description: Allows the usage of /toolstats remove.
|
||||||
default: op
|
default: op
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
server:
|
||||||
|
RoseStacker:
|
||||||
|
load: BEFORE
|
||||||
|
required: false
|
||||||
Reference in New Issue
Block a user