9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-29 11:59:15 +00:00
This commit is contained in:
Xiao-MoMi
2022-06-14 02:06:42 +08:00
parent a7ada230cd
commit a1f53c4ad7
9 changed files with 52 additions and 65 deletions

View File

@@ -1,17 +1,14 @@
package net.momirealms.customcrops.utils;
import dev.lone.itemsadder.api.CustomFurniture;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.datamanager.ConfigManager;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Entity;
public class IAFurniture {
static FileConfiguration config = CustomCrops.instance.getConfig();
//放置IA自定义家具
public static void placeFurniture(String name, Location location){
CustomFurniture.spawn(name,location.getWorld().getBlockAt(location));
@@ -22,7 +19,7 @@ public class IAFurniture {
for(Entity entity : world.getNearbyEntities(location,0,0,0)){
if(entity instanceof ArmorStand){
if(CustomFurniture.byAlreadySpawned((ArmorStand) entity) != null){
if(CustomFurniture.byAlreadySpawned((ArmorStand) entity).getNamespacedID().equalsIgnoreCase(config.getString("config.sprinkler-1")) || CustomFurniture.byAlreadySpawned((ArmorStand) entity).getNamespacedID().equalsIgnoreCase(config.getString("config.sprinkler-2"))){
if(CustomFurniture.byAlreadySpawned((ArmorStand) entity).getNamespacedID().equalsIgnoreCase(ConfigManager.Config.sprinkler_1) || CustomFurniture.byAlreadySpawned((ArmorStand) entity).getNamespacedID().equalsIgnoreCase(ConfigManager.Config.sprinkler_2)){
return true;
}
}