9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-25 09:59:20 +00:00
This commit is contained in:
Xiao-MoMi
2022-11-22 00:29:37 +08:00
parent d0e0d46a28
commit bc97fa5aac
3 changed files with 5 additions and 4 deletions

View File

@@ -80,12 +80,13 @@ public class ItemsAdderFrameCropImpl implements CropModeInterface {
Fertilizer fertilizer = cropManager.getFertilizer(potLoc);
boolean certainGrow = potID.equals(BasicItemConfig.wetPot);
int nextStage = Integer.parseInt(cropNameList[2]) + 1;
String temp = StringUtils.chop(id);
String temp = id.substring(0, id.length() - cropNameList[2].length());
if (customInterface.doesExist(temp + nextStage)) {
if (MainConfig.enableCrow && cropManager.crowJudge(location, itemFrame)) return true;
if (fertilizer instanceof SpeedGrow speedGrow && Math.random() < speedGrow.getChance()) {
if (customInterface.doesExist(temp + (nextStage+1))) {
addStage(itemFrame, temp + (nextStage + 1), crop.canRotate());
addStage(itemFrame, temp + (nextStage+1), crop.canRotate());
}
}
else if (certainGrow || Math.random() < MainConfig.dryGrowChance) {

View File

@@ -78,7 +78,7 @@ public class ItemsAdderWireCropImpl implements CropModeInterface {
Fertilizer fertilizer = cropManager.getFertilizer(potLoc);
boolean certainGrow = potID.equals(BasicItemConfig.wetPot);
int nextStage = Integer.parseInt(cropNameList[2]) + 1;
String temp = blockID.substring(blockID.length() - String.valueOf(nextStage).length());
String temp = blockID.substring(0, blockID.length() - cropNameList[2].length());
if (customInterface.doesExist(temp + nextStage)) {
if (MainConfig.enableCrow && cropManager.crowJudge(location)) return true;