/** * Creates a new {@link Color} by using the provided * {@code red} color, while retaining the current {@link #getGreen()} * and {@link #getBlue()} values. * * @param red The red value to use * @return The new color object */ public Color withRed(int red) { return ofRgb(red, getGreen(), getBlue()); }
/** * Creates a new {@link Color} by using the provided * {@code green} color, while retaining the current {@link #getRed()} * and {@link #getBlue()} values. * * @param green The green value to use * @return The new color object */ public Color withGreen(int green) { return ofRgb(getRed(), green, getBlue()); }
/** * Create a new integer property with the specified value. * * @param value value to match */ public IntProperty(int value) { super(Coerce.toInteger(value)); }
/** * Creates a new {@link Color} by using the provided * {@code blue} color, while retaining the current {@link #getGreen()} * and {@link #getRed()} ()} values. * * @param blue The blue value to use * @return The new color object */ public Color withBlue(int blue) { return ofRgb(getRed(), getGreen(), blue); }
/** * Create an exception with the default message. * * @param command The command that was queried for */ public CommandNotFoundException(String command) { this(t("No such command"), command); }
/** * Create a new integer property with the specified value. * * @param value value to match */ public BooleanProperty(boolean value) { super(Coerce.toBoolean(value)); }
/** * Creates a new SlotPos property for matching the specified value with the * specified operator. * * @param value the value to match * @param operator the operator to use when comparing with other properties */ public SlotPos(Object value, Operator operator) { super(Coerce.toVector2i(value), operator); }
/** * Create a new AcceptsItems property with the supplied value and operator. * * @param value Item types to accept * @param operator Logical operator to apply when comparing with other * properties */ public AcceptsItems(Object value, Operator operator) { super(Coerce.toListOf(value, ItemType.class), operator); }
/** * Returns a transform that is the composition of the given transform with * this transform. The result will apply the given transformation after * this one. * * @param that The transform to compose with * @return The new composed transform */ public DiscreteTransform2 andThen(DiscreteTransform2 that) { return that.compose(this); }
/** * Create a new ArmorSlotType property which matches armour slots of the * specified type. * * @param value armour type to match * @param operator logical operator (either EQUAL or NOTEQUAL) to apply */ public ArmorSlotType(Object value, Operator operator) { super(Coerce.<WornEquipmentType>toPseudoEnum(value, WornEquipmentType.class, WornEquipmentType.class, EquipmentTypes.WORN), operator); }
/** * Create a new {@link StringProperty} for matching the specified value * with the specified operator. * * @param value the value to match * @param operator the operator to use when comparing with other properties */ public StringProperty(Object value, Operator operator) { super(Coerce.toString(value), operator); }
/** * Adds a scale factor to this transform and returns it as a new transform. * This factor must be non-zero. * * @param a The scale factor * @return The scaled transform as a copy */ public DiscreteTransform2 withScale(int a) { return withScale(a, a); }
/** * Gets the closest horizontal direction from the given vector. If the * vector is the 0-Vector (ignoring y), this method returns {@link #NONE}. * If the vector is halfway between two directions the clockwise next will * be selected. * * @param vector The vector to convert to a direction * @return The closest horizontal direction. */ public static Direction getClosestHorizontal(Vector3d vector) { return getClosestHorizontal(vector, Division.SECONDARY_ORDINAL); }
/** * Create a new integer property with the specified value. * * @param value value to match */ public DoubleProperty(double value) { super(Coerce.toDouble(value)); }
/** * Create a new MappedIntproperty with the specified key and value. * * @param key key to match * @param value value to match * @param operator logical operator to use when comparing this property with * other properties */ public MappedIntProperty(Object key, Object value, Operator operator) { super(Coerce.toInteger(key), Coerce.toInteger(value), operator); }
/** * Create a new integer property with the specified value and logical * operator. * * @param value value to match * @param operator logical operator to use when comparing to other * properties */ public BooleanProperty(Object value, Operator operator) { super(Coerce.toBoolean(value), operator); }
/** * Create a new InventoryDimension property with the specified value. * * @param value size to match * @param operator logical operator to use when comparing this property with * other properties */ public InventoryDimension(Object value, Operator operator) { super(Coerce.toVector2i(value), operator); }
/** * Create a new integer property with the specified value. * * @param value value to match */ public IntProperty(int value) { super(Coerce.toInteger(value)); }
/** * Create a new integer property with the specified value and logical * operator. * * @param value value to match * @param operator logical operator to use when comparing to other * properties */ public IntProperty(Object value, Operator operator) { super(Coerce.toInteger(value), operator); }
/** * Create a new integer property with the specified value and logical * operator. * * @param value value to match * @param operator logical operator to use when comparing to other * properties */ public IntProperty(Object value, Operator operator) { super(Coerce.toInteger(value), operator); }