mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Fixes #1396
This commit is contained in:
parent
2133f528a9
commit
b94e197f06
@ -57,7 +57,8 @@
|
||||
* Fixed #1385
|
||||
* Fixed #1390
|
||||
* Fixed #1394
|
||||
* Possibly fixed #1313
|
||||
* Fixed #1313
|
||||
* Fixed #1396
|
||||
|
||||
## Release Candidate 4 (06 Jan 2020)
|
||||
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#4
|
||||
|
@ -1,8 +1,9 @@
|
||||
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.multiblocks;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.Container;
|
||||
import org.bukkit.block.Chest;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -76,14 +77,17 @@ public abstract class MultiBlockMachine extends SlimefunMachine {
|
||||
protected Inventory findOutputChest(Block b, ItemStack output) {
|
||||
for (BlockFace face : outputFaces) {
|
||||
Block potentialOutput = b.getRelative(face);
|
||||
String id = BlockStorage.checkID(potentialOutput);
|
||||
|
||||
if (id != null && id.equals("OUTPUT_CHEST")) {
|
||||
// Found the output chest! Now, let's check if we can fit the product in it.
|
||||
Inventory inv = ((Container) potentialOutput.getState()).getInventory();
|
||||
if (potentialOutput.getType() == Material.CHEST) {
|
||||
String id = BlockStorage.checkID(potentialOutput);
|
||||
|
||||
if (InvUtils.fits(inv, output)) {
|
||||
return inv;
|
||||
if (id != null && id.equals("OUTPUT_CHEST")) {
|
||||
// Found the output chest! Now, let's check if we can fit the product in it.
|
||||
Inventory inv = ((Chest) potentialOutput.getState()).getInventory();
|
||||
|
||||
if (InvUtils.fits(inv, output)) {
|
||||
return inv;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import io.github.thebusybiscuit.cscorelib2.chat.ChatColors;
|
||||
import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
|
||||
import io.github.thebusybiscuit.slimefun4.core.guide.BookSlimefunGuide;
|
||||
import io.github.thebusybiscuit.slimefun4.core.guide.ChestSlimefunGuide;
|
||||
import io.github.thebusybiscuit.slimefun4.core.guide.ISlimefunGuide;
|
||||
@ -35,11 +34,6 @@ public final class SlimefunGuide {
|
||||
layouts.put(SlimefunGuideLayout.BOOK, new BookSlimefunGuide());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static ItemStack getItem() {
|
||||
return getItem(SlimefunGuideLayout.CHEST);
|
||||
}
|
||||
|
||||
public static ItemStack getItem(SlimefunGuideLayout design) {
|
||||
ItemStack item = new ItemStack(Material.ENCHANTED_BOOK);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
@ -68,25 +62,10 @@ public final class SlimefunGuide {
|
||||
return item;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static ItemStack getItem(boolean book) {
|
||||
return getItem(book ? SlimefunGuideLayout.BOOK: SlimefunGuideLayout.CHEST);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static ItemStack getDeprecatedItem(boolean book) {
|
||||
return new CustomItem(new ItemStack(Material.ENCHANTED_BOOK), "&eSlimefun Guide &7(Right Click)", (book ? "": "&2"), "&rThis is your basic Guide for Slimefun", "&rYou can see all Items added by this Plugin", "&ror its Addons including their Recipes", "&ra bit of information and more");
|
||||
}
|
||||
|
||||
public static void openCheatMenu(Player p) {
|
||||
openMainMenuAsync(p, false, SlimefunGuideLayout.CHEAT_SHEET, 1);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void openGuide(Player p, boolean book) {
|
||||
openGuide(p, book ? SlimefunGuideLayout.BOOK: SlimefunGuideLayout.CHEST);
|
||||
}
|
||||
|
||||
public static void openGuide(Player p, ItemStack guide) {
|
||||
if (SlimefunManager.isItemSimilar(guide, getItem(SlimefunGuideLayout.CHEST), true)) {
|
||||
openGuide(p, SlimefunGuideLayout.CHEST);
|
||||
|
Loading…
Reference in New Issue
Block a user