Skip to content

Commit

Permalink
SimpleBoss & SimpleDropTable & SimplePotionEffect & SpawnerData, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubix327 committed Jan 23, 2023
1 parent 64f8c3b commit f0a2e48
Show file tree
Hide file tree
Showing 14 changed files with 2,158 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ to load and save all of your fields to the file automatically)
- Automatic YamlStaticConfig (SimpleSettings & SimpleLocalization) loading (use @AutoStaticConfig)
- Automatic ConfigSerializable loading (use @AutoSerialize)
- Custom recipes' wrapper (use SimpleCraft and CraftingHandler)
- Custom bosses (use SimpleBoss and SpawnedBoss)
- Better CompMetadata - now you can store and remove temporary and PERSISTENT metadata for
all objects that support that regardless of your MC version.
- Some small but useful features (new Logger, ItemCreator attribute
modifiers)
- More legacy-compatible methods (in Remain class)
- Some fixes (e.g. Boss-bar HEX colors)


Expand Down
11 changes: 9 additions & 2 deletions src/main/java/org/mineacademy/fo/RandomUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public static Random getRandom() {
* Return true if the given percent was matched
*
* @param percent the percent, from 0 to 100
* @return
*/
public static boolean chance(final long percent) {
return chance((int) percent);
Expand All @@ -76,9 +75,17 @@ public static boolean chance(final long percent) {
* Return true if the given percent was matched
*
* @param percent the percent, from 0 to 100
* @return
*/
public static boolean chance(final int percent) {
return chance((double) percent);
}

/**
* Return true if the given percent was matched
*
* @param percent the percent, from 0.0 to 100.0
*/
public static boolean chance(final double percent){
return random.nextDouble() * 100D < percent;
}

Expand Down
Loading

0 comments on commit f0a2e48

Please sign in to comment.