Item drops added by MMOCore are now dropped more naturally and have a much lower (if not 0%) chance of glitching through the ceiling

Also increased the spawn height of Fishing Holograms
This commit is contained in:
ASangarin 2020-12-15 20:41:04 +01:00
parent 0f6b6fc29c
commit 0aa36dacd5
3 changed files with 4 additions and 3 deletions

Binary file not shown.

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmocore.listener; package net.Indyuce.mmocore.listener;
import net.mmogroup.mmolib.UtilityMethods;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
@ -121,7 +122,7 @@ public class BlockListener implements Listener {
!block.getType().isSolid() || !(info.regenerates() && info.getRegenerationInfo().hasTemporaryBlock())); !block.getType().isSolid() || !(info.regenerates() && info.getRegenerationInfo().hasTemporaryBlock()));
for (ItemStack drop : called.getDrops()) for (ItemStack drop : called.getDrops())
if (drop.getType() != Material.AIR && drop.getAmount() > 0) if (drop.getType() != Material.AIR && drop.getAmount() > 0)
block.getWorld().dropItemNaturally(dropLocation, drop); UtilityMethods.dropItemNaturally(dropLocation, drop);
} }
/* /*

View File

@ -54,7 +54,7 @@ public class FishingListener implements Listener {
new FishingData(player, hook, table); new FishingData(player, hook, table);
if (MMOCore.plugin.hasHolograms()) if (MMOCore.plugin.hasHolograms())
MMOCore.plugin.hologramSupport.displayIndicator(hook.getLocation(), MMOCore.plugin.hologramSupport.displayIndicator(hook.getLocation().add(0, 1.25, 0),
MMOCore.plugin.configManager.getSimpleMessage("caught-fish").message()); MMOCore.plugin.configManager.getSimpleMessage("caught-fish").message());
} }
} }
@ -170,7 +170,7 @@ public class FishingListener implements Listener {
// calculate velocity // calculate velocity
Item item = hook.getWorld().dropItemNaturally(hook.getLocation(), collect); Item item = hook.getWorld().dropItemNaturally(hook.getLocation(), collect);
if (MMOCore.plugin.hasHolograms()) if (MMOCore.plugin.hasHolograms())
MMOCore.plugin.hologramSupport.displayIndicator(location, MMOCore.plugin.hologramSupport.displayIndicator(location.add(0, 1.25, 0),
MMOCore.plugin.configManager.getSimpleMessage("fish-out-water" + (isCrit() ? "-crit" : "")).message()); MMOCore.plugin.configManager.getSimpleMessage("fish-out-water" + (isCrit() ? "-crit" : "")).message());
Vector vec = player.getLocation().subtract(hook.getLocation()).toVector(); Vector vec = player.getLocation().subtract(hook.getLocation()).toVector();
vec.setY(vec.getY() * .031 + vec.length() * .05); vec.setY(vec.getY() * .031 + vec.length() * .05);