use of org.spongepowered.common.interfaces.block.tile.IMixinBanner in project SpongeCommon by SpongePowered.
the class TileEntityBannerDataProcessor method set.
@SuppressWarnings("unchecked")
@Override
protected boolean set(TileEntityBanner entity, Map<Key<?>, Object> keyValues) {
if (!entity.getWorld().isRemote) {
List<PatternLayer> layers = (List<PatternLayer>) keyValues.get(Keys.BANNER_PATTERNS);
DyeColor baseColor = (DyeColor) keyValues.get(Keys.BANNER_BASE_COLOR);
((IMixinBanner) entity).setLayers(layers);
((IMixinBanner) entity).setBaseColor(baseColor);
return true;
}
return false;
}
use of org.spongepowered.common.interfaces.block.tile.IMixinBanner in project SpongeCommon by SpongePowered.
the class TileEntityBannerDataProcessor method getValues.
@Override
protected Map<Key<?>, ?> getValues(TileEntityBanner entity) {
List<PatternLayer> layers = ((IMixinBanner) entity).getLayers();
DyeColor color = ((IMixinBanner) entity).getBaseColor();
return ImmutableMap.of(Keys.BANNER_BASE_COLOR, color, Keys.BANNER_PATTERNS, layers);
}
Aggregations