9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-28 03:19:15 +00:00

Fix getting water

This commit is contained in:
XiaoMoMi
2024-09-05 17:02:54 +08:00
parent f9a1437129
commit e399c33922
2 changed files with 7 additions and 1 deletions

View File

@@ -139,6 +139,9 @@ public class WateringCanItem extends AbstractCustomCropsItem {
int water = getCurrentWater(itemInHand);
String blockID = BukkitCustomCropsPlugin.getInstance().getItemManager().blockID(targetBlock);
if (targetBlock.getType() == Material.WATER) {
blockID = "WATER";
}
if (targetBlock.getBlockData() instanceof Waterlogged waterlogged && waterlogged.isWaterlogged()) {
blockID = "WATER";
}
@@ -308,6 +311,9 @@ public class WateringCanItem extends AbstractCustomCropsItem {
// for old config compatibility
context.arg(ContextKeys.LOCATION, new Location(player.getWorld(), vector.getX() - 0.5,vector.getY() - 1, vector.getZ() - 0.5));
String blockID = BukkitCustomCropsPlugin.getInstance().getItemManager().blockID(targetBlock);
if (targetBlock.getType() == Material.WATER) {
blockID = "WATER";
}
if (targetBlock.getBlockData() instanceof Waterlogged waterlogged && waterlogged.isWaterlogged()) {
blockID = "WATER";
}