mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-12-31 21:07:47 +01:00
Added 1.15 Support.
This commit is contained in:
parent
e445d816eb
commit
17ba2879dd
4
pom.xml
4
pom.xml
@ -105,8 +105,8 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.14.4-R0.1-SNAPSHOT</version>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.15</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -108,15 +108,15 @@ public class DeathListeners implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onEntityHit(EntityDamageByEntityEvent event) {
|
||||
if (!(event.getDamager() instanceof Player)) return;
|
||||
if (!(event.getDamager() instanceof Player) || ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_12)) return;
|
||||
if (!instance.getEntityStackManager().isStacked(event.getEntity())) return;
|
||||
EntityStack stack = instance.getEntityStackManager().getStack(event.getEntity());
|
||||
|
||||
if (Settings.KILL_WHOLE_STACK_ON_DEATH.getBoolean() && Settings.REALISTIC_DAMAGE.getBoolean()) {
|
||||
Player player = (Player) event.getDamager();
|
||||
ItemStack tool = player.getInventory().getItemInHand();
|
||||
if (tool.getType().getMaxDurability() < 1 || (tool.getItemMeta() != null && (tool.getItemMeta().spigot().isUnbreakable()
|
||||
|| (ServerProject.isServer(ServerProject.SPIGOT, ServerProject.PAPER) && tool.getItemMeta().spigot().isUnbreakable()))))
|
||||
if (tool.getType().getMaxDurability() < 1 || (tool.getItemMeta() != null && (tool.getItemMeta().isUnbreakable()
|
||||
|| (ServerProject.isServer(ServerProject.SPIGOT, ServerProject.PAPER) && tool.getItemMeta().isUnbreakable()))))
|
||||
return;
|
||||
|
||||
int unbreakingLevel = tool.getEnchantmentLevel(Enchantment.DURABILITY);
|
||||
|
Loading…
Reference in New Issue
Block a user