mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
More progress on dough implementation
This commit is contained in:
parent
51b5d1c020
commit
6de1fe821c
@ -16,7 +16,7 @@ import org.bukkit.inventory.Inventory;
|
|||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import io.github.thebusybiscuit.cscorelib2.inventory.InvUtils;
|
import io.github.bakedlibs.dough.inventory.InvUtils;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
||||||
import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils;
|
import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils;
|
||||||
import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper;
|
import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper;
|
||||||
|
@ -10,7 +10,6 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import io.github.bakedlibs.dough.config.Config;
|
import io.github.bakedlibs.dough.config.Config;
|
||||||
import io.github.bakedlibs.dough.updater.GitHubBuildsUpdater;
|
import io.github.bakedlibs.dough.updater.GitHubBuildsUpdater;
|
||||||
import io.github.bakedlibs.dough.updater.PluginUpdater;
|
import io.github.bakedlibs.dough.updater.PluginUpdater;
|
||||||
import io.github.thebusybiscuit.cscorelib2.updater.Updater;
|
|
||||||
import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch;
|
import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
||||||
import io.github.thebusybiscuit.slimefun4.utils.PatternUtils;
|
import io.github.thebusybiscuit.slimefun4.utils.PatternUtils;
|
||||||
|
@ -13,7 +13,7 @@ import org.bukkit.inventory.meta.PotionMeta;
|
|||||||
import org.bukkit.potion.PotionData;
|
import org.bukkit.potion.PotionData;
|
||||||
import org.bukkit.potion.PotionType;
|
import org.bukkit.potion.PotionType;
|
||||||
|
|
||||||
import io.github.thebusybiscuit.cscorelib2.inventory.InvUtils;
|
import io.github.bakedlibs.dough.inventory.InvUtils;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
|
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
|
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
|
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
|
||||||
|
@ -14,7 +14,7 @@ import org.bukkit.inventory.meta.EnchantmentStorageMeta;
|
|||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.bukkit.inventory.meta.Repairable;
|
import org.bukkit.inventory.meta.Repairable;
|
||||||
|
|
||||||
import io.github.thebusybiscuit.cscorelib2.inventory.InvUtils;
|
import io.github.bakedlibs.dough.inventory.InvUtils;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.events.AutoDisenchantEvent;
|
import io.github.thebusybiscuit.slimefun4.api.events.AutoDisenchantEvent;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
|
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
|
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
|
||||||
|
@ -12,7 +12,7 @@ import org.bukkit.enchantments.Enchantment;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.EnchantmentStorageMeta;
|
import org.bukkit.inventory.meta.EnchantmentStorageMeta;
|
||||||
|
|
||||||
import io.github.thebusybiscuit.cscorelib2.inventory.InvUtils;
|
import io.github.bakedlibs.dough.inventory.InvUtils;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.events.AsyncAutoEnchanterProcessEvent;
|
import io.github.thebusybiscuit.slimefun4.api.events.AsyncAutoEnchanterProcessEvent;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.events.AutoEnchantEvent;
|
import io.github.thebusybiscuit.slimefun4.api.events.AutoEnchantEvent;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
|
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
|
||||||
|
@ -12,7 +12,7 @@ import org.bukkit.enchantments.Enchantment;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.EnchantmentStorageMeta;
|
import org.bukkit.inventory.meta.EnchantmentStorageMeta;
|
||||||
|
|
||||||
import io.github.thebusybiscuit.cscorelib2.inventory.InvUtils;
|
import io.github.bakedlibs.dough.inventory.InvUtils;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
|
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting;
|
import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
|
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
|
||||||
|
@ -14,7 +14,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import io.github.thebusybiscuit.cscorelib2.inventory.InvUtils;
|
import io.github.bakedlibs.dough.inventory.InvUtils;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
|
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
|
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
|
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
|
||||||
|
@ -19,8 +19,8 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.scheduler.BukkitScheduler;
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
|
|
||||||
import io.github.thebusybiscuit.cscorelib2.blocks.BlockPosition;
|
import io.github.bakedlibs.dough.blocks.BlockPosition;
|
||||||
import io.github.thebusybiscuit.cscorelib2.blocks.ChunkPosition;
|
import io.github.bakedlibs.dough.blocks.ChunkPosition;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.ErrorReport;
|
import io.github.thebusybiscuit.slimefun4.api.ErrorReport;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
|
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
||||||
|
@ -15,7 +15,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
import org.bukkit.persistence.PersistentDataContainer;
|
import org.bukkit.persistence.PersistentDataContainer;
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
|
|
||||||
import io.github.thebusybiscuit.cscorelib2.chat.ChatColors;
|
import io.github.bakedlibs.dough.common.ChatColors;
|
||||||
import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable;
|
import io.github.thebusybiscuit.slimefun4.core.attributes.Rechargeable;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import org.bukkit.metadata.FixedMetadataValue;
|
|||||||
import org.bukkit.persistence.PersistentDataContainer;
|
import org.bukkit.persistence.PersistentDataContainer;
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
|
|
||||||
import io.github.thebusybiscuit.cscorelib2.item.ImmutableItemMeta;
|
import io.github.bakedlibs.dough.items.ItemMetaSnapshot;
|
||||||
import io.github.thebusybiscuit.cscorelib2.skull.SkullItem;
|
import io.github.thebusybiscuit.cscorelib2.skull.SkullItem;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion;
|
import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.events.SlimefunItemSpawnEvent;
|
import io.github.thebusybiscuit.slimefun4.api.events.SlimefunItemSpawnEvent;
|
||||||
@ -276,7 +276,7 @@ public final class SlimefunUtils {
|
|||||||
return id.get().equals(((SlimefunItemStack) sfitem).getItemId());
|
return id.get().equals(((SlimefunItemStack) sfitem).getItemId());
|
||||||
}
|
}
|
||||||
|
|
||||||
ImmutableItemMeta meta = ((SlimefunItemStack) sfitem).getItemMetaSnapshot();
|
ItemMetaSnapshot meta = ((SlimefunItemStack) sfitem).getItemMetaSnapshot();
|
||||||
return equalsItemMeta(itemMeta, meta, checkLore);
|
return equalsItemMeta(itemMeta, meta, checkLore);
|
||||||
} else if (sfitem.hasItemMeta()) {
|
} else if (sfitem.hasItemMeta()) {
|
||||||
return equalsItemMeta(itemMeta, sfitem.getItemMeta(), checkLore);
|
return equalsItemMeta(itemMeta, sfitem.getItemMeta(), checkLore);
|
||||||
@ -288,7 +288,7 @@ public final class SlimefunUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean equalsItemMeta(@Nonnull ItemMeta itemMeta, @Nonnull ImmutableItemMeta meta, boolean checkLore) {
|
private static boolean equalsItemMeta(@Nonnull ItemMeta itemMeta, @Nonnull ItemMetaSnapshot meta, boolean checkLore) {
|
||||||
Optional<String> displayName = meta.getDisplayName();
|
Optional<String> displayName = meta.getDisplayName();
|
||||||
|
|
||||||
if (itemMeta.hasDisplayName() != displayName.isPresent()) {
|
if (itemMeta.hasDisplayName() != displayName.isPresent()) {
|
||||||
|
@ -17,8 +17,8 @@ import org.bukkit.event.inventory.InventoryClickEvent;
|
|||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import io.github.bakedlibs.dough.inventory.InvUtils;
|
||||||
import io.github.bakedlibs.dough.items.CustomItemStack;
|
import io.github.bakedlibs.dough.items.CustomItemStack;
|
||||||
import io.github.thebusybiscuit.cscorelib2.inventory.InvUtils;
|
|
||||||
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
|
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
|
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.ItemState;
|
import io.github.thebusybiscuit.slimefun4.api.items.ItemState;
|
||||||
|
@ -251,7 +251,7 @@ public class BlockStorage {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
io.github.thebusybiscuit.cscorelib2.config.Config cfg = new io.github.thebusybiscuit.cscorelib2.config.Config(file);
|
io.github.bakedlibs.dough.config.Config cfg = new io.github.bakedlibs.dough.config.Config(file);
|
||||||
BlockMenuPreset preset = BlockMenuPreset.getPreset(cfg.getString("preset"));
|
BlockMenuPreset preset = BlockMenuPreset.getPreset(cfg.getString("preset"));
|
||||||
|
|
||||||
if (preset == null) {
|
if (preset == null) {
|
||||||
@ -276,7 +276,7 @@ public class BlockStorage {
|
|||||||
for (File file : new File("data-storage/Slimefun/universal-inventories").listFiles()) {
|
for (File file : new File("data-storage/Slimefun/universal-inventories").listFiles()) {
|
||||||
if (file.getName().endsWith(".sfi")) {
|
if (file.getName().endsWith(".sfi")) {
|
||||||
try {
|
try {
|
||||||
io.github.thebusybiscuit.cscorelib2.config.Config cfg = new io.github.thebusybiscuit.cscorelib2.config.Config(file);
|
io.github.bakedlibs.dough.config.Config cfg = new io.github.bakedlibs.dough.config.Config(file);
|
||||||
BlockMenuPreset preset = BlockMenuPreset.getPreset(cfg.getString("preset"));
|
BlockMenuPreset preset = BlockMenuPreset.getPreset(cfg.getString("preset"));
|
||||||
|
|
||||||
if (preset != null) {
|
if (preset != null) {
|
||||||
@ -572,7 +572,7 @@ public class BlockStorage {
|
|||||||
File file = new File(PATH_INVENTORIES + serializeLocation(l) + ".sfi");
|
File file = new File(PATH_INVENTORIES + serializeLocation(l) + ".sfi");
|
||||||
|
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
BlockMenu inventory = new BlockMenu(preset, l, new io.github.thebusybiscuit.cscorelib2.config.Config(file));
|
BlockMenu inventory = new BlockMenu(preset, l, new io.github.bakedlibs.dough.config.Config(file));
|
||||||
storage.inventories.put(l, inventory);
|
storage.inventories.put(l, inventory);
|
||||||
} else {
|
} else {
|
||||||
storage.loadInventory(l, preset);
|
storage.loadInventory(l, preset);
|
||||||
|
@ -9,7 +9,7 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import io.github.thebusybiscuit.cscorelib2.config.Config;
|
import io.github.bakedlibs.dough.config.Config;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
||||||
|
|
||||||
// This class will be deprecated, relocated and rewritten in a future version.
|
// This class will be deprecated, relocated and rewritten in a future version.
|
||||||
|
@ -12,9 +12,9 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import io.github.thebusybiscuit.cscorelib2.inventory.InvUtils;
|
import io.github.bakedlibs.dough.inventory.InvUtils;
|
||||||
import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils;
|
import io.github.bakedlibs.dough.items.CustomItemStack;
|
||||||
import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
|
import io.github.bakedlibs.dough.items.ItemUtils;
|
||||||
import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper;
|
import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper;
|
||||||
|
|
||||||
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu;
|
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu;
|
||||||
|
@ -2,7 +2,7 @@ package me.mrCookieSlime.Slimefun.api.inventory;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import io.github.thebusybiscuit.cscorelib2.config.Config;
|
import io.github.bakedlibs.dough.config.Config;
|
||||||
|
|
||||||
// This class will be deprecated, relocated and rewritten in a future version.
|
// This class will be deprecated, relocated and rewritten in a future version.
|
||||||
public class UniversalBlockMenu extends DirtyChestMenu {
|
public class UniversalBlockMenu extends DirtyChestMenu {
|
||||||
|
Loading…
Reference in New Issue
Block a user