Skip to content

Commit

Permalink
Fix farmland reverting to dirt from common blocks above it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Torm committed Apr 4, 2020
1 parent d7b78b1 commit 983daa0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group 'no.hyp'
version '1.1.1'
version '1.1.2'

sourceCompatibility = 1.8

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/no/hyp/farmingupgrade/FarmingUpgrade.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ public void onFarmlandDry(BlockFadeEvent e) {
} else {
Block above = farmland.getRelative(0, 1, 0);
if (!configDryFarmland()) {
if (cropMaterials.containsKey(above.getType()) || above.getType() == Material.AIR) {
// Only dry farmland if there is an occluding block above it.
if (!above.getType().isOccluding()) {
e.setCancelled(true);
}
}
Expand Down Expand Up @@ -247,7 +248,7 @@ public void farmlandUpgradedChangeMoisture(Block farmland) {

public void farmlandDetermineUpgradedMoisture(BlockState state) {
Material aboveType = state.getBlock().getRelative(0, 1, 0).getType();
if (aboveType == Material.AIR || cropMaterials.containsKey(aboveType)) {
if (!aboveType.isOccluding()) {
ConfigurationSection configuration = this.getConfig();
int range = configuration.getInt(CONFIGURATION_HYDRATION_RANGE, 4);
int depth = configuration.getInt(CONFIGURATION_HYDRATION_DEPTH, 2);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: FarmingUpgrade
author: Torm
description: Upgraded farming mechanics.
version: 1.1.1
version: 1.1.2
main: no.hyp.farmingupgrade.FarmingUpgrade
api-version: 1.13

0 comments on commit 983daa0

Please sign in to comment.