Skip to content

Commit

Permalink
Update calculateExp() for block breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
Flo56958 committed Jul 3, 2023
1 parent 6e40fb9 commit 04ff879
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/de/flo56958/minetinker/utils/data/DataHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,22 @@ public static boolean playerBreakBlock(@NotNull Player player, Block block, @Not

private static int calculateExp(Material type) {
//TODO: Find better method then hardcoded values
if (MineTinker.is19compatible) {
int amount = switch (type) {
//1
case SCULK -> 1;
//5
case SCULK_CATALYST, SCULK_SENSOR, SCULK_SHRIEKER -> 5;
default -> 0;
};
if (amount != 0) return amount;
}

return switch (type) {
//0-2
case COAL_ORE -> new Random().nextInt(3);
//0-1
case NETHER_GOLD_ORE -> new Random().nextInt(2);
//3-7
case DIAMOND_ORE, EMERALD_ORE -> new Random().nextInt(5) + 3;
//2-5
Expand Down

0 comments on commit 04ff879

Please sign in to comment.