Sueta
AB

Abandoned | LiteSack

1.2

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

·Plugin

Descripition
Create custom SackID to storage block from mining
Custom BlockRegen System
Support Item From MMOItems (From v1.1)

Video
YouTube

SoftDepend
- PlaceholderAPI
- WorldGuard

Placeholder
%ls_storage_sack_<sackID>% - Max item player can storage per item
%ls_storage_sacks_<sackID>% - Count max item player can storage per item
%ls_storage_item_<Item>% - Amount of that item
%ls_format_storage_sack_<sackID>% - Max item player can storage per item with format number
%ls_format_storage_sacks_<sackID>% - Count max item player can storage per item with format number
%ls_format_storage_item_<Item>% - Amount of that item with format number

Note

In Setting File **PLEASE READ # IN HERE**:

[/LEFT]
SETTINGS:
  DEBUG: true
  PREFIX:
    ENABLE: true
    PREFIX: "&7[ &bLiteSack&7 ]"
WORLD_GUARD: #If you want use this plugin for survival server, i mean player can mine block from any where, you can ignore this. If you want use this plugin for custom sever (Prison, RPG,....), i mean player can mine block from custom region, you should turn this to true and installed WorldGuard. After that, set "ls-mining" in that region to allow (default is deny)
  USE_FLAG: false
FORMAT:
  NUMBER: #Should use true, but you can try false if you want :)))
    TYPE: true #TYPE LIST: true, false
BLOCK_REGEN:
  ENABLE: true #Block will regen after player mine?
  USE_SIMPLE_REGEN: true #If this true, if player mine stone, block will change to bedrock and after x seconds, it will turn to stone. If this false, if player mine stone, block will change to bedrock and after x seconds, it will turn to random block behind this setting
  BLOCKS:
    STONE:
      - COAL_ORE
      - COAL_BLOCK
      - COBBLESTONE
      - STONE

Example for who need add support custom item:

Custom Item Class

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

@Override
public void onLoad() {
new CustomItem().register();
}

SUPPORT DISCORD

Similar projects

Plugin →