Skip to content

A small plugin for replacing blocks with others. Often used in Minecraft guild wars.

License

Notifications You must be signed in to change notification settings

rollczi-playground/SMC-SandBoy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMC-SandBoy (2.0 beta)

A small plugin for replacing blocks with others. Often used in minecraft guild wars.

API

SMCSandBoy - instance of plugin
ReplacerService - manages and stores replacers
Replacer - block replacement algorithm
ReplacerValidator - checks if the algorithm can continue replacing
NextMove - functional interface to get next location for replacing blocks

Get instance of SMCSandBoy and ReplacerService:

SMCSandBoy plugin = SMCSandBoy.getInstance();
ReplacerService service = plugin.getReplacerService();

You can implement replacers yourself:

StandardReplacer replacer = new StandardReplacer(Material.LAVA, NextMove.DOWN, ReplacerValidator.AIR_ONLY);
ItemBuilder item = new ItemBuilder(Material.LAPIS_BLOCK).setName("&9Mega Lava");

service.registerReplacer("custom_lava", replacer, item);

if you prefer chain:

service.configuration()
        .name("custom_water")
        .replacer(new StandardReplacer(Material.WATER, NextMove.UP, ReplacerValidator.AIR_ONLY))
        .item(new ItemBuilder(Material.LAPIS_BLOCK).setName("&9Mega Water"))
        .register();

or edit the current...

service.getReplacerData("boyFarmer").peek(replacerData -> {
    Replacer replacer = replacerData.getReplacer();
    replacer.addValidator((nextLocation, nextType, round) -> round < 20);

    ItemBuilder item = replacerData.getItem();
    item.setType(Material.STONE);
    item.setName("&9Change Name");
    replacerData.setItem(item);
});

About

A small plugin for replacing blocks with others. Often used in Minecraft guild wars.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages