Browse Source

Hacky fix for spigot bug

nossr50 5 năm trước cách đây
mục cha
commit
055391e908

+ 0 - 21
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.
      *

+ 0 - 1
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";

+ 3 - 1
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);
             }
         }

+ 0 - 1
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