mirror of
https://github.com/songoda/EpicFurnaces.git
synced 2025-01-05 23:37:34 +01:00
Fix for a nasty avoidable error.
This commit is contained in:
parent
324e58b5ab
commit
e86c93d9e5
@ -4,7 +4,7 @@ stages:
|
||||
variables:
|
||||
name: "EpicFurnaces"
|
||||
path: "/builds/$CI_PROJECT_PATH"
|
||||
version: "4.2.4"
|
||||
version: "4.2.5"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
@ -92,7 +92,7 @@ public class BlockListeners implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getBlock().getType() != Material.FURNACE && event.getBlock().getType() != instance.getBukkitEnums().getMaterial("BURNING_FURNACE").getType()) {
|
||||
if (event.getBlock().getType() != Material.FURNACE && !event.getBlock().getType().name().equals("BURNING_FURNACE")) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -23,11 +23,8 @@ public class InteractListeners implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onClick(PlayerInteractEvent event) {
|
||||
if (event.getClickedBlock() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance.getBlacklistHandler().isBlacklisted(event.getPlayer())) {
|
||||
if (event.getClickedBlock() == null
|
||||
&& instance.getBlacklistHandler().isBlacklisted(event.getPlayer())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -37,11 +34,10 @@ public class InteractListeners implements Listener {
|
||||
if (!player.hasPermission("EpicFurnaces.overview")
|
||||
|| event.getAction() != Action.LEFT_CLICK_BLOCK
|
||||
|| player.isSneaking()
|
||||
|| (block.getType() != Material.FURNACE && block.getType() != instance.getBukkitEnums().getMaterial("BURNING_FURNACE").getType())
|
||||
|| (block.getType() != Material.FURNACE && !block.getType().name().equals("BURNING_FURNACE"))
|
||||
|| player.getInventory().getItemInHand().getType().name().contains("PICKAXE")) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
instance.getFurnaceManager().getFurnace(block.getLocation()).orElseGet(() -> instance.getFurnaceManager().createFurnace(block.getLocation())).openOverview(player);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class HologramManager {
|
||||
public void updateHologram(FurnaceObject furnaceObject) {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> {
|
||||
if (furnaceObject.getLocation().getBlock().getType() != Material.FURNACE &&
|
||||
furnaceObject.getLocation().getBlock().getType() != instance.getBukkitEnums().getMaterial("BURNING_FURNACE").getType()) {
|
||||
!furnaceObject.getLocation().getBlock().getType().name().equals("BURNING_FURNACE")) {
|
||||
if (hologramMap.containsKey(furnaceObject)) {
|
||||
hologramMap.remove(furnaceObject).delete();
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public class FurnaceObject {
|
||||
|
||||
public void plus(FurnaceSmeltEvent e) {
|
||||
Block block = location.getBlock();
|
||||
if (block.getType() != Material.FURNACE && block.getType() != instance.getBukkitEnums().getMaterial("BURNING_FURNACE").getType()) {
|
||||
if (block.getType() != Material.FURNACE && !block.getType().name().equals("BURNING_FURNACE")) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ public class FurnaceObject {
|
||||
}
|
||||
|
||||
private void syncName() {
|
||||
if (location.getBlock().getType() != Material.FURNACE && location.getBlock().getType() != instance.getBukkitEnums().getMaterial("BURNING_FURNACE").getType()) {
|
||||
if (location.getBlock().getType() != Material.FURNACE && !location.getBlock().getType().name().equals("BURNING_FURNACE")) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ public class FurnaceObject {
|
||||
|
||||
public void updateCook() {
|
||||
Block block = location.getBlock();
|
||||
if (block == null || (block.getType() != Material.FURNACE && block.getType() != instance.getBukkitEnums().getMaterial("BURNING_FURNACE").getType())) {
|
||||
if (block == null || (block.getType() != Material.FURNACE && !block.getType().name().equals("BURNING_FURNACE"))) {
|
||||
return;
|
||||
}
|
||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(instance, () -> {
|
||||
|
@ -46,7 +46,7 @@ public class FurnaceTask extends BukkitRunnable {
|
||||
}
|
||||
|
||||
if (furnace.getLocation().getBlock().getType() != Material.FURNACE &&
|
||||
furnace.getLocation().getBlock().getType() != instance.getBukkitEnums().getMaterial("BURNING_FURNACE").getType()) {
|
||||
!furnace.getLocation().getBlock().getType().name().equals("BURNING_FURNACE")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ public class FurnaceTask extends BukkitRunnable {
|
||||
|
||||
Block block = location.getBlock();
|
||||
|
||||
if (block.getType() != Material.FURNACE && block.getType() != instance.getBukkitEnums().getMaterial("BURNING_FURNACE").getType()) {
|
||||
if (block.getType() != Material.FURNACE && !block.getType().name().equals("BURNING_FURNACE")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user