Fixed issue auto linking down.

This commit is contained in:
Brianna O'Keefe 2019-02-17 19:34:32 -05:00
parent c255d41039
commit 8f40597f09
2 changed files with 9 additions and 9 deletions

View File

@ -31,18 +31,18 @@ public class HopperListeners implements Listener {
if (!(source.getHolder() instanceof org.bukkit.block.Hopper)) return;
if (source.getLocation().getBlock().getRelative(BlockFace.DOWN).equals(event.getDestination().getLocation().getBlock())) return;
if (instance.isLiquidtanks() && net.arcaniax.liquidtanks.object.LiquidTankAPI.isLiquidTank(event.getDestination().getLocation()))
return;
Hopper hopper = instance.getHopperManager().getHopper(source.getLocation());
if ((hopper.getLinkedBlocks() == null || hopper.getLinkedBlocks().isEmpty())) {
hopper.clearLinkedBlocks();
Location location = event.getDestination().getLocation();
if (location.getBlock() instanceof InventoryHolder)
hopper.addLinkedBlock(location);
}
if (!(event.getDestination().getLocation().getBlock().getState() instanceof InventoryHolder)) return;
hopper.clearLinkedBlocks();
hopper.addLinkedBlock(event.getDestination().getLocation());
event.setCancelled(true);
event.setCancelled(true);
} catch (Exception ee) {
Debugger.runReport(ee);

View File

@ -18,7 +18,7 @@ public abstract class Storage {
public Storage(EpicHoppersPlugin instance) {
this.instance = instance;
this.dataFile = new ConfigWrapper(instance, "", "data.yml");
this.dataFile.createNewFile(null, "EpicSpawners Data File");
this.dataFile.createNewFile(null, "EpicHoppers Data File");
this.dataFile.getConfig().options().copyDefaults(true);
this.dataFile.saveConfig();
}