Search in sources :

Example 1 with IMixinTileEntityStructure

use of org.spongepowered.common.interfaces.block.tile.IMixinTileEntityStructure in project SpongeCommon by SpongePowered.

the class StructureDataProcessor method set.

@Override
protected boolean set(TileEntityStructure container, Map<Key<?>, Object> map) {
    @Nullable String author = (String) map.get(Keys.STRUCTURE_AUTHOR);
    if (author != null) {
        ((IMixinTileEntityStructure) container).setAuthor(author);
    }
    container.setIgnoresEntities((Boolean) map.get(Keys.STRUCTURE_IGNORE_ENTITIES));
    container.setIntegrity((Float) map.get(Keys.STRUCTURE_INTEGRITY));
    @Nullable StructureMode mode = (StructureMode) map.get(Keys.STRUCTURE_MODE);
    if (mode != null) {
        ((IMixinTileEntityStructure) container).setMode(mode);
    }
    @Nullable Vector3i position = (Vector3i) map.get(Keys.STRUCTURE_POSITION);
    if (position != null) {
        ((IMixinTileEntityStructure) container).setPosition(position);
    }
    container.setPowered((Boolean) map.get(Keys.STRUCTURE_POWERED));
    @Nullable Long seed = (Long) map.get(Keys.STRUCTURE_SEED);
    if (seed != null) {
        container.setSeed(seed);
    }
    container.setShowAir((Boolean) map.get(Keys.STRUCTURE_SHOW_AIR));
    container.setShowBoundingBox((Boolean) map.get(Keys.STRUCTURE_SHOW_BOUNDING_BOX));
    @Nullable Boolean showBoundingBox = (Boolean) map.get(Keys.STRUCTURE_SHOW_BOUNDING_BOX);
    if (showBoundingBox != null) {
    }
    @Nullable Vector3i size = (Vector3i) map.get(Keys.STRUCTURE_SIZE);
    if (size != null) {
        ((IMixinTileEntityStructure) container).setSize(size);
    }
    return true;
}
Also used : StructureMode(org.spongepowered.api.data.type.StructureMode) IMixinTileEntityStructure(org.spongepowered.common.interfaces.block.tile.IMixinTileEntityStructure) Vector3i(com.flowpowered.math.vector.Vector3i) Nullable(javax.annotation.Nullable)

Aggregations

Vector3i (com.flowpowered.math.vector.Vector3i)1 Nullable (javax.annotation.Nullable)1 StructureMode (org.spongepowered.api.data.type.StructureMode)1 IMixinTileEntityStructure (org.spongepowered.common.interfaces.block.tile.IMixinTileEntityStructure)1