mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-20 15:39:21 +00:00
3.6.12
This commit is contained in:
@@ -176,10 +176,11 @@ public abstract class AbstractCustomEventListener implements Listener {
|
|||||||
if (ConfigManager.overriddenCrops().contains(block.getType())) {
|
if (ConfigManager.overriddenCrops().contains(block.getType())) {
|
||||||
event.setDropItems(false);
|
event.setDropItems(false);
|
||||||
}
|
}
|
||||||
|
ItemStack itemStack = event.getPlayer().getInventory().getItemInMainHand();
|
||||||
this.itemManager.handlePlayerBreak(
|
this.itemManager.handlePlayerBreak(
|
||||||
event.getPlayer(),
|
event.getPlayer(),
|
||||||
block.getLocation(),
|
block.getLocation(),
|
||||||
event.getPlayer().getInventory().getItemInMainHand(),
|
itemStack,
|
||||||
block.getBlockData().getAsString(),
|
block.getBlockData().getAsString(),
|
||||||
event
|
event
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -204,7 +204,19 @@ public class CropBlock extends AbstractCustomCropsBlock {
|
|||||||
|
|
||||||
int point = point(state);
|
int point = point(state);
|
||||||
CropStageConfig stageConfig = cropConfig.stageByID(event.relatedID());
|
CropStageConfig stageConfig = cropConfig.stageByID(event.relatedID());
|
||||||
assert stageConfig != null;
|
if (stageConfig == null) {
|
||||||
|
// fix it if it's a wrong data
|
||||||
|
world.removeBlockState(pos3);
|
||||||
|
state = fixOrGetState(world, pos3, event.relatedID());
|
||||||
|
if (state == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cropConfig = config(state);
|
||||||
|
stageConfig = cropConfig.stageByID(event.relatedID());
|
||||||
|
if (stageConfig == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!RequirementManager.isSatisfied(context, stageConfig.interactRequirements())) {
|
if (!RequirementManager.isSatisfied(context, stageConfig.interactRequirements())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class WateringCanItem extends AbstractCustomCropsItem {
|
|||||||
wrapped.maxDamage().ifPresent(max -> {
|
wrapped.maxDamage().ifPresent(max -> {
|
||||||
if (max <= 0) return;
|
if (max <= 0) return;
|
||||||
int damage = (int) (max * (((double) config.storage() - realWater) / config.storage()));
|
int damage = (int) (max * (((double) config.storage() - realWater) / config.storage()));
|
||||||
wrapped.damage(damage);
|
wrapped.damage(Math.min(Math.max(1, damage), max - 1));
|
||||||
});
|
});
|
||||||
// set appearance
|
// set appearance
|
||||||
Optional.ofNullable(config.appearance(realWater)).ifPresent(wrapped::customModelData);
|
Optional.ofNullable(config.appearance(realWater)).ifPresent(wrapped::customModelData);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Project settings
|
# Project settings
|
||||||
# Rule: [major update].[feature update].[bug fix]
|
# Rule: [major update].[feature update].[bug fix]
|
||||||
project_version=3.6.11
|
project_version=3.6.12
|
||||||
config_version=41
|
config_version=41
|
||||||
project_group=net.momirealms
|
project_group=net.momirealms
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user