Search in sources :

Example 1 with PublicCraftingInventory

use of io.github.bananapuncher714.crafters.implementation.api.PublicCraftingInventory in project PublicCrafters by BananaPuncher714.

the class CustomInventoryCrafting method move.

@Override
public PublicCraftingInventory move(Location location) {
    display.stop();
    if (manager.get(bloc) == this) {
        manager.benches.remove(bloc);
    }
    bloc = location;
    CustomInventoryCrafting whatsHere = manager.put(location, this);
    display = new CraftDisplay(this);
    display.update();
    return whatsHere;
}
Also used : CraftDisplay(io.github.bananapuncher714.crafters.display.CraftDisplay)

Example 2 with PublicCraftingInventory

use of io.github.bananapuncher714.crafters.implementation.api.PublicCraftingInventory in project PublicCrafters by BananaPuncher714.

the class CustomInventoryCrafting method move.

@Override
public PublicCraftingInventory move(Location location) {
    display.stop();
    if (manager.get(bloc) == this) {
        manager.benches.remove(bloc);
    }
    bloc = location;
    CustomInventoryCrafting whatsHere = manager.put(location, this);
    display = new CraftDisplay(this);
    display.update();
    return whatsHere;
}
Also used : CraftDisplay(io.github.bananapuncher714.crafters.display.CraftDisplay)

Example 3 with PublicCraftingInventory

use of io.github.bananapuncher714.crafters.implementation.api.PublicCraftingInventory in project PublicCrafters by BananaPuncher714.

the class ContainerManager_v1_13_R1 method remove.

@Override
public void remove(Location location) {
    if (benches.containsKey(location)) {
        PublicCraftingInventory bench = benches.get(location);
        bench.remove();
        benches.remove(location);
    }
}
Also used : PublicCraftingInventory(io.github.bananapuncher714.crafters.implementation.api.PublicCraftingInventory)

Example 4 with PublicCraftingInventory

use of io.github.bananapuncher714.crafters.implementation.api.PublicCraftingInventory in project PublicCrafters by BananaPuncher714.

the class ContainerManager_v1_13_R1 method stopAll.

@Override
public void stopAll() {
    for (PublicCraftingInventory inventory : benches.values()) {
        inventory.getCraftDisplay().stop();
        CraftInventoryLoader.save(PublicCrafters.getInstance().getSaveFolder(), inventory);
    }
    mockPlayer.getBukkitEntity().setOp(false);
}
Also used : PublicCraftingInventory(io.github.bananapuncher714.crafters.implementation.api.PublicCraftingInventory)

Example 5 with PublicCraftingInventory

use of io.github.bananapuncher714.crafters.implementation.api.PublicCraftingInventory in project PublicCrafters by BananaPuncher714.

the class CustomInventoryCrafting method move.

@Override
public PublicCraftingInventory move(Location location) {
    display.stop();
    if (manager.get(bloc) == this) {
        manager.benches.remove(bloc);
    }
    bloc = location;
    CustomInventoryCrafting whatsHere = manager.put(location, this);
    display = new CraftDisplay(this);
    display.update();
    return whatsHere;
}
Also used : CraftDisplay(io.github.bananapuncher714.crafters.display.CraftDisplay)

Aggregations

PublicCraftingInventory (io.github.bananapuncher714.crafters.implementation.api.PublicCraftingInventory)34 CraftDisplay (io.github.bananapuncher714.crafters.display.CraftDisplay)16 HashSet (java.util.HashSet)2 Location (org.bukkit.Location)2 Block (org.bukkit.block.Block)2 BlockFace (org.bukkit.block.BlockFace)2 EventHandler (org.bukkit.event.EventHandler)2