-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Forestry ExtraTrees windfall tweak
- Loading branch information
Showing
7 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...mod/acgaming/universaltweaks/mods/forestry/extratrees/mixin/UTFarmLogicArborealMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package mod.acgaming.universaltweaks.mods.forestry.extratrees.mixin; | ||
|
||
import net.minecraft.item.ItemStack; | ||
|
||
import binnie.extratrees.items.ItemETFood; | ||
import forestry.api.farming.IFarmProperties; | ||
import forestry.farming.logic.FarmLogicArboreal; | ||
import forestry.farming.logic.FarmLogicHomogeneous; | ||
import mod.acgaming.universaltweaks.config.UTConfig; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
@Mixin(value = FarmLogicArboreal.class, remap = false) | ||
public abstract class UTFarmLogicArborealMixin extends FarmLogicHomogeneous | ||
{ | ||
public UTFarmLogicArborealMixin(IFarmProperties properties, boolean isManual) | ||
{ | ||
super(properties, isManual); | ||
} | ||
|
||
@Override | ||
public boolean isAcceptedWindfall(ItemStack stack) | ||
{ | ||
return UTConfig.MOD_INTEGRATION.FORESTRY.utFOGatherWindfallToggle && stack.getItem() instanceof ItemETFood; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
.../mod/acgaming/universaltweaks/mods/forestry/extratrees/mixin/UTFarmLogicOrchardMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package mod.acgaming.universaltweaks.mods.forestry.extratrees.mixin; | ||
|
||
import net.minecraft.item.ItemStack; | ||
|
||
import binnie.extratrees.items.ItemETFood; | ||
import forestry.api.farming.IFarmProperties; | ||
import forestry.farming.logic.FarmLogic; | ||
import forestry.farming.logic.FarmLogicOrchard; | ||
import mod.acgaming.universaltweaks.config.UTConfig; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(value = FarmLogicOrchard.class, remap = false) | ||
public abstract class UTFarmLogicOrchardMixin extends FarmLogic | ||
{ | ||
public UTFarmLogicOrchardMixin(IFarmProperties properties, boolean isManual) | ||
{ | ||
super(properties, isManual); | ||
} | ||
|
||
@Inject(method = "isAcceptedWindfall", at = @At("RETURN"), cancellable = true) | ||
public void utExtraTreesWindfall(ItemStack stack, CallbackInfoReturnable<Boolean> cir) | ||
{ | ||
if (UTConfig.MOD_INTEGRATION.FORESTRY.utFOGatherWindfallToggle && stack.getItem() instanceof ItemETFood) cir.setReturnValue(true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"package": "mod.acgaming.universaltweaks.mods.forestry.extratrees.mixin", | ||
"refmap": "universaltweaks.refmap.json", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": ["UTFarmLogicArborealMixin", "UTFarmLogicOrchardMixin"] | ||
} |
942476f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ForestryMC/Binnie#663
ForestryMC/ForestryMC#2700
942476f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much