Merge branch 'development'

This commit is contained in:
Brianna 2020-02-11 06:35:19 -05:00
commit 905554fbc1
3 changed files with 5 additions and 3 deletions

View File

@ -2,7 +2,7 @@
<groupId>com.songoda</groupId>
<artifactId>EpicHoppers</artifactId>
<modelVersion>4.0.0</modelVersion>
<version>4.4.3</version>
<version>4.4.4</version>
<build>
<defaultGoal>clean install</defaultGoal>
<finalName>EpicHoppers-${project.version}</finalName>

View File

@ -39,7 +39,7 @@ public class HopperListeners implements Listener {
Location sourceLocation = source.getHolder() instanceof BlockState ? ((BlockState) source.getHolder()).getLocation() : null;
Location destinationLocation = destination.getHolder() instanceof BlockState ? ((BlockState) destination.getHolder()).getLocation() : null;
if (Settings.ALLOW_NORMAL_HOPPERS.getBoolean() && !instance.getHopperManager().isHopper(sourceLocation))
if (sourceLocation != null && Settings.ALLOW_NORMAL_HOPPERS.getBoolean() && !instance.getHopperManager().isHopper(sourceLocation))
return;
// Hopper minecarts should be able to take care of themselves
@ -69,7 +69,7 @@ public class HopperListeners implements Listener {
// Special cases when a hopper is picking up items
if (destination.getHolder() instanceof org.bukkit.block.Hopper) {
if (Settings.ALLOW_NORMAL_HOPPERS.getBoolean() && !instance.getHopperManager().isHopper(destinationLocation))
if (destinationLocation != null && Settings.ALLOW_NORMAL_HOPPERS.getBoolean() && !instance.getHopperManager().isHopper(destinationLocation))
return;
// minecraft 1.8 doesn't have a method to get the hopper's location from the inventory, so we use the holder instead
Hopper toHopper = instance.getHopperManager().getHopper(destinationLocation);

View File

@ -4,6 +4,7 @@ import com.songoda.core.configuration.Config;
import com.songoda.epichoppers.EpicHoppers;
import com.songoda.epichoppers.boost.BoostData;
import com.songoda.epichoppers.hopper.Hopper;
import com.songoda.epichoppers.settings.Settings;
import com.songoda.epichoppers.utils.Methods;
import java.util.ArrayList;
@ -34,6 +35,7 @@ public abstract class Storage {
if (hopper.getLevel() == null
|| hopper.getLocation() == null
|| hopper.getLevel() == instance.getLevelManager().getLowestLevel()
&& !Settings.ALLOW_NORMAL_HOPPERS.getBoolean()
&& (hopper.getLinkedBlocks() == null || hopper.getLinkedBlocks().isEmpty()))
continue;