- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.sk89q.worldguard.internal.platform.WorldGuardPlatform.getRegionContainer()
方法的一些代码示例,展示了WorldGuardPlatform.getRegionContainer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorldGuardPlatform.getRegionContainer()
方法的具体详情如下:
包路径:com.sk89q.worldguard.internal.platform.WorldGuardPlatform
类名称:WorldGuardPlatform
方法名:getRegionContainer
[英]Gets a RegionContainer.
[中]得到一个RegionContainer。
代码示例来源:origin: EngineHub/WorldGuard
/**
* Warn the region saving is failing.
*
* @param sender the sender to send the message to
*/
protected static void warnAboutSaveFailures(Actor sender) {
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
Set<RegionManager> failures = container.getSaveFailures();
if (failures.size() > 0) {
String failingList = Joiner.on(", ").join(failures.stream().map(regionManager -> "'" + regionManager.getName() + "'").collect(Collectors.toList()));
sender.printRaw(Style.YELLOW_DARK +
"(Warning: The background saving of region data is failing for these worlds: " + failingList + ". " +
"Your changes are getting lost. See the server log for more information.)");
}
}
代码示例来源:origin: EngineHub/WorldGuard
/**
* Tick the session.
*
* @param player The player
*/
public void tick(LocalPlayer player) {
RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery();
Location location = player.getLocation();
ApplicableRegionSet set = query.getApplicableRegions(location);
for (Handler handler : handlers.values()) {
handler.tick(player, set);
}
}
代码示例来源:origin: EngineHub/WorldGuard
/**
* Initialize the session.
*
* @param player The player
*/
public void initialize(LocalPlayer player) {
RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery();
Location location = player.getLocation();
ApplicableRegionSet set = query.getApplicableRegions(location);
lastValid = location;
lastRegionSet = set.getRegions();
for (Handler handler : handlers.values()) {
handler.initialize(player, location, set);
}
}
代码示例来源:origin: eccentricdevotion/TARDIS
/**
* Gets a TARDIS WorldGuard region.
*
* @param world the world the region is in
* @param p the Time Lord whose region it is
* @return the protected region
*/
public ProtectedRegion getRegion(String world, String p) {
World w = plugin.getServer().getWorld(world);
if (w == null) {
return null;
}
RegionManager rm = wg.getRegionContainer().get(new BukkitWorld(w));
return rm.getRegion("tardis_" + p);
}
代码示例来源:origin: ChestShop-authors/ChestShop-3
private ApplicableRegionSet getApplicableRegions(Location location) {
RegionManager regionManager = worldGuardPlatform.getRegionContainer().get(BukkitAdapter.adapt(location.getWorld()));
if (regionManager == null) {
return null;
}
return regionManager.getApplicableRegions(BukkitAdapter.adapt(location).toVector().toBlockPoint());
}
}
代码示例来源:origin: NyaaCat/RPGItems-reloaded
private static Event.Result canPvP(Player player) {
if (!hasSupport || !useWorldGuard)
return Event.Result.ALLOW;
LocalPlayer localPlayer = wgPlugin.wrapPlayer(player);
State stat = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery().queryState(localPlayer.getLocation(), localPlayer, Flags.PVP);
return (stat == null || stat.equals(State.ALLOW)) ? Event.Result.ALLOW : Event.Result.DENY;
}
代码示例来源:origin: eccentricdevotion/TARDIS
/**
* Adds a player to a region's membership.
*
* @param w the world the region is located in
* @param owner the player whose region it is
* @param a the player to add
*/
public void addMemberToRegion(World w, String owner, String a) {
RegionManager rm = wg.getRegionContainer().get(new BukkitWorld(w));
if (rm.hasRegion("tardis_" + owner)) {
plugin.getServer().dispatchCommand(plugin.getConsole(), "rg addmember tardis_" + owner + " " + a + " -w " + w.getName());
}
}
代码示例来源:origin: eccentricdevotion/TARDIS
/**
* Removes a player from a region's membership.
*
* @param w the world the region is located in
* @param owner the player whose region it is
* @param a the player to add
*/
public void removeMemberFromRegion(World w, String owner, String a) {
RegionManager rm = wg.getRegionContainer().get(new BukkitWorld(w));
if (rm.hasRegion("tardis_" + owner)) {
plugin.getServer().dispatchCommand(plugin.getConsole(), "rg removemember tardis_" + owner + " " + a + " -w " + w.getName());
}
}
代码示例来源:origin: mcMMO-Dev/mcMMO
public boolean hasMainFlag(Player player)
{
if(player == null)
return false;
BukkitPlayer localPlayer = BukkitAdapter.adapt(player);
com.sk89q.worldedit.util.Location loc = localPlayer.getLocation();
//WorldGuardPlugin worldGuard = getWorldGuard();
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
RegionQuery query = container.createQuery();
//ApplicableRegionSet set = query.getApplicableRegions(loc);
return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(player), WorldGuardFlags.MCMMO_ENABLE_WG_FLAG);
}
代码示例来源:origin: mcMMO-Dev/mcMMO
public boolean hasXPFlag(Player player)
{
if(player == null)
return false;
BukkitPlayer localPlayer = BukkitAdapter.adapt(player);
com.sk89q.worldedit.util.Location loc = localPlayer.getLocation();
//WorldGuardPlugin worldGuard = getWorldGuard();
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
RegionQuery query = container.createQuery();
//ApplicableRegionSet set = query.getApplicableRegions(loc);
return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(player), WorldGuardFlags.MCMMO_XP_WG_FLAG);
}
代码示例来源:origin: eccentricdevotion/TARDIS
/**
* Removes the WorldGuard region when the TARDIS is deleted.
*
* @param w the world the region is located in
* @param p the player's name
*/
public void removeRegion(World w, String p) {
RegionManager rm = wg.getRegionContainer().get(new BukkitWorld(w));
rm.removeRegion("tardis_" + p);
try {
rm.save();
} catch (StorageException e) {
plugin.getConsole().sendMessage(plugin.getPluginName() + "Could not remove WorldGuard Protection for TARDIS! " + e.getMessage());
}
}
代码示例来源:origin: NyaaCat/RPGItems-reloaded
static void refreshPlayerWG(Player p) {
LocalPlayer localPlayer = WGSupport.wgPlugin.wrapPlayer(p);
RegionContainer container = worldGuardInstance.getPlatform().getRegionContainer();
RegionManager regions = container.get(localPlayer.getWorld());
if (regions == null) return;
ApplicableRegionSet set = regions.getApplicableRegions(localPlayer.getLocation().toVector().toBlockPoint());
refresh(set, localPlayer);
}
代码示例来源:origin: eccentricdevotion/TARDIS
/**
* Checks whether there is a protected region at a location and if so whether mobs can spawn.
*
* @param l the location to check
* @return true if mobs can spawn, otherwise false
*/
public boolean mobsCanSpawnAtLocation(Location l) {
RegionManager rm = wg.getRegionContainer().get(new BukkitWorld(l.getWorld()));
BlockVector3 vector = BlockVector3.at(l.getX(), l.getY(), l.getZ());
ApplicableRegionSet ars = rm.getApplicableRegions(vector);
return ars.testState(null, Flags.MOB_SPAWNING);
}
}
代码示例来源:origin: eccentricdevotion/TARDIS
/**
* Checks if a player can build (a Police Box) at this location.
*
* @param p the player to check
* @param l the location to check
* @return true of false depending on whether the player has permission to build at this location
*/
public boolean canBuild(Player p, Location l) {
BlockVector3 vector = BlockVector3.at(l.getX(), l.getY(), l.getZ());
RegionManager rm = wg.getRegionContainer().get(new BukkitWorld(l.getWorld()));
ApplicableRegionSet rs = rm.getApplicableRegions(vector);
return rs.testState(wgp.wrapPlayer(p), Flags.BUILD);
}
代码示例来源:origin: eccentricdevotion/TARDIS
/**
* Checks whether a block can be broken
*
* @param p the player trying to break the block
* @param b the block
* @return whether the block can be broken
*/
public boolean canBreakBlock(Player p, Block b) {
BlockVector3 vector = BlockVector3.at(b.getX(), b.getY(), b.getZ());
RegionManager rm = wg.getRegionContainer().get(new BukkitWorld(b.getWorld()));
ApplicableRegionSet rs = rm.getApplicableRegions(vector);
return rs.testState(wgp.wrapPlayer(p), Flags.BUILD);
}
代码示例来源:origin: EngineHub/WorldGuard
private RegionAssociable createRegionAssociable(Cause cause) {
Object rootCause = cause.getRootCause();
if (!cause.isKnown()) {
return Associables.constant(Association.NON_MEMBER);
} else if (rootCause instanceof Player) {
return getPlugin().wrapPlayer((Player) rootCause);
} else if (rootCause instanceof OfflinePlayer) {
return getPlugin().wrapOfflinePlayer((OfflinePlayer) rootCause);
} else if (rootCause instanceof Entity) {
RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery();
return new DelayedRegionOverlapAssociation(query, BukkitAdapter.adapt(((Entity) rootCause).getLocation()));
} else if (rootCause instanceof Block) {
RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery();
return new DelayedRegionOverlapAssociation(query, BukkitAdapter.adapt(((Block) rootCause).getLocation()));
} else {
return Associables.constant(Association.NON_MEMBER);
}
}
代码示例来源:origin: EngineHub/WorldGuard
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPlaceBlock(final PlaceBlockEvent event) {
com.sk89q.worldedit.world.World weWorld = BukkitAdapter.adapt(event.getWorld());
if (!isRegionSupportEnabled(weWorld)) return; // Region support disabled
RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery();
Block block;
if ((block = event.getCause().getFirstBlock()) != null) {
if (Materials.isPistonBlock(block.getType())) {
event.filter(testState(query, Flags.PISTONS), false);
}
}
}
代码示例来源:origin: eccentricdevotion/TARDIS
/**
* Removes the WorldGuard region when the recharger is removed.
*
* @param name the name of the recharger to remove
*/
public void removeRechargerRegion(String name) {
World w = plugin.getServer().getWorld(plugin.getConfig().getString("rechargers." + name + ".world"));
RegionManager rm = wg.getRegionContainer().get(new BukkitWorld(w));
rm.removeRegion("tardis_recharger_" + name);
try {
rm.save();
} catch (StorageException e) {
plugin.getConsole().sendMessage(plugin.getPluginName() + "Could not remove recharger WorldGuard Protection for recharger! " + e.getMessage());
}
}
代码示例来源:origin: EngineHub/WorldGuard
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onLightningStrike(LightningStrikeEvent event) {
ConfigurationManager cfg = WorldGuard.getInstance().getPlatform().getGlobalStateManager();
WorldConfiguration wcfg = cfg.get(BukkitAdapter.adapt(event.getWorld()));
if (wcfg.disallowedLightningBlocks.size() > 0) {
Material targetId = event.getLightning().getLocation().getBlock().getType();
if (wcfg.disallowedLightningBlocks.contains(BukkitAdapter.asBlockType(targetId).getId())) {
event.setCancelled(true);
}
}
Location loc = event.getLightning().getLocation();
if (wcfg.useRegions) {
if (!StateFlag.test(WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery().queryState(BukkitAdapter.adapt(loc), (RegionAssociable) null, Flags.LIGHTNING))) {
event.setCancelled(true);
}
}
}
}
代码示例来源:origin: EngineHub/WorldGuard
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerRespawn(PlayerRespawnEvent event) {
Player player = event.getPlayer();
LocalPlayer localPlayer = plugin.wrapPlayer(player);
ConfigurationManager cfg = WorldGuard.getInstance().getPlatform().getGlobalStateManager();
WorldConfiguration wcfg = cfg.get(localPlayer.getWorld());
if (wcfg.useRegions) {
ApplicableRegionSet set =
WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery().getApplicableRegions(localPlayer.getLocation());
com.sk89q.worldedit.util.Location spawn = set.queryValue(localPlayer, Flags.SPAWN_LOC);
if (spawn != null) {
event.setRespawnLocation(BukkitAdapter.adapt(spawn));
}
}
}
为什么使用 java 和“du -sk”计算目录的已用空间不同?以及“du -sk”的确切 java 替代方案是什么? PFB Java 代码, final String location =
我在阅读某些方法的名称时确实遇到了一些困难,因为 Apple 没有提供其缩写的附录,对于该方法:SKPaymentQueue,SK 代表什么? 最佳答案 它代表StoreKit。请注意您用于获取该类的
更新: 每个请求我都有 NSLogged [[event touchesForView:self.view] count] 和 touches count 并得到 2 和 1 当故障发生时,那么事件似
使用以下代码,我尝试加载数据集并对其执行 NB 算法。 from sklearn.naive_bayes import MultinominalNB import pandas as pd impor
我有一个 SKAction,如果触摸屏幕上的某个区域,它就会运行一个操作。但是我无法让 SKanimate 仅运行 SKarray 一次(即两个操作),它似乎运行了大约 4 次。 count 参数似乎
我正在使用 SK map 。我可以在 Location 上显示注释,但 map 不会以该位置为中心,而是以某个不同的位置为中心,并且 animateToZoom 无法平滑缩放。任何帮助将不胜感激。 最
在警告消息中使用 OpenSSL 中的库时: warning: pointer type mismatch in conditional expression [enabled by default]
我想调整图像大小。我的图像包含特定值 [0, 1, 2, 7, 9]。调整大小后,会引入新值,例如 5 等。我想阻止这种情况。 我目前正在使用 scikit图像大小调整功能。我已经尝试了所有插值标志,
我在 MySQL 中有一个简单的 posts 表,其中有一个 POST_ID 作为 SK(代理键)。对原始帖子 ID 的回复存储在同一个表的 PARENT_POST_ID 列中,但我想执行以下逻辑:
我有超过六个与 Facebook 集成的应用程序。他们都使用旧的 Facebook iOS SDK(在其 SDK 的单点登录版本之前)。去年左右一切都进展顺利。现在,所有应用程序都会报告错误:“操作链
我让球每 3 秒生成一次,如果分数增加,我希望球生成得更快。问题是我的生成率在 4 秒内保持不变,并且在我的分数增加时不会改变。感谢m8s的帮助 var spawnRate : TimeInt
我有一个名为 Cell 的 SKNode 子类。我设置了所有物理体,它们正确地碰撞。但是,didBeginContact() 函数位于 GameScene 中,我需要它位于 Cell 中,因为我想调用
import pandas import math from csv import reader import sys import numpy as np from pandas.plotting
我在本地计算机上创建了一个 sklearn 模型。然后我把它上传到谷歌存储上。我使用相同的模型在 AI Platform 中创建了模型和版本。它正在用于在线预测。现在我想执行批量预测并将数据存储到大查
当用户点击“购买”按钮时,我的应用程序向 StoreKit 发出 addPayment。之后,我想显示带有“请稍候”和事件指示器的警报 View 。但是,SK 也可以显示警报 View 。有什么办法可
我正在使用 Swift 2 在 XCode 7 中制作游戏。我有一个变量,我想从开始屏幕(它是一个 UIViewController)传递到游戏场景(它是一个 SKScene)。我希望玩家在 UIVi
我正在尝试通过创建自己的游戏(应用程序)来学习 Swift,但我遇到了问题。 我有一个 SKSpriteNode 用作游戏的背景。这是我制作的图像。我的问题是我的背景不会填满 View ,所以我在节点
我非常需要你的帮助。所以我是 XCODE 的 SpriteKit 的新手,我刚刚开始使用这个机制。我目前有一个背景图像和一个位于中心的 Sprite 。 问题 Sprite 在屏幕上水平移动,这正是我
我正在尝试使用适用于 Android 的 SK map SDK,但我遇到了一些问题。我已按照本网站的指导进行操作:http://developer.skobbler.com/getting-start
我正在创建一个基于瓦片 map 的 2d 游戏,这是我自己做的第一个程序,所以请在您花时间回答我时考虑一下 :) 我已经构建了 UI 和一张小 map ,我终于让我的角色可以用箭头键移动了。但是我找不
我是一名优秀的程序员,十分优秀!