From b4c7ed693b55bacfde10239edbb2994b36afe52e Mon Sep 17 00:00:00 2001 From: Ste3et_C0st Date: Thu, 26 Mar 2020 16:35:27 +0100 Subject: [PATCH] Fix campfire#2 tent#1 tent#3 --- .../Furniture/Objects/outdoor/campfire_2.java | 22 ++++++++++++++++++- .../Furniture/Objects/outdoor/tent_1.java | 3 +-- .../Furniture/Objects/outdoor/tent_3.java | 4 +++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/de/Ste3et_C0st/Furniture/Objects/outdoor/campfire_2.java b/src/de/Ste3et_C0st/Furniture/Objects/outdoor/campfire_2.java index a3dada8..c747c84 100644 --- a/src/de/Ste3et_C0st/Furniture/Objects/outdoor/campfire_2.java +++ b/src/de/Ste3et_C0st/Furniture/Objects/outdoor/campfire_2.java @@ -88,7 +88,27 @@ public class campfire_2 extends Furniture { setfire(false); } else if (itemStack.getType().equals(Material.FLINT_AND_STEEL) && !packet.isFire()) { setfire(true); - } else if (items.contains(itemStack.getType()) && packet.isFire() && armorS == null) { + } + } + + if(canInteract(player)) { + final ItemStack itemStack = player.getInventory().getItemInMainHand(); + + fArmorStand packet = null; + List aspList = getManager().getfArmorStandByObjectID(getObjID()); + for (fEntity pack : aspList) { + if (pack instanceof fArmorStand) { + fArmorStand stand = (fArmorStand) pack; + if (stand.isSmall() && pack.isInvisible()) { + packet = stand; + if (packet.isFire()) { + break; + } + } + } + } + if(Objects.isNull(packet)) return; + if (items.contains(itemStack.getType()) && packet.isFire() && armorS == null) { is = itemStack.clone(); is.setAmount(1); diff --git a/src/de/Ste3et_C0st/Furniture/Objects/outdoor/tent_1.java b/src/de/Ste3et_C0st/Furniture/Objects/outdoor/tent_1.java index ac2c528..c0b3aa6 100644 --- a/src/de/Ste3et_C0st/Furniture/Objects/outdoor/tent_1.java +++ b/src/de/Ste3et_C0st/Furniture/Objects/outdoor/tent_1.java @@ -33,9 +33,8 @@ public class tent_1 extends Furniture{ return; } } - - player.openWorkbench(null, true); } + player.openWorkbench(null, true); } @Override diff --git a/src/de/Ste3et_C0st/Furniture/Objects/outdoor/tent_3.java b/src/de/Ste3et_C0st/Furniture/Objects/outdoor/tent_3.java index c409966..e359af0 100644 --- a/src/de/Ste3et_C0st/Furniture/Objects/outdoor/tent_3.java +++ b/src/de/Ste3et_C0st/Furniture/Objects/outdoor/tent_3.java @@ -46,7 +46,9 @@ public class tent_3 extends Furniture{ return; } } - + } + + if(canInteract(player)) { for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){ if(packet.getName().equalsIgnoreCase("#SITZ#")){ packet.setPassenger(player);