Abandoned | LiteSack icon

Abandoned | LiteSack -----

Sack to storage vanilla / custom item like sack from Hypixel, custom BlockRegen system,....



1.1 - Add API Support Storage Custom Item / Supported MMOItems
- Add API Support Storage Custom Item
- Supported MMOItems
- Fix bug
Example for who need add support custom item:

Custom Item Class
Code (Text):

import net.danh.litesack.API.ItemManager.Manager.MItem;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;

public class CustomItem extends MItem {
    public CustomItem() {
        super("CUSTOMITEMS");
    }

    @Override
    public boolean checkMaterial(@NotNull String item_data) {
        String[] custom_item = item_data.split("-");
        String type = custom_item[0];
        String id = custom_item[1];
        return CustomItems.get(type, id) != null;
    }

    @Override
    public ItemStack getItemStack(@NotNull String item_data, Integer amount) {
        String[] custom_item = item_data.split("-");
        String type = custom_item[0];
        String id = custom_item[1];
        ItemStack itemStack = CustomItems.get(type, id);
        return itemStack != null ? itemStack : new ItemStack(Material.STONE);
    }

    @Override
    public boolean compareItems(ItemStack origin, @NotNull String item_data) {
        String[] custom_item = item_data.split("-");
        String type = custom_item[0];
        String id = custom_item[1];
        ItemStack itemStack = CustomItems.get(type, id);
        return itemStack != null && itemStack.equals(origin);
    }
}
 

Main Class
Code (Text):


@Override
public void onLoad() {
new CustomItem().register();
}
 
----------, Feb 26, 2023
Resource Information
Author:
----------
Total Downloads: 472
First Release: Feb 6, 2023
Last Update: Feb 26, 2023
Category: ---------------
All-Time Rating:
0 ratings
Find more info at discord.gg...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings