From dc013a18f73b89030d65e974c8a2a88f5f03ab96 Mon Sep 17 00:00:00 2001 From: Brianna Date: Mon, 27 May 2019 17:06:12 -0400 Subject: [PATCH] Fix for burning furnaces 1.12- --- .gitlab-ci.yml | 2 +- .../songoda/epichoppers/tasks/HopTask.java | 44 ++++++++++--------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3fd9800..50d456f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: variables: name: "EpicHoppers" path: "/builds/$CI_PROJECT_PATH" - version: "4-pre-release-3" + version: "4-pre-release-4" build: stage: build diff --git a/src/main/java/com/songoda/epichoppers/tasks/HopTask.java b/src/main/java/com/songoda/epichoppers/tasks/HopTask.java index 2c2d6a3..0bca7a0 100644 --- a/src/main/java/com/songoda/epichoppers/tasks/HopTask.java +++ b/src/main/java/com/songoda/epichoppers/tasks/HopTask.java @@ -180,32 +180,32 @@ public class HopTask extends BukkitRunnable { Inventory destinationInventory = currentDestination.getInventory(); - switch (destinationType) { - case ENDER_CHEST: + switch (destinationType.name()) { + case "ENDER_CHEST": OfflinePlayer op = Bukkit.getOfflinePlayer(hopper.getPlacedBy()); if (op.isOnline()) destinationInventory = op.getPlayer().getEnderChest(); break; - case BLACK_SHULKER_BOX: - case BLUE_SHULKER_BOX: - case BROWN_SHULKER_BOX: - case CYAN_SHULKER_BOX: - case GRAY_SHULKER_BOX: - case GREEN_SHULKER_BOX: - case LIGHT_BLUE_SHULKER_BOX: - case LIGHT_GRAY_SHULKER_BOX: - case LIME_SHULKER_BOX: - case MAGENTA_SHULKER_BOX: - case ORANGE_SHULKER_BOX: - case PINK_SHULKER_BOX: - case PURPLE_SHULKER_BOX: - case RED_SHULKER_BOX: - case SHULKER_BOX: - case WHITE_SHULKER_BOX: - case YELLOW_SHULKER_BOX: + case "BLACK_SHULKER_BOX": + case "BLUE_SHULKER_BOX": + case "BROWN_SHULKER_BOX": + case "CYAN_SHULKER_BOX": + case "GRAY_SHULKER_BOX": + case "GREEN_SHULKER_BOX": + case "LIGHT_BLUE_SHULKER_BOX": + case "LIGHT_GRAY_SHULKER_BOX": + case "LIME_SHULKER_BOX": + case "MAGENTA_SHULKER_BOX": + case "ORANGE_SHULKER_BOX": + case "PINK_SHULKER_BOX": + case "PURPLE_SHULKER_BOX": + case "RED_SHULKER_BOX": + case "SHULKER_BOX": + case "WHITE_SHULKER_BOX": + case "YELLOW_SHULKER_BOX": return false; - case BREWING_STAND: { + case "BREWING_STAND": { BrewerInventory brewerInventory = (BrewerInventory) destinationInventory; int maxSize = itemToMove.getMaxStackSize(); @@ -242,7 +242,9 @@ public class HopTask extends BukkitRunnable { debt(item, amountToMove, currentHolder); return true; } - case FURNACE: { + case "BLAST_FURNACE": + case "BURNING_FURNACE": + case "FURNACE": { FurnaceInventory furnaceInventory = (FurnaceInventory) destinationInventory; boolean isFuel = (plugin.isServerVersionAtLeast(ServerVersion.V1_13) ? item.getType().isFuel() : Methods.isLegacyFuel(item.getType())) && !item.getType().name().contains("LOG");