本文整理汇总了Java中com.wimbli.WorldBorder.BorderData.insideBorder方法的典型用法代码示例。如果您正苦于以下问题:Java BorderData.insideBorder方法的具体用法?Java BorderData.insideBorder怎么用?Java BorderData.insideBorder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.wimbli.WorldBorder.BorderData
的用法示例。
在下文中一共展示了BorderData.insideBorder方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WorldBorderCheck
import com.wimbli.WorldBorder.BorderData; //导入方法依赖的package包/类
/**
* Checks if the location is outside of the WorldBorder world border. (Plugin)
* @param l The location to check.
* @return True or false, Is the location outside of the border.
*/
public boolean WorldBorderCheck(final Location l) {
if (!(Bukkit.getServer().getPluginManager().getPlugin("WorldBorder") == null)) {
if (RandomCoords.getPlugin().config.getString("WorldBorder").equalsIgnoreCase("true")) {
final BorderData border = Config.Border(l.getWorld().getName());
return border == null || border.insideBorder(l);
} else {
return true;
}
} else {
return true;
}
}
示例2: isInsideBorder
import com.wimbli.WorldBorder.BorderData; //导入方法依赖的package包/类
private boolean isInsideBorder(LivingSpawnEvent event)
{
World world = event.getEntity().worldObj;
BorderData border = Config.Border( Worlds.getWorldName(world) );
return border == null
|| border.insideBorder( event.getEntity().posX, event.getEntity().posZ, Config.getShapeRound() );
}
示例3: isInsideBorder
import com.wimbli.WorldBorder.BorderData; //导入方法依赖的package包/类
private boolean isInsideBorder(World world, int x, int z)
{
BorderData border = Config.Border(Worlds.getWorldName(world));
return border == null
|| border.insideBorder( x, z, Config.getShapeRound() );
}
示例4: isInsideBorder
import com.wimbli.WorldBorder.BorderData; //导入方法依赖的package包/类
private boolean isInsideBorder(LivingSpawnEvent event)
{
World world = event.entity.worldObj;
BorderData border = Config.Border( Worlds.getWorldName(world) );
return border == null
|| border.insideBorder( event.entity.posX, event.entity.posZ, Config.getShapeRound() );
}
示例5: isLocationInsideBorder
import com.wimbli.WorldBorder.BorderData; //导入方法依赖的package包/类
@Override
public boolean isLocationInsideBorder(Location location) {
if (isWorldBorderEnabled()) {
WorldBorder wb = WorldBorder.plugin;
BorderData bd = wb.getWorldBorder(location.getWorld().getName());
return bd.insideBorder(location);
}
return true;
}
示例6: teleportCheck
import com.wimbli.WorldBorder.BorderData; //导入方法依赖的package包/类
/**
* Checks if block is valid to teleport to (no lava, fire, water, ...)
* @param player The player we should check
* @param world The world the coordinate is in
* @param x Coordinate of the block as int
* @param z Coordinate of the block as int
* @param biomeList THe list of biomes at that point
* @param forceBlocks true if should only check if the player wont die,
* false for block restrictions check
* @param forceRegions true if should not check if location is in region,
* false for region restriction
* @return true if the block is a valid teleport block
*/
private boolean teleportCheck(Player player, World world, int x, int z, List<Biome> biomeList, boolean forceBlocks, boolean forceRegions) {
if(worldborder) {
WorldBorder wbPlugin = (WorldBorder) getServer().getPluginManager().getPlugin("WorldBorder");
BorderData border = wbPlugin.getWorldBorder(world.getName());
if(border != null && !border.insideBorder(x, z)) {
return false;
}
}
org.bukkit.WorldBorder wb = world.getWorldBorder();
double wbMaxX = wb.getCenter().getX() + wb.getSize() / 2;
double wbMinX = wb.getCenter().getX() - wb.getSize() / 2;
double wbMaxZ = wb.getCenter().getZ() + wb.getSize() / 2;
double wbMinZ = wb.getCenter().getZ() - wb.getSize() / 2;
if(x > wbMaxX || x < wbMinX) {
return false;
}
if(z > wbMaxZ || z < wbMinZ) {
return false;
}
int y = world.getHighestBlockYAt(x, z);
Block highest = world.getBlockAt(x, y - 1, z);
getLogger().log(debugLevel, "Checked teleport location for player '" + player.getName() + "' X: " + x + " Y: " + (y - 1) + " Z: " + z + " is " + highest.getType() + " + " + world.getBlockAt(x, y + 1, z).getType() + ", Biome: " + highest.getBiome().toString());
if(biomeList.size() > 0 && !biomeList.contains(highest.getBiome())) {
return false;
}
if(!forceBlocks) {
switch (world.getEnvironment()) {
case NETHER:
return false;
case THE_END:
if(highest.getType() == Material.AIR || highest.getType() == Material.WATER || highest.getType() == Material.STATIONARY_WATER || highest.getType() == Material.STATIONARY_LAVA || highest.getType() == Material.WEB || highest.getType() == Material.LAVA || highest.getType() == Material.CACTUS || highest.getType() == Material.ENDER_PORTAL || highest.getType() == Material.PORTAL)
return false;
case NORMAL:
default:
if(highest.getType() != Material.SAND && highest.getType() != Material.GRAVEL && highest.getType() != Material.DIRT && highest.getType() != Material.GRASS)
return false;
}
} else {
if(highest.getType() == Material.AIR || highest.getType() == Material.WATER || highest.getType() == Material.STATIONARY_WATER || highest.getType() == Material.STATIONARY_LAVA || highest.getType() == Material.WEB || highest.getType() == Material.LAVA || highest.getType() == Material.CACTUS || highest.getType() == Material.ENDER_PORTAL || highest.getType() == Material.PORTAL)
return false;
}
return checkforRegion(player, highest.getLocation(), forceRegions);
}