Search in sources :

Example 1 with LanternBlockTrait

use of org.lanternpowered.server.block.trait.LanternBlockTrait in project LanternServer by LanternPowered.

the class LanternBlockState method toContainer.

@Override
public DataContainer toContainer() {
    final DataContainer dataContainer = DataContainer.createNew();
    dataContainer.set(DataQuery.of("BlockType"), this.baseState.getBlockType().getId());
    for (Map.Entry<BlockTrait<?>, Comparable<?>> entry : this.traitValues.entrySet()) {
        final Object value = entry.getValue();
        dataContainer.set(((LanternBlockTrait) entry.getKey()).getKey().getQuery(), value);
    }
    return dataContainer;
}
Also used : DataContainer(org.spongepowered.api.data.DataContainer) BlockTrait(org.spongepowered.api.block.trait.BlockTrait) LanternBlockTrait(org.lanternpowered.server.block.trait.LanternBlockTrait) LanternBlockTrait(org.lanternpowered.server.block.trait.LanternBlockTrait) ImmutableBiMap(com.google.common.collect.ImmutableBiMap) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap)

Aggregations

ImmutableBiMap (com.google.common.collect.ImmutableBiMap)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 Map (java.util.Map)1 LanternBlockTrait (org.lanternpowered.server.block.trait.LanternBlockTrait)1 BlockTrait (org.spongepowered.api.block.trait.BlockTrait)1 DataContainer (org.spongepowered.api.data.DataContainer)1