mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-19 15:09:25 +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())) {
|
||||
event.setDropItems(false);
|
||||
}
|
||||
ItemStack itemStack = event.getPlayer().getInventory().getItemInMainHand();
|
||||
this.itemManager.handlePlayerBreak(
|
||||
event.getPlayer(),
|
||||
block.getLocation(),
|
||||
event.getPlayer().getInventory().getItemInMainHand(),
|
||||
itemStack,
|
||||
block.getBlockData().getAsString(),
|
||||
event
|
||||
);
|
||||
|
||||
@@ -204,7 +204,19 @@ public class CropBlock extends AbstractCustomCropsBlock {
|
||||
|
||||
int point = point(state);
|
||||
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())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class WateringCanItem extends AbstractCustomCropsItem {
|
||||
wrapped.maxDamage().ifPresent(max -> {
|
||||
if (max <= 0) return;
|
||||
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
|
||||
Optional.ofNullable(config.appearance(realWater)).ifPresent(wrapped::customModelData);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Project settings
|
||||
# Rule: [major update].[feature update].[bug fix]
|
||||
project_version=3.6.11
|
||||
project_version=3.6.12
|
||||
config_version=41
|
||||
project_group=net.momirealms
|
||||
|
||||
|
||||
Reference in New Issue
Block a user