use of net.minecraft.world.level.saveddata.maps.MapDecoration in project SpongeCommon by SpongePowered.
the class MapItemSavedDataMixin method bridge$setDecorations.
@SuppressWarnings("SuspiciousMethodCalls")
@Override
public void bridge$setDecorations(final Set<org.spongepowered.api.map.decoration.MapDecoration> newDecorations) {
this.decorations.clear();
for (final org.spongepowered.api.map.decoration.MapDecoration decoration : newDecorations) {
this.impl$addDecorationToDecorationsMapIfNotExists((MapDecoration) decoration);
}
for (final MapDecoration existingDecoration : this.decorations.values()) {
if (!newDecorations.contains(existingDecoration)) {
// Removed.
((MapDecorationBridge) existingDecoration).notifyRemovedFromMap((MapInfo) this);
this.setDirty();
}
}
if (newDecorations.isEmpty()) {
((SpongeDataHolderBridge) this).bridge$remove(Keys.MAP_DECORATIONS);
} else {
((SpongeDataHolderBridge) this).bridge$offer(Keys.MAP_DECORATIONS, newDecorations);
}
}
Aggregations