use of pl.themolka.arcade.util.Color in project Arcade2 by ShootGame.
the class PointCaptureFireworks method onPointCaptured.
@Handler(priority = Priority.LAST)
public void onPointCaptured(PointCapturedEvent event) {
if (this.isEnabled() && !event.isCanceled()) {
Point point = event.getPoint();
Region region = point.getCapture().getRegion();
Color color = event.getNewOwner().getColor();
for (Location at : this.getRegionCorners(region.getBounds())) {
this.fireComplete(at, color);
}
}
}
use of pl.themolka.arcade.util.Color in project Arcade2 by ShootGame.
the class TeamParser method parseDyeColor.
protected DyeColor parseDyeColor(ChatColor chatColor, Property property) throws ParserException {
DyeColor dyeColor = this.dyeColorParser.parse(property).orDefaultNull();
if (dyeColor != null) {
return dyeColor;
}
Color localColor = Color.ofChat(chatColor);
if (localColor == null) {
throw this.fail(property, property.getName(), property.getValue(), "Unknown chat color type");
}
dyeColor = localColor.toDye();
if (dyeColor == null) {
throw this.fail(property, property.getName(), property.getValue(), "Given chat color type cannot be converted into a dye color");
}
return dyeColor;
}
use of pl.themolka.arcade.util.Color in project Arcade2 by ShootGame.
the class ObserversParser method parseNode.
@Override
protected ParserResult<Observers.Config> parseNode(Node node, String name, String value) throws ParserException {
Color color = this.colorParser.parse(node.property("color")).orFail();
String observersName = this.nameParser.parse(node.property("name", "title")).orFail();
return ParserResult.fine(node, name, value, new Observers.Config() {
public ChatColor chatColor() {
return Nulls.defaults(color.toChat(), Observers.OBSERVERS_CHAT_COLOR);
}
public DyeColor dyeColor() {
return Nulls.defaults(color.toDye(), Observers.OBSERVERS_DYE_COLOR);
}
public String name() {
return observersName;
}
});
}
Aggregations