mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2026-01-06 15:51:52 +00:00
3.3.1.1
This commit is contained in:
@@ -8,7 +8,7 @@ plugins {
|
|||||||
allprojects {
|
allprojects {
|
||||||
|
|
||||||
project.group = "net.momirealms"
|
project.group = "net.momirealms"
|
||||||
project.version = "3.3.1.0"
|
project.version = "3.3.1.1-hotfix2"
|
||||||
|
|
||||||
apply<JavaPlugin>()
|
apply<JavaPlugin>()
|
||||||
apply(plugin = "java")
|
apply(plugin = "java")
|
||||||
|
|||||||
@@ -223,28 +223,24 @@ public class PlatformManager extends Function {
|
|||||||
ItemStack item_in_hand = player.getInventory().getItemInMainHand();
|
ItemStack item_in_hand = player.getInventory().getItemInMainHand();
|
||||||
String item_in_hand_id = plugin.getPlatformInterface().getItemStackID(item_in_hand);
|
String item_in_hand_id = plugin.getPlatformInterface().getItemStackID(item_in_hand);
|
||||||
|
|
||||||
if (ProtectionLib.canBreak(player, location)) {
|
if (onInteractCrop(player, id, location, item_in_hand, item_in_hand_id, event)) {
|
||||||
if (onInteractCrop(player, id, location, item_in_hand, item_in_hand_id, event)) {
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ProtectionLib.canPlace(player, location)) {
|
if (onInteractWithSprinkler(player, location, item_in_hand, item_in_hand_id, blockFace)) {
|
||||||
if (onInteractWithSprinkler(player, location, item_in_hand, item_in_hand_id, blockFace)) {
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (onInteractSprinkler(player, id, location, item_in_hand, item_in_hand_id, event)) {
|
if (onInteractSprinkler(player, id, location, item_in_hand, item_in_hand_id, event)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (onInteractPot(player, id, location, item_in_hand, item_in_hand_id, event)) {
|
if (onInteractPot(player, id, location, item_in_hand, item_in_hand_id, event)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (onInteractWithWateringCan(player, item_in_hand_id, item_in_hand, id, location)) {
|
if (onInteractWithWateringCan(player, item_in_hand_id, item_in_hand, id, location)) {
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,6 +400,10 @@ public class PlatformManager extends Function {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ProtectionLib.canPlace(player, location)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
SprinklerInteractEvent sprinklerInteractEvent = new SprinklerInteractEvent(player, item_in_hand, location, sprinklerConfig.getKey());
|
SprinklerInteractEvent sprinklerInteractEvent = new SprinklerInteractEvent(player, item_in_hand, location, sprinklerConfig.getKey());
|
||||||
Bukkit.getPluginManager().callEvent(sprinklerInteractEvent);
|
Bukkit.getPluginManager().callEvent(sprinklerInteractEvent);
|
||||||
if (sprinklerInteractEvent.isCancelled()) {
|
if (sprinklerInteractEvent.isCancelled()) {
|
||||||
@@ -515,6 +515,10 @@ public class PlatformManager extends Function {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ProtectionLib.canPlace(player, location)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
Location sprinkler_loc = location.clone().add(0,1,0);
|
Location sprinkler_loc = location.clone().add(0,1,0);
|
||||||
if (plugin.getPlatformInterface().detectAnyThing(sprinkler_loc)) return true;
|
if (plugin.getPlatformInterface().detectAnyThing(sprinkler_loc)) return true;
|
||||||
|
|
||||||
@@ -543,6 +547,10 @@ public class PlatformManager extends Function {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ProtectionLib.canBreak(player, location)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
CropInteractEvent cropInteractEvent = new CropInteractEvent(player, item_in_hand, location, id, cropConfig.getKey());
|
CropInteractEvent cropInteractEvent = new CropInteractEvent(player, item_in_hand, location, id, cropConfig.getKey());
|
||||||
Bukkit.getPluginManager().callEvent(cropInteractEvent);
|
Bukkit.getPluginManager().callEvent(cropInteractEvent);
|
||||||
if (cropInteractEvent.isCancelled()) {
|
if (cropInteractEvent.isCancelled()) {
|
||||||
@@ -694,6 +702,10 @@ public class PlatformManager extends Function {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ProtectionLib.canPlace(player, location)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
PotInteractEvent potInteractEvent = new PotInteractEvent(player, item_in_hand, location, pot_id);
|
PotInteractEvent potInteractEvent = new PotInteractEvent(player, item_in_hand, location, pot_id);
|
||||||
Bukkit.getPluginManager().callEvent(potInteractEvent);
|
Bukkit.getPluginManager().callEvent(potInteractEvent);
|
||||||
if (potInteractEvent.isCancelled()) {
|
if (potInteractEvent.isCancelled()) {
|
||||||
@@ -1071,6 +1083,12 @@ public class PlatformManager extends Function {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (location != null) {
|
||||||
|
if (!ProtectionLib.canPlace(player, location)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int current = plugin.getWateringCanManager().getCurrentWater(item_in_hand);
|
int current = plugin.getWateringCanManager().getCurrentWater(item_in_hand);
|
||||||
if (current >= wateringCanConfig.getStorage()) return true;
|
if (current >= wateringCanConfig.getStorage()) return true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user