mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2025-12-06 06:41:44 +00:00
Compare commits
1 Commits
1.9.2-hotf
...
1.9.2-hotf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb5345bd14 |
2
pom.xml
2
pom.xml
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<groupId>lol.hyper</groupId>
|
<groupId>lol.hyper</groupId>
|
||||||
<artifactId>toolstats</artifactId>
|
<artifactId>toolstats</artifactId>
|
||||||
<version>1.9.2-hotfix</version>
|
<version>1.9.2-hotfix-2</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>ToolStats</name>
|
<name>ToolStats</name>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package lol.hyper.toolstats.events;
|
|||||||
|
|
||||||
import lol.hyper.toolstats.ToolStats;
|
import lol.hyper.toolstats.ToolStats;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -119,17 +120,32 @@ public class EntityDamage implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean isMain = shootingPlayerInventory.getItemInMainHand().getType() == Material.BOW || shootingPlayerInventory.getItemInMainHand().getType() == Material.CROSSBOW;
|
||||||
|
boolean isOffHand = shootingPlayerInventory.getItemInOffHand().getType() == Material.BOW || shootingPlayerInventory.getItemInOffHand().getType() == Material.CROSSBOW;
|
||||||
|
|
||||||
// player is shooting another player
|
// player is shooting another player
|
||||||
if (mobBeingAttacked instanceof Player) {
|
if (mobBeingAttacked instanceof Player) {
|
||||||
ItemMeta newItem = toolStats.itemLore.updatePlayerKills(heldBow, 1);
|
ItemMeta newBow = toolStats.itemLore.updatePlayerKills(heldBow, 1);
|
||||||
if (newItem != null) {
|
if (newBow != null) {
|
||||||
shootingPlayerInventory.getItemInMainHand().setItemMeta(newItem);
|
if (isMain && isOffHand) {
|
||||||
|
shootingPlayerInventory.getItemInMainHand().setItemMeta(newBow);
|
||||||
|
} else if (isMain) {
|
||||||
|
shootingPlayerInventory.getItemInMainHand().setItemMeta(newBow);
|
||||||
|
} else if (isOffHand) {
|
||||||
|
shootingPlayerInventory.getItemInOffHand().setItemMeta(newBow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// player is shooting a mob
|
// player is shooting a mob
|
||||||
ItemMeta newItem = toolStats.itemLore.updateMobKills(heldBow, 1);
|
ItemMeta newBow = toolStats.itemLore.updateMobKills(heldBow, 1);
|
||||||
if (newItem != null) {
|
if (newBow != null) {
|
||||||
shootingPlayerInventory.getItemInMainHand().setItemMeta(newItem);
|
if (isMain && isOffHand) {
|
||||||
|
shootingPlayerInventory.getItemInMainHand().setItemMeta(newBow);
|
||||||
|
} else if (isMain) {
|
||||||
|
shootingPlayerInventory.getItemInMainHand().setItemMeta(newBow);
|
||||||
|
} else if (isOffHand) {
|
||||||
|
shootingPlayerInventory.getItemInOffHand().setItemMeta(newBow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
trackedMobs.add(mobBeingAttacked.getUniqueId());
|
trackedMobs.add(mobBeingAttacked.getUniqueId());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user