Skip to content

Commit 3303d2d

Browse files
author
Francisco Solis
authored
Fix/utils (#22)
* Fixed Random Number Generator * Updated Dependencies & Idea Files * Updated Changelog
1 parent db86d4e commit 3303d2d

File tree

7 files changed

+106
-12
lines changed

7 files changed

+106
-12
lines changed

.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/discord.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jarRepositories.xml

Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v5.3.4 Changelog:
2+
```
3+
* Fixed Random Number Generator
4+
* Updated Dependencies
5+
```
6+
17
## v5.3.3 Changelog:
28
```
39
* Updated Relocations

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group 'xyz.theprogramsrc'
8-
version '5.3.3-SNAPSHOT'
8+
version '5.3.4-SNAPSHOT'
99
description 'The best way to create a plugin'
1010

1111
repositories{
@@ -24,11 +24,11 @@ repositories{
2424
}
2525

2626
dependencies {
27-
compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
27+
compileOnly 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT'
2828
compileOnly 'org.spigotmc:spigot:1.16.5-R0.1-SNAPSHOT'
29-
compileOnly 'net.md-5:bungeecord-api:1.17-R0.1-SNAPSHOT'
29+
compileOnly 'net.md-5:bungeecord-api:1.18-R0.1-SNAPSHOT'
3030

31-
implementation 'com.github.cryptomorin:XSeries:8.6.0'
31+
implementation 'com.github.cryptomorin:XSeries:8.6.0.0.1'
3232
implementation 'org.slf4j:slf4j-nop:1.7.32'
3333
implementation 'org.slf4j:slf4j-api:1.7.32'
3434
implementation 'commons-io:commons-io:2.11.0'

src/main/java/xyz/theprogramsrc/supercoreapi/global/utils/Utils.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ public static long toMillis(int seconds) {
439439
* @return Random double number
440440
*/
441441
public static double random(double min, double max) {
442-
return Math.random() * (max - min) + min;
442+
return Math.random() * (max - min + 1) + min;
443443
}
444444

445445
/**
@@ -449,12 +449,7 @@ public static double random(double min, double max) {
449449
* @return Random integer number
450450
*/
451451
public static int random(int min, int max) {
452-
int num;
453-
do {
454-
num = (random.nextInt() * (max - min) + min);
455-
} while(num > max - 1);
456-
457-
return num;
452+
return ((int) random(Double.valueOf(min), Double.valueOf(max)));
458453
}
459454

460455
/**

0 commit comments

Comments
 (0)