mirror of
https://github.com/songoda/EpicHoppers.git
synced 2025-01-24 08:31:26 +01:00
Fixed issue auto linking down.
This commit is contained in:
parent
c255d41039
commit
8f40597f09
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user