1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00
This commit is contained in:
TheBusyBiscuit 2019-12-28 12:42:39 +01:00
parent 8b3d1fedcb
commit 784ad0b195
4 changed files with 19 additions and 16 deletions

View File

@ -77,6 +77,7 @@ https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#4
* Fixed #1318
* Fixed #1298
* Fixed #1325
* Fixed #1295
## Release Candidate 3 (21 Nov 2019)
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#3

View File

@ -195,7 +195,7 @@ public abstract class AContainer extends SlimefunItem implements InventoryBlock
else {
inv.replaceExistingItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " "));
for (ItemStack output: processing.get(b).getOutput()) {
for (ItemStack output : processing.get(b).getOutput()) {
inv.pushItem(output.clone(), getOutputSlots());
}
@ -207,9 +207,9 @@ public abstract class AContainer extends SlimefunItem implements InventoryBlock
MachineRecipe r = null;
Map<Integer, Integer> found = new HashMap<>();
for (MachineRecipe recipe: recipes) {
for (ItemStack input: recipe.getInput()) {
for (int slot: getInputSlots()) {
for (MachineRecipe recipe : recipes) {
for (ItemStack input : recipe.getInput()) {
for (int slot : getInputSlots()) {
if (SlimefunManager.isItemSimilar(inv.getItemInSlot(slot), input, true)) {
found.put(slot, input.getAmount());
break;
@ -226,7 +226,7 @@ public abstract class AContainer extends SlimefunItem implements InventoryBlock
if (r != null) {
if (!fits(b, r.getOutput())) return;
for (Map.Entry<Integer, Integer> entry: found.entrySet()) {
for (Map.Entry<Integer, Integer> entry : found.entrySet()) {
inv.replaceExistingItem(entry.getKey(), InvUtils.decreaseItem(inv.getItemInSlot(entry.getKey()), entry.getValue()));
}

View File

@ -4,10 +4,11 @@ import java.util.Iterator;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Tag;
import org.bukkit.inventory.FurnaceRecipe;
import org.bukkit.inventory.CookingRecipe;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.Recipe;
import org.bukkit.inventory.RecipeChoice;
import org.bukkit.inventory.RecipeChoice.MaterialChoice;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category;
@ -25,15 +26,15 @@ public abstract class ElectricFurnace extends AContainer {
Iterator<Recipe> iterator = Bukkit.recipeIterator();
while (iterator.hasNext()) {
Recipe r = iterator.next();
if (r instanceof FurnaceRecipe) {
registerRecipe(4, new ItemStack[] {((FurnaceRecipe) r).getInput()}, new ItemStack[] {r.getResult()});
if (r instanceof CookingRecipe) {
RecipeChoice choice = ((CookingRecipe<?>) r).getInputChoice();
if (choice instanceof MaterialChoice) {
for (Material input : ((MaterialChoice) choice).getChoices()) {
registerRecipe(4, new ItemStack[] {new ItemStack(input)}, new ItemStack[] {r.getResult()});
}
}
}
}
//Bukkit Recipe Iterator does not seem to include _LOG's of any type for charcoal... Manually adding them all.
for (Material log : Tag.LOGS.getValues()) {
registerRecipe(4, new ItemStack[] {new ItemStack(log, 1)}, new ItemStack[] {new ItemStack(Material.CHARCOAL, 1)});
}
}
@Override

View File

@ -194,7 +194,7 @@ public final class SlimefunManager {
return false;
}
else if (isItemSimilar(item, SlimefunItems.BOUND_BACKPACK, false)) {
return true;
return !SlimefunItem.getByID("BOUND_BACKPACK").isDisabled();
}
else {
ItemStack strippedItem = item.clone();
@ -205,7 +205,8 @@ public final class SlimefunManager {
}
}
if (SlimefunItem.getByItem(strippedItem) instanceof Soulbound) {
SlimefunItem sfItem = SlimefunItem.getByItem(strippedItem);
if (sfItem instanceof Soulbound && !sfItem.isDisabled()) {
return true;
}
else if (item.hasItemMeta()) {