Fix for wrong furnace types in 1.14

This commit is contained in:
Brianna 2019-06-29 23:04:07 -04:00
parent 73635df738
commit 4b3717145b
4 changed files with 7 additions and 5 deletions

View File

@ -4,7 +4,7 @@ stages:
variables:
name: "EpicFurnaces"
path: "/builds/$CI_PROJECT_PATH"
version: "4.3.5"
version: "4.3.6"
build:
stage: build

View File

@ -293,8 +293,8 @@ public class EpicFurnaces extends JavaPlugin {
}
}
public ItemStack createLeveledFurnace(int level, int uses) {
ItemStack item = new ItemStack(Material.FURNACE, 1);
public ItemStack createLeveledFurnace(Material material, int level, int uses) {
ItemStack item = new ItemStack(material, 1);
ItemMeta itemmeta = item.getItemMeta();
if (getConfig().getBoolean("Main.Remember Furnace Item Levels"))

View File

@ -5,6 +5,7 @@ import com.songoda.epicfurnaces.command.AbstractCommand;
import com.songoda.epicfurnaces.furnace.levels.Level;
import com.songoda.epicfurnaces.utils.Methods;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@ -41,7 +42,7 @@ public class CommandGive extends AbstractCommand {
level = plugin.getLevelManager().getLevel(Integer.parseInt(args[2]));
}
player.getInventory().addItem(plugin.createLeveledFurnace(level.getLevel(), 0));
player.getInventory().addItem(plugin.createLeveledFurnace(Material.FURNACE, level.getLevel(), 0));
player.sendMessage(plugin.getReferences().getPrefix() + plugin.getLocale().getMessage("command.give.success", level.getLevel()));
return ReturnType.SUCCESS;

View File

@ -96,7 +96,8 @@ public class BlockListeners implements Listener {
if (level != 0) {
event.setCancelled(true);
ItemStack item = plugin.createLeveledFurnace(level, furnace.getUses());
ItemStack item = plugin.createLeveledFurnace(block.getType().name().contains("BURNING") ? Material.FURNACE
: block.getType(), level, furnace.getUses());
event.getBlock().setType(Material.AIR);
event.getBlock().getLocation().getWorld().dropItemNaturally(event.getBlock().getLocation(), item);