mirror of
https://github.com/songoda/EpicHoppers.git
synced 2024-11-25 11:46:45 +01:00
Cleaned up imports.
This commit is contained in:
parent
8f558e4976
commit
3d240aeb6c
@ -1,6 +1,10 @@
|
||||
package com.songoda.epichoppers.boost;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class BoostManager {
|
||||
|
||||
|
@ -4,7 +4,11 @@ import com.songoda.core.database.DataManagerAbstract;
|
||||
import com.songoda.core.database.DatabaseConnector;
|
||||
import com.songoda.epichoppers.EpicHoppers;
|
||||
import com.songoda.epichoppers.boost.BoostData;
|
||||
import com.songoda.epichoppers.hopper.*;
|
||||
import com.songoda.epichoppers.hopper.Filter;
|
||||
import com.songoda.epichoppers.hopper.Hopper;
|
||||
import com.songoda.epichoppers.hopper.HopperBuilder;
|
||||
import com.songoda.epichoppers.hopper.ItemType;
|
||||
import com.songoda.epichoppers.hopper.LinkType;
|
||||
import com.songoda.epichoppers.utils.TeleportTrigger;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
@ -20,7 +24,12 @@ import java.io.IOException;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Statement;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class DataManager extends DataManagerAbstract {
|
||||
|
@ -11,11 +11,19 @@ import com.songoda.epichoppers.player.PlayerData;
|
||||
import com.songoda.epichoppers.utils.CostType;
|
||||
import com.songoda.epichoppers.utils.Methods;
|
||||
import com.songoda.epichoppers.utils.TeleportTrigger;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Created by songoda on 3/14/2017.
|
||||
|
@ -7,7 +7,10 @@ import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class HopperManager {
|
||||
|
||||
|
@ -7,7 +7,11 @@ import com.songoda.epichoppers.hopper.levels.modules.Module;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.NavigableMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
public class LevelManager {
|
||||
|
||||
|
@ -18,7 +18,15 @@ import org.bukkit.inventory.ShapedRecipe;
|
||||
import org.bukkit.inventory.ShapelessRecipe;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class ModuleAutoCrafting extends Module {
|
||||
|
@ -18,9 +18,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
@ -77,7 +77,7 @@ public class ModuleSuction extends Module {
|
||||
&& entity.getLocation().getBlock().getType() != Material.HOPPER)
|
||||
.map(entity -> (Item) entity)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
|
||||
if (itemsToSuck.isEmpty())
|
||||
return;
|
||||
|
||||
@ -89,7 +89,7 @@ public class ModuleSuction extends Module {
|
||||
inventoryHolder = (InventoryHolder) hopper.getBlock().getState();
|
||||
hopperInventory = Bukkit.createInventory(inventoryHolder, InventoryType.HOPPER);
|
||||
}
|
||||
|
||||
|
||||
for (Item item : itemsToSuck) {
|
||||
|
||||
ItemStack itemStack = item.getItemStack();
|
||||
@ -129,7 +129,7 @@ public class ModuleSuction extends Module {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Settings.EMIT_INVENTORYPICKUPITEMEVENT.getBoolean()) {
|
||||
hopperInventory.setContents(hopperCache.cachedInventory);
|
||||
InventoryPickupItemEvent pickupevent = new InventoryPickupItemEvent(hopperInventory, item);
|
||||
|
@ -1,33 +1,22 @@
|
||||
package com.songoda.epichoppers.listeners;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.compatibility.ServerVersion;
|
||||
import com.songoda.epichoppers.EpicHoppers;
|
||||
import com.songoda.epichoppers.hopper.Hopper;
|
||||
import com.songoda.epichoppers.hopper.HopperBuilder;
|
||||
import com.songoda.epichoppers.hopper.levels.Level;
|
||||
import com.songoda.epichoppers.settings.Settings;
|
||||
import com.songoda.epichoppers.utils.Methods;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.ExperienceOrb;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Random;
|
||||
|
||||
|
||||
|
@ -6,7 +6,6 @@ import com.songoda.epichoppers.hopper.Hopper;
|
||||
import com.songoda.epichoppers.player.PlayerData;
|
||||
import com.songoda.epichoppers.player.SyncType;
|
||||
import com.songoda.epichoppers.settings.Settings;
|
||||
import com.songoda.epichoppers.utils.Methods;
|
||||
import com.songoda.epichoppers.utils.TeleportTrigger;
|
||||
import com.songoda.skyblock.SkyBlock;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -21,7 +20,6 @@ import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerToggleSneakEvent;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
/**
|
||||
* Created by songoda on 3/14/2017.
|
||||
|
@ -2,7 +2,11 @@ package com.songoda.epichoppers.player;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class PlayerDataManager {
|
||||
|
||||
|
@ -86,9 +86,9 @@ public class Settings {
|
||||
"Supported plugins you have installed: \"" + EconomyManager.getManager().getRegisteredPlugins().stream().collect(Collectors.joining("\", \"")) + "\".");
|
||||
|
||||
public static final ConfigSetting EMIT_INVENTORYPICKUPITEMEVENT = new ConfigSetting(config, "Main.Emit InventoryPickupItemEvent", false,
|
||||
"This event is used by other plugin to modify or monitor the behavior when a hopper picks up items on the ground.",
|
||||
"However it is a high frequency event and may have an impact on your server performance which is why it is disabled by default.",
|
||||
"If you absolutely need this enable it but be aware of the potential performance impact.");
|
||||
"This event is used by other plugin to modify or monitor the behavior when a hopper picks up items on the ground.",
|
||||
"However it is a high frequency event and may have an impact on your server performance which is why it is disabled by default.",
|
||||
"If you absolutely need this enable it but be aware of the potential performance impact.");
|
||||
|
||||
public static final ConfigSetting ECO_ICON = new ConfigSetting(config, "Interfaces.Economy Icon", "SUNFLOWER");
|
||||
public static final ConfigSetting XP_ICON = new ConfigSetting(config, "Interfaces.XP Icon", "EXPERIENCE_BOTTLE");
|
||||
|
@ -26,7 +26,12 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
@ -262,10 +267,10 @@ public class HopTask extends BukkitRunnable {
|
||||
Collection<Entity> nearbyEntities = null;
|
||||
StorageContainerCache.Cache aboveCache = null;
|
||||
if ((isFarmItem = this.isFarmItem(above))
|
||||
|| (above.getType() != Material.AIR)
|
||||
&& (above.getType() != Material.HOPPER || HopperDirection.getDirection(above.getState().getRawData()) != HopperDirection.DOWN)
|
||||
&& (aboveCache = StorageContainerCache.getCachedInventory(above)) != null
|
||||
|| !(nearbyEntities = above.getWorld().getNearbyEntities(above.getLocation().clone(), 0.5, 0.5, 0.5)).isEmpty()) {
|
||||
|| (above.getType() != Material.AIR)
|
||||
&& (above.getType() != Material.HOPPER || HopperDirection.getDirection(above.getState().getRawData()) != HopperDirection.DOWN)
|
||||
&& (aboveCache = StorageContainerCache.getCachedInventory(above)) != null
|
||||
|| !(nearbyEntities = above.getWorld().getNearbyEntities(above.getLocation().clone(), 0.5, 0.5, 0.5)).isEmpty()) {
|
||||
// Get the inventory holder. Special check for EpicFarming.
|
||||
// Get the slots that we can pull items from.
|
||||
InventoryHolder aboveInvHolder;
|
||||
|
@ -81,7 +81,7 @@ public class StorageContainerCache {
|
||||
} else {
|
||||
// legacy check
|
||||
Material material = block.getType();
|
||||
BlockFace[] faces = new BlockFace[] {BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.WEST};
|
||||
BlockFace[] faces = new BlockFace[]{BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.WEST};
|
||||
for (BlockFace face : faces) {
|
||||
Block adjacentBlock = block.getRelative(face);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user