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

bug fix 1.4.5-hotfix

This commit is contained in:
Xiao-MoMi
2022-06-21 22:52:35 +08:00
parent f4a9b3b217
commit 823b4603e2
2 changed files with 14 additions and 14 deletions

View File

@@ -41,35 +41,26 @@ public class IntegrationCheck {
}
//种植等权限检测
public static boolean PlaceCheck(Location location, Player player){
boolean canB = false;
if(ConfigManager.Config.res){
if(ResidenceIntegrations.checkResBuild(location,player)){
canB = true;
}else {
if(!ResidenceIntegrations.checkResBuild(location,player)){
return false;
}
}
if(ConfigManager.Config.king){
if(KingdomsXIntegrations.checkKDBuild(location,player)){
canB = true;
}else {
if(!KingdomsXIntegrations.checkKDBuild(location,player)){
return false;
}
}
if(ConfigManager.Config.wg){
if(WorldGuardIntegrations.checkWGBuild(location, player)){
canB = true;
}else {
if(!WorldGuardIntegrations.checkWGBuild(location, player)){
return false;
}
}
if(ConfigManager.Config.gd){
if(GriefDefenderIntegrations.checkGDBuild(location, player)){
canB = true;
}else {
if(!GriefDefenderIntegrations.checkGDBuild(location, player)){
return false;
}
}
return canB;
return true;
}
}

View File

@@ -206,7 +206,12 @@ public class RightClickCustomBlock implements Listener {
MessageManager.playerMessage(ConfigManager.Config.prefix + ConfigManager.Config.bad_place,player);
return false;
}
Location locUp = clickedBlockLocation.clone().add(0,1,0);
//兼容性检测
if(!IntegrationCheck.PlaceCheck(locUp,player)){
return false;
}
//是否启用了季节
Label_out:
if(ConfigManager.Config.season){
@@ -269,6 +274,10 @@ public class RightClickCustomBlock implements Listener {
if(customStack.getDurability() > 0){
CustomStack.byItemStack(itemStack).setDurability(CustomStack.byItemStack(itemStack).getDurability() - 1);
}else return;
//兼容性检测
if(!IntegrationCheck.PlaceCheck(location,player)){
return;
}
//播放洒水音效
world.playSound(player.getLocation(),Sound.BLOCK_WATER_AMBIENT,1,1);
//获取玩家朝向