Fixed crops; Bumped version

This commit is contained in:
Frederik Palmø 2021-10-13 22:15:48 +02:00
parent 8bdffdb09f
commit 9dc92e5e8a
3 changed files with 14 additions and 6 deletions

View file

@ -7,7 +7,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.11.6 loader_version=0.11.6
# Mod Properties # Mod Properties
mod_version = 1.0.2 mod_version = 1.0.3
maven_group = dk.palmoe maven_group = dk.palmoe
archives_base_name = immersivexp archives_base_name = immersivexp

View file

@ -11,10 +11,10 @@ import com.google.gson.stream.JsonWriter;
import org.apache.commons.io.IOUtils;; import org.apache.commons.io.IOUtils;;
public class Config { public class Config {
public int logBaseXP = 1; public int logBaseXP = 0;
public int logRandXP = 2; public int logRandXP = 1;
public int cropBaseXP = 1; public int cropBaseXP = 0;
public int cropRandXP = 1; public int cropRandXP = 2;
public int berriesBaseXP = 0; public int berriesBaseXP = 0;
public int berriesRandXP = 1; public int berriesRandXP = 1;

View file

@ -16,7 +16,15 @@ public class Events {
public static void init() { public static void init() {
PlayerBlockBreakEvents.AFTER.register((world, player, pos, state, entity) -> { PlayerBlockBreakEvents.AFTER.register((world, player, pos, state, entity) -> {
if (world instanceof ServerWorld) { 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(); Config config = Config.getInstance();
Util.spawnXp((ServerWorld) world, pos, config.cropBaseXP, config.cropRandXP); Util.spawnXp((ServerWorld) world, pos, config.cropBaseXP, config.cropRandXP);
} }