9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-26 10:29:10 +00:00

update dependencies

This commit is contained in:
XiaoMoMi
2024-10-10 21:25:51 +08:00
parent bf314f87c4
commit ff6983d35b
3 changed files with 15 additions and 13 deletions

View File

@@ -486,13 +486,15 @@ public class PlayerActionManager extends AbstractActionManager<Player> {
Optional<CustomCropsWorld<?>> optionalWorld = plugin.getWorldManager().getWorld(location.getWorld());
optionalWorld.ifPresent(world -> world.getChunk(pos3.toChunkPos()).flatMap(chunk -> chunk.getBlockState(pos3)).ifPresent(state -> {
CustomCropsBlock customCropsBlock = state.type();
customCropsBlock.randomTick(state, world, pos3, false);
customCropsBlock.scheduledTick(state, world, pos3, false);
if (customCropsBlock instanceof SprinklerBlock sprinklerBlock) {
int water = sprinklerBlock.water(state);
SprinklerConfig config = sprinklerBlock.config(state);
context.arg(ContextKeys.CURRENT_WATER, water);
context.arg(ContextKeys.WATER_BAR, Optional.ofNullable(config.waterBar()).map(it -> it.getWaterBar(water, config.storage())).orElse(""));
sprinklerBlock.tickSprinkler(state, world, pos3, false);
} else {
customCropsBlock.randomTick(state, world, pos3, false);
customCropsBlock.scheduledTick(state, world, pos3, false);
}
}));
}, "force-tick");