Skip to content

Commit

Permalink
Fix Essence Berry (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
C0bra5 authored Oct 21, 2024
1 parent 4c51dad commit ea38096
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies {
//runtimeOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
//runtimeOnly("com.github.GTNewHorizons:twilightforest:2.6.34:dev")
//runtimeOnly("com.github.GTNewHorizons:TinkersConstruct:1.12.10-GTNH:dev")
//runtimeOnly("com.github.GTNewHorizons:EnderIO:2.8.18:dev")
//runtimeOnly("com.github.GTNewHorizons:Natura:2.7.3:dev")
//runtimeOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.6.56:dev")
//runtimeOnly("com.github.GTNewHorizons:Galacticraft:3.2.5-GTNH:dev")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ public int growthDuration(ICropTile crop) {
return crop.getSize() >= this.maxSize() - 2 ? 3000 : 500;
}

public boolean isBlockBelow(ICropTile crop) {
return crop.isBlockBelow(hasBlock());
}

@Override
public ItemStack getGain(ICropTile crop) {
return getDropItem(crop.getSize() >= this.maxSize() && crop.isBlockBelow(hasBlock()) ? 6 : 2);
return getDropItem(crop.getSize() >= this.maxSize() && this.isBlockBelow(crop) ? 6 : 2);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.bartimaeusnek.cropspp.crops.TConstruct;

import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;

import ic2.api.crops.ICropTile;
Expand All @@ -26,6 +27,14 @@ protected String hasBlock() {
return "itemSkull";
}

@Override
public boolean isBlockBelow(ICropTile crop) {
// IC2 doesn't understand wildcards in its item comparison logic for block below checks.
// So I'm using a workaround for vanilla skulls. EIO also adds a it's endermand head to the list and since that
// doesn't use a wild card we can assume it that should keep working.
return crop.isBlockBelow(Blocks.skull) || super.isBlockBelow(crop);
}

@Override
public boolean canGrow(ICropTile crop) {
return super.canGrowBase(crop);
Expand Down

0 comments on commit ea38096

Please sign in to comment.