use of org.lanternpowered.server.item.firework.LanternFireworkShape in project LanternServer by LanternPowered.
the class FireworkChargeItemTypeObjectSerializer method serializeExplosion.
static DataView serializeExplosion(FireworkEffect effect) {
final DataView dataView = DataContainer.createNew(DataView.SafetyMode.NO_DATA_CLONED);
dataView.set(FLICKER, (byte) (effect.flickers() ? 1 : 0));
dataView.set(TRAIL, (byte) (effect.hasTrail() ? 1 : 0));
dataView.set(TYPE, (byte) ((LanternFireworkShape) effect.getShape()).getInternalId());
dataView.set(COLORS, effect.getColors().stream().mapToInt(Color::getRgb).toArray());
dataView.set(FADE_COLORS, effect.getFadeColors().stream().mapToInt(Color::getRgb).toArray());
return dataView;
}
use of org.lanternpowered.server.item.firework.LanternFireworkShape in project LanternServer by LanternPowered.
the class FireworkShapeRegistryModule method registerDefaults.
@Override
public void registerDefaults() {
register(new LanternFireworkShape("minecraft", "ball", 0));
register(new LanternFireworkShape("minecraft", "large_ball", 1));
register(new LanternFireworkShape("minecraft", "star", 2));
register(new LanternFireworkShape("minecraft", "creeper", 3));
register(new LanternFireworkShape("minecraft", "burst", 4));
}
Aggregations