Skip to content

Commit f84c870

Browse files
authored
Merge pull request #25 from ChafficPlugins/24-mininglevels-spams-an-error-on-block-break
24 mininglevels spams an error on block break
2 parents 5173e45 + c65a098 commit f84c870

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/main/java/de/chafficplugins/mininglevels/listeners/events/MiningEvents.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ public void onBlockBreak(final BlockBreakEvent event) {
102102
if (MathUtils.randomDouble(0, 100) < level.getExtraOreProbability()) {
103103
Block actualBlock = event.getBlock();
104104
int amount = (int) MathUtils.randomDouble(1, level.getMaxExtraOre());
105+
ItemStack item = actualBlock.getDrops().iterator().next();
105106
for (int i = 0; i < amount; i++) {
106-
event.getPlayer().getWorld().dropItemNaturally(actualBlock.getLocation(), actualBlock.getDrops().iterator().next());
107+
event.getPlayer().getWorld().dropItemNaturally(actualBlock.getLocation(), item);
107108
}
108109
sendDebug(event.getPlayer(), "BlockBreakEvent: " + "Dropped " + amount + " extra ores.");
109110
}

src/main/java/de/chafficplugins/mininglevels/utils/Crucial.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,6 @@ public static boolean connect() throws IOException {
8484
plugin.log("Please download it from: https://www.spigotmc.org/resources/crucialapi.86380/");
8585
return false;
8686
}
87-
if (!Server.checkCompatibility("1.18", "1.17", "1.16", "1.15")) {
88-
plugin.error("Error 3: Wrong server version. Please use a supported version.");
89-
plugin.log("This is NOT a bug. Do NOT report this!");
90-
Bukkit.getPluginManager().disablePlugin(plugin);
91-
return false;
92-
}
9387
return true;
9488
}
9589
plugin.error("Error 26: Failed to connect to CrucialAPI.");

0 commit comments

Comments
 (0)