mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-22 16:39:36 +00:00
no change
This commit is contained in:
@@ -3,7 +3,6 @@ package net.momirealms.customcrops;
|
||||
import net.momirealms.customcrops.DataManager.BackUp;
|
||||
import net.momirealms.customcrops.DataManager.CropManager;
|
||||
import net.momirealms.customcrops.DataManager.SprinklerManager;
|
||||
import net.momirealms.customcrops.Integrations.KingdomsXIntegrations;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
|
||||
@@ -54,9 +54,10 @@ public class RightClickBlock implements Listener {
|
||||
if(event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
|
||||
if(event.getBlockFace() != BlockFace.UP) return;
|
||||
|
||||
|
||||
FileConfiguration config = CustomCrops.instance.getConfig();
|
||||
Location location = event.getClickedBlock().getLocation();
|
||||
|
||||
if(CustomStack.byItemStack(event.getItem()).getNamespacedID().equalsIgnoreCase(config.getString("config.sprinkler-1-item"))){
|
||||
//res兼容
|
||||
if(config.getBoolean("config.integration.residence")){
|
||||
if(ResidenceIntegrations.checkResBuild(location,player)){
|
||||
@@ -75,9 +76,6 @@ public class RightClickBlock implements Listener {
|
||||
return;
|
||||
}
|
||||
}
|
||||
//是否过高过低
|
||||
|
||||
if(CustomStack.byItemStack(event.getItem()).getNamespacedID().equalsIgnoreCase(config.getString("config.sprinkler-1-item"))){
|
||||
if(event.getClickedBlock().getY() > config.getInt("config.height.max") || event.getClickedBlock().getY() < config.getInt("config.height.min")){
|
||||
MessageManager.playerMessage(config.getString("messages.prefix") + config.getString("messages.not-a-good-place"),player);
|
||||
return;
|
||||
@@ -93,6 +91,24 @@ public class RightClickBlock implements Listener {
|
||||
IAFurniture.placeFurniture(config.getString("config.sprinkler-1"),location.clone().add(0,1,0));
|
||||
SprinklerManager.putInstance(location.clone().add(0,1,0),"s1");
|
||||
}else if(CustomStack.byItemStack(event.getItem()).getNamespacedID().equalsIgnoreCase(config.getString("config.sprinkler-2-item"))){
|
||||
//res兼容
|
||||
if(config.getBoolean("config.integration.residence")){
|
||||
if(ResidenceIntegrations.checkResBuild(location,player)){
|
||||
return;
|
||||
}
|
||||
}
|
||||
//wg兼容
|
||||
if(config.getBoolean("config.integration.worldguard")){
|
||||
if(WorldGuardIntegrations.checkWGBuild(location,player)){
|
||||
return;
|
||||
}
|
||||
}
|
||||
//kingdomsX兼容
|
||||
if(config.getBoolean("config.integration.kingdomsX")){
|
||||
if(KingdomsXIntegrations.checkKDBuild(location,player)){
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(event.getClickedBlock().getY() > config.getInt("config.height.max") || event.getClickedBlock().getY() < config.getInt("config.height.min")){
|
||||
MessageManager.playerMessage(config.getString("messages.prefix") + config.getString("messages.not-a-good-place"),player);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user