mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-07 03:00:29 +01:00
Fix missing shulker box, undo stackables armor stand change
This commit is contained in:
parent
404e0f6092
commit
9133a1db73
@ -3,7 +3,6 @@ package me.goodandevil.skyblock.listeners;
|
||||
import java.io.File;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -161,7 +160,8 @@ public class Interact implements Listener {
|
||||
}
|
||||
} else if (block.getType() == Material.CHEST || block.getType() == Material.TRAPPED_CHEST
|
||||
|| (NMSUtil.getVersionNumber() > 9
|
||||
&& (block.getType() == Materials.BLACK_SHULKER_BOX.parseMaterial()
|
||||
&& (block.getType() == Materials.SHULKER_BOX.parseMaterial()
|
||||
|| block.getType() == Materials.BLACK_SHULKER_BOX.parseMaterial()
|
||||
|| block.getType() == Materials.BLUE_SHULKER_BOX.parseMaterial()
|
||||
|| block.getType() == Materials.BROWN_SHULKER_BOX.parseMaterial()
|
||||
|| block.getType() == Materials.CYAN_SHULKER_BOX.parseMaterial()
|
||||
|
@ -91,14 +91,9 @@ public class Stackable {
|
||||
|
||||
private void updateDisplay() {
|
||||
if (this.size > 1) {
|
||||
if (this.display == null && !this.findExistingDisplay()) {
|
||||
this.createDisplay();
|
||||
}
|
||||
|
||||
if (this.display.isDead()) {
|
||||
this.createDisplay();
|
||||
}
|
||||
|
||||
this.findExistingDisplay();
|
||||
this.removeDisplay();
|
||||
this.createDisplay();
|
||||
this.display.setCustomName(WordUtils.capitalize(material.name().toLowerCase()).replace("_", " ") + "s: " + size);
|
||||
this.display.setCustomNameVisible(true);
|
||||
} else {
|
||||
@ -126,7 +121,7 @@ public class Stackable {
|
||||
|
||||
private boolean findExistingDisplay() {
|
||||
for (Entity entity : this.location.getWorld().getNearbyEntities(this.location.clone().add(0.5, 0.55, 0.5), 0.1, 0.5, 0.1)) {
|
||||
if (entity instanceof ArmorStand && !entity.isDead()) {
|
||||
if (entity instanceof ArmorStand && entity.isValid()) {
|
||||
this.display = (ArmorStand) entity;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user