crwdns141777:0crwdne141777:0

crwdns141781:0crwdne141781:0

crwdns156499:0crwdne156499:0

crwdns141785:0crwdne141785:0

minecraft:dirt[snowy=false,variant=default]
minecraft:dirt[snowy=true,variant=default]
minecraft:dirt[snowy=false,variant=grassless]
minecraft:dirt[snowy=true,variant=grassless]
minecraft:redstone_wire[east=up,north=up,power=0,south=up,west=up]
minecraft:redstone_wire[east=side,north=up,power=0,south=up,west=up]
minecraft:redstone_wire[east=none,north=up,power=0,south=up,west=up]
minecraft:redstone_wire[east=up,north=side,power=0,south=up,west=up]

crwdns141787:0crwdne141787:0

crwdns156501:0crwdne156501:0

crwdns156503:0crwdne156503:0

crwdns156505:0crwdne156505:0

crwdns156930:0:javadoc:crwdne156930:0

crwdns156509:0crwdne156509:0

import org.spongepowered.api.world.server.ServerLocation;
import org.spongepowered.api.block.entity.BlockEntity;
import org.spongepowered.api.block.entity.carrier.chest.Chest;
import org.spongepowered.api.item.inventory.type.BlockEntityInventory;

public Optional<BlockEntityInventory<Chest>> getChestInventory(ServerLocation location){
    Optional<BlockEntity> optionalBlockEntity = location.blockEntity();
    if(optionalBlockEntity.isPresent()){
        BlockEntity blockEntity = optionalBlockEntity.get();
        if(blockEntity instanceof Chest){
            Chest chest = (Chest) blockEntity;
            return Optional.of(chest.inventory());
        }
    }
    return Optional.empty();
}

Tip

crwdns141801:0crwdne141801:0

crwdns141803:0crwdne141803:0

crwdns156511:0crwdne156511:0

crwdns156513:0crwdne156513:0

crwdns156515:0crwdne156515:0

crwdns156517:0:doc:crwdne156517:0