From 055391e908037d671abe2c386c98d2ea00705bc0 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 24 Jan 2020 00:43:18 -0800 Subject: [PATCH] Hacky fix for spigot bug --- .../nossr50/listeners/EntityListener.java | 21 ------------------- src/main/java/com/gmail/nossr50/mcMMO.java | 1 - .../nossr50/skills/mining/MiningManager.java | 4 +++- .../nossr50/util/random/RandomChanceUtil.java | 1 - 4 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 4b6d92ce4..c74c7d74d 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -841,27 +841,6 @@ public class EntityListener implements Listener { } } - /** - * Handle EntityExplode events that involve modifying the event. - * - * @param event - * The event to modify - */ - @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) - public void onEntityExplodeMonitor(EntityExplodeEvent event) { - /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) - return; - - Entity entity = event.getEntity(); - - if (!(entity instanceof TNTPrimed) || !entity.hasMetadata(mcMMO.tntsafeMetadataKey)) { - return; - } - - event.blockList().clear(); - } - /** * Handle FoodLevelChange events that involve modifying the event. * diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index ef68ff0ec..4244069f5 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -115,7 +115,6 @@ public class mcMMO extends JavaPlugin { public final static String furnaceMetadataKey = "mcMMO: Tracked Furnace"; public final static String tntMetadataKey = "mcMMO: Tracked TNT"; public final static String funfettiMetadataKey = "mcMMO: Funfetti"; - public final static String tntsafeMetadataKey = "mcMMO: Safe TNT"; public final static String customNameKey = "mcMMO: Custom Name"; public final static String customVisibleKey = "mcMMO: Name Visibility"; public final static String droppedItemKey = "mcMMO: Tracked Item"; diff --git a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java index 490ba011b..00853db63 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -134,6 +134,7 @@ public class MiningManager extends SkillManager { int xp = 0; float oreBonus = (float) (getOreBonus() / 100); + //TODO: Pretty sure something is fucked with debrisReduction stuff float debrisReduction = (float) (getDebrisReduction() / 100); int dropMultiplier = getDropMultiplier(); @@ -145,7 +146,8 @@ public class MiningManager extends SkillManager { if (BlockUtils.isOre(blockState)) { ores.add(blockState); } - else { + //Server bug that allows beacons to be duped when yield is set to 0 + else if(blockState.getType() != Material.BEACON) { debris.add(blockState); } } diff --git a/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java b/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java index f01c56e60..bcc29ee1f 100644 --- a/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java +++ b/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java @@ -12,7 +12,6 @@ import com.gmail.nossr50.util.skills.SkillActivationType; import org.bukkit.entity.Player; import java.text.DecimalFormat; -import java.util.Random; import java.util.concurrent.ThreadLocalRandom; public class RandomChanceUtil