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:
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user