版本更新至:3.76
调整:开发框架改为 Gradle 新增:Language2 工具新增 [book] 类型
This commit is contained in:
31
src/main/java/me/skymc/taboolib/regen/WorldGuardUtils.java
Normal file
31
src/main/java/me/skymc/taboolib/regen/WorldGuardUtils.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package me.skymc.taboolib.regen;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
|
||||
@Deprecated
|
||||
public class WorldGuardUtils {
|
||||
|
||||
public static String getRegen(Location loc) {
|
||||
int x = (int) loc.getX();
|
||||
int y = (int) loc.getY() + 1;
|
||||
int z = (int) loc.getZ();
|
||||
|
||||
Map<String, ProtectedRegion> regens = WorldGuardPlugin.inst().getRegionManager(loc.getWorld()).getRegions();
|
||||
Iterator<String> i = regens.keySet().iterator();
|
||||
while (i.hasNext())
|
||||
{
|
||||
ProtectedRegion regen = regens.get(i.next());
|
||||
if (regen.contains(x, y, z))
|
||||
{
|
||||
return regen.getId();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user