1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00
This commit is contained in:
TheBusyBiscuit 2020-09-21 13:09:45 +02:00
parent 0227e0cc30
commit cdc495e62b
2 changed files with 15 additions and 3 deletions

View File

@ -37,6 +37,7 @@
* Fixed Cheat Sheet Slimefun Guide being unable to open the settings menu via shift + right click
* Fixed #2320
* Fixed some issues with ChestTerminal
* Fixed #2325
## Release Candidate 16 (07 Sep 2020)
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#16

View File

@ -133,11 +133,19 @@ public class TalismanListener implements Listener {
LivingEntity entity = e.getEntity();
if (!(entity instanceof Player) && !(entity instanceof ArmorStand) && Talisman.checkFor(e, SlimefunItems.TALISMAN_HUNTER)) {
if (entity instanceof Player || entity instanceof ArmorStand) {
// We absolutely don't want to double the
// drops from players or ArmorStands
return;
}
// We are also excluding entities which can pickup items, this is not perfect
// but it at least prevents dupes by tossing items to zombies
if (!entity.getCanPickupItems() && Talisman.checkFor(e, SlimefunItems.TALISMAN_HUNTER)) {
Collection<ItemStack> extraDrops = getExtraDrops(e.getEntity(), e.getDrops());
for (ItemStack drop : extraDrops) {
if (drop != null) {
if (drop != null && drop.getType() != Material.AIR) {
e.getDrops().add(drop.clone());
}
}
@ -163,7 +171,10 @@ public class TalismanListener implements Listener {
}
}
// Prevent duplication of handheld items or armor
// WARNING: This check is broken as entities now set their
// equipment to NULL before calling the event!
// Prevents duplication of handheld items or armor
EntityEquipment equipment = entity.getEquipment();
if (equipment != null) {
for (ItemStack item : equipment.getArmorContents()) {