Merge branch 'development'

This commit is contained in:
Brianna 2020-01-24 18:04:28 -05:00
commit fdc91246f5
4 changed files with 13 additions and 9 deletions

View File

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

View File

@ -157,14 +157,13 @@ public class BlockListeners implements Listener {
break;
}
if (location == null) return;
if (location == null
|| location.getBlock().getType() != Material.CHEST
|| Settings.SYNC_TOUCH_BLACKLIST.getStringList().contains(event.getBlock().getType().name())
if (location.getBlock().getType() != Material.CHEST) return;
if (event.getBlock().getType().name().contains("SHULKER")
|| (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13) ? event.getBlock().getType() == Material.SPAWNER : event.getBlock().getType() == Material.valueOf("MOB_SPAWNER"))
|| event.getBlock().getType() == Material.HOPPER
|| event.getBlock().getType() == Material.DISPENSER) {
|| event.getBlock().getType().name().contains("SHULKER")
|| (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13) ? event.getBlock().getType() == Material.SPAWNER
: event.getBlock().getType() == Material.valueOf("MOB_SPAWNER"))) {
return;
}

View File

@ -51,6 +51,11 @@ public class Settings {
"The amount of time in ticks a player has between hitting the hopper",
"Link button and performing the link. When the time is up the link event is canceled.");
public static final ConfigSetting SYNC_TOUCH_BLACKLIST = new ConfigSetting(config, "Main.Sync Touch Blacklist",
Arrays.asList("CHEST", "FURNACE", "HOPPER"),
"Items that shouldn't work with Sync touch. You should put items in here",
"that other plugins use to store data with.");
public static final ConfigSetting MAX_CHUNK = new ConfigSetting(config, "Main.Max Hoppers Per Chunk", -1,
"The maximum amount of hoppers per chunk.");

View File

@ -450,7 +450,7 @@ public class HopTask extends BukkitRunnable {
// Create item that will be moved.
ItemStack itemToMove = item.clone();
itemToMove.setAmount(item.getAmount() < maxToMove ? item.getAmount() : maxToMove);
itemToMove.setAmount(Math.min(item.getAmount(), maxToMove));
// Process whitelist and blacklist.
boolean blocked = (!hopper.getFilter().getWhiteList().isEmpty() && hopper.getFilter().getWhiteList().stream().noneMatch(itemStack -> itemStack.isSimilar(item))