mirror of
https://github.com/songoda/EpicFurnaces.git
synced 2024-11-30 22:03:22 +01:00
Fix for wrong furnace types in 1.14
This commit is contained in:
parent
73635df738
commit
4b3717145b
@ -4,7 +4,7 @@ stages:
|
|||||||
variables:
|
variables:
|
||||||
name: "EpicFurnaces"
|
name: "EpicFurnaces"
|
||||||
path: "/builds/$CI_PROJECT_PATH"
|
path: "/builds/$CI_PROJECT_PATH"
|
||||||
version: "4.3.5"
|
version: "4.3.6"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
|
@ -293,8 +293,8 @@ public class EpicFurnaces extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack createLeveledFurnace(int level, int uses) {
|
public ItemStack createLeveledFurnace(Material material, int level, int uses) {
|
||||||
ItemStack item = new ItemStack(Material.FURNACE, 1);
|
ItemStack item = new ItemStack(material, 1);
|
||||||
ItemMeta itemmeta = item.getItemMeta();
|
ItemMeta itemmeta = item.getItemMeta();
|
||||||
|
|
||||||
if (getConfig().getBoolean("Main.Remember Furnace Item Levels"))
|
if (getConfig().getBoolean("Main.Remember Furnace Item Levels"))
|
||||||
|
@ -5,6 +5,7 @@ import com.songoda.epicfurnaces.command.AbstractCommand;
|
|||||||
import com.songoda.epicfurnaces.furnace.levels.Level;
|
import com.songoda.epicfurnaces.furnace.levels.Level;
|
||||||
import com.songoda.epicfurnaces.utils.Methods;
|
import com.songoda.epicfurnaces.utils.Methods;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -41,7 +42,7 @@ public class CommandGive extends AbstractCommand {
|
|||||||
|
|
||||||
level = plugin.getLevelManager().getLevel(Integer.parseInt(args[2]));
|
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()));
|
player.sendMessage(plugin.getReferences().getPrefix() + plugin.getLocale().getMessage("command.give.success", level.getLevel()));
|
||||||
|
|
||||||
return ReturnType.SUCCESS;
|
return ReturnType.SUCCESS;
|
||||||
|
@ -96,7 +96,8 @@ public class BlockListeners implements Listener {
|
|||||||
if (level != 0) {
|
if (level != 0) {
|
||||||
event.setCancelled(true);
|
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().setType(Material.AIR);
|
||||||
event.getBlock().getLocation().getWorld().dropItemNaturally(event.getBlock().getLocation(), item);
|
event.getBlock().getLocation().getWorld().dropItemNaturally(event.getBlock().getLocation(), item);
|
||||||
|
Loading…
Reference in New Issue
Block a user