From 9dc92e5e8ae6688938276f8777c3d2f7db578865 Mon Sep 17 00:00:00 2001 From: vodofrede Date: Wed, 13 Oct 2021 22:15:48 +0200 Subject: [PATCH] Fixed crops; Bumped version --- gradle.properties | 2 +- src/main/java/dk/palmoe/immersivexp/Config.java | 8 ++++---- src/main/java/dk/palmoe/immersivexp/Events.java | 10 +++++++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index b0556da..5a51402 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ org.gradle.jvmargs=-Xmx1G loader_version=0.11.6 # Mod Properties - mod_version = 1.0.2 + mod_version = 1.0.3 maven_group = dk.palmoe archives_base_name = immersivexp diff --git a/src/main/java/dk/palmoe/immersivexp/Config.java b/src/main/java/dk/palmoe/immersivexp/Config.java index 9ea1ad7..af18243 100644 --- a/src/main/java/dk/palmoe/immersivexp/Config.java +++ b/src/main/java/dk/palmoe/immersivexp/Config.java @@ -11,10 +11,10 @@ import com.google.gson.stream.JsonWriter; import org.apache.commons.io.IOUtils;; public class Config { - public int logBaseXP = 1; - public int logRandXP = 2; - public int cropBaseXP = 1; - public int cropRandXP = 1; + public int logBaseXP = 0; + public int logRandXP = 1; + public int cropBaseXP = 0; + public int cropRandXP = 2; public int berriesBaseXP = 0; public int berriesRandXP = 1; diff --git a/src/main/java/dk/palmoe/immersivexp/Events.java b/src/main/java/dk/palmoe/immersivexp/Events.java index ee44040..d59239a 100644 --- a/src/main/java/dk/palmoe/immersivexp/Events.java +++ b/src/main/java/dk/palmoe/immersivexp/Events.java @@ -16,7 +16,15 @@ public class Events { public static void init() { PlayerBlockBreakEvents.AFTER.register((world, player, pos, state, entity) -> { if (world instanceof ServerWorld) { - if (state.getBlock() instanceof CropBlock || state.getBlock() instanceof MelonBlock) { + if (state.getBlock() instanceof CropBlock) { + int age = state.get(CropBlock.AGE); + if (age == 7) { + Config config = Config.getInstance(); + Util.spawnXp((ServerWorld) world, pos, config.cropBaseXP, config.cropRandXP); + } + } + + if (state.getBlock() instanceof MelonBlock) { Config config = Config.getInstance(); Util.spawnXp((ServerWorld) world, pos, config.cropBaseXP, config.cropRandXP); }