Следуйте инструкциям в видео ниже, чтобы узнать, как установить наш сайт как веб-приложение на главный экран вашего устройства.
Примечание: Эта функция может быть недоступна в некоторых браузерах.
protected static WorldGuardPlugin wg = (WorldGuardPlugin) Bukkit.getPluginManager().getPlugin("WorldGuard");
public static void test(Player player, World world) throws CommandException {
RegionManager manager = checkRegionManager(wg, world);
Map<String, ProtectedRegion> regions = manager.getRegions();
for (String id : regions.keySet()) {
ProtectedRegion region = regions.get(id);
DefaultDomain owners = region.getOwners();
System.out.println("uuid " + owners.contains(player.getUniqueId()));
System.out.println("name " + owners.contains(player.getName()));
}
}
protected static RegionManager checkRegionManager(WorldGuardPlugin plugin, World world) throws CommandException {
if (!plugin.getGlobalStateManager().get(world).useRegions) {
throw new CommandException("Region support is disabled in the target world. "
+ "It can be enabled per-world in WorldGuard's configuration files. "
+ "However, you may need to restart your server afterwards.");
}
RegionManager manager = plugin.getRegionContainer().get(world);
if (manager == null) {
throw new CommandException("Region data failed to load for this world. "
+ "Please ask a server administrator to read the logs to identify the reason.");
}
return manager;
}
package Example;
import org.bukkit.Bukkit;
import com.boydti.fawe.FaweAPI;
import com.boydti.fawe.util.EditSessionBuilder;
import com.sk89q.worldedit.BlockVector;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.sk89q.worldguard.protection.managers.RegionManager;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
public class fawe {
public static void regen(org.bukkit.World bworld, String id, boolean isRemove) {
WorldGuardPlugin wg = WorldGuardPlugin.inst();
RegionManager manager = wg.getRegionContainer().get(bworld);
ProtectedRegion protectedregion = manager.getRegion(id);
BlockVector min = protectedregion.getMinimumPoint();
BlockVector max = protectedregion.getMaximumPoint();
World world = FaweAPI.getWorld(bworld.getName());
EditSession editSession = new EditSessionBuilder(world).fastmode(true).build();
Region region = new CuboidRegion(world, min, max);
editSession.regenerate(region);
if (isRemove) {
manager.removeRegion(id);
}
Bukkit.getLogger().info("Region " + id + " regenerated.");
}
}
Спасибо, но пишет ошибку в Eclipse: Syntax error, insert ";" to complete LocalVariableDeclarationStatementКод:protected static WorldGuardPlugin wg = (WorldGuardPlugin) Bukkit.getPluginManager().getPlugin("WorldGuard");Код:public static void test(Player player, World world) throws CommandException { RegionManager manager = checkRegionManager(wg, world); Map<String, ProtectedRegion> regions = manager.getRegions(); for (String id : regions.keySet()) { ProtectedRegion region = regions.get(id); DefaultDomain owners = region.getOwners(); System.out.println("uuid " + owners.contains(player.getUniqueId())); System.out.println("name " + owners.contains(player.getName())); } }Код:protected static RegionManager checkRegionManager(WorldGuardPlugin plugin, World world) throws CommandException { if (!plugin.getGlobalStateManager().get(world).useRegions) { throw new CommandException("Region support is disabled in the target world. " + "It can be enabled per-world in WorldGuard's configuration files. " + "However, you may need to restart your server afterwards."); } RegionManager manager = plugin.getRegionContainer().get(world); if (manager == null) { throw new CommandException("Region data failed to load for this world. " + "Please ask a server administrator to read the logs to identify the reason."); } return manager; }
;
{
или
}
Давай, скинь код, помогу точку с запятой поставить..)Спасибо, но пишет ошибку в Eclipse: Syntax error, insert ";" to complete LocalVariableDeclarationStatement
Не знаю, как решить.