当前位置: 首页>>代码示例>>Java>>正文


Java World.getName方法代码示例

本文整理汇总了Java中org.bukkit.World.getName方法的典型用法代码示例。如果您正苦于以下问题:Java World.getName方法的具体用法?Java World.getName怎么用?Java World.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.World的用法示例。


在下文中一共展示了World.getName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: invalidateCachedChunks

import org.bukkit.World; //导入方法依赖的package包/类
private static void invalidateCachedChunks(World world, Set<ChunkCoord> invalidChunks) {
    if(invalidChunks.isEmpty() || !OrebfuscatorConfig.UseCache) return;

    File cacheFolder = new File(OrebfuscatorConfig.getCacheFolder(), world.getName());

    for(ChunkCoord chunk : invalidChunks) {
        ObfuscatedCachedChunk cache = new ObfuscatedCachedChunk(cacheFolder, chunk.x, chunk.z);
        cache.invalidate();

        //Orebfuscator.log("Chunk x = " + chunk.x + ", z = " + chunk.z + " is invalidated");/*debug*/
    }
}
 
开发者ID:SamaGames,项目名称:AntiCheat,代码行数:13,代码来源:BlockUpdate.java

示例2: needMatch

import org.bukkit.World; //导入方法依赖的package包/类
default Match needMatch(World world) {
    final Match match = getMatch(world);
    if(match == null) {
        throw new IllegalStateException("No match available for world " + world.getName());
    }
    return match;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:8,代码来源:MatchFinder.java

示例3: WorldInfo

import org.bukkit.World; //导入方法依赖的package包/类
public WorldInfo(World world) {
	this.worldName = world.getName();
	this.totalOnline = world.getPlayers().size();
	for (Entity entity : world.getEntities()) {
		this.totalEntity++;
		if (entity instanceof Animals) {
			this.totalAnimals++;
		} else if (entity instanceof Monster) {
			this.totalMonsters++;
		} else if (entity instanceof Item) {
			this.totalDropItem++;
		}
	}
	for (Chunk loadedChunk : world.getLoadedChunks()) {
		this.totalChunk++;
		for (BlockState tiles : loadedChunk.getTileEntities()) {
			this.totalTiles++;
			if (tiles instanceof Hopper) {
				this.totalHopper++;
			} else if (tiles instanceof Chest) {
				this.totalChest++;
			} else if (tiles instanceof Dispenser) {
				this.totalDispenser++;
			} else if (tiles instanceof Dropper) {
				this.totalDropper++;
			} else if (tiles instanceof BrewingStand) {
				this.totalBrewingStand++;
			}
		}

	}
}
 
开发者ID:jiongjionger,项目名称:NeverLag,代码行数:33,代码来源:WorldInfo.java

示例4: getName

import org.bukkit.World; //导入方法依赖的package包/类
@Override
protected String getName(World world) {
    return world.getName();
}
 
开发者ID:games647,项目名称:Minefana,代码行数:5,代码来源:BukkitWorldCollector.java

示例5: setWorld

import org.bukkit.World; //导入方法依赖的package包/类
@Override
public IPosition setWorld(World world) {
    this.world = world.getName();
    return this;
}
 
开发者ID:Shynixn,项目名称:BlockBall,代码行数:6,代码来源:SLocation.java

示例6: clean

import org.bukkit.World; //导入方法依赖的package包/类
public void clean(boolean cleanItem, boolean cleanEntity) { // TODO: 支持清理阈值与 forceclean
	if (cleanItem) itemTimeCounter = 0;
	if (cleanEntity) entityTimeCounter = 0;

	int itemCount = 0, mobCount = 0, entityCount = 0;
	for (World world : Bukkit.getWorlds()) {
		String worldName = world.getName();
		if ((!cleanItem || cm.cleanItemWorldWhitelist.contains(worldName)) &&
			(!cleanEntity || cm.cleanEntityWorldWhitelist.contains(worldName))) {
			continue; // 如果这个世界既不允许清理掉落物也不允许清理实体就不浪费时间了
		}

		for (Entity entity : world.getEntities()) {
			if (entity instanceof Item) {
				// 世界白名单之前检查过了, 没必要再次检查
				if (canCleanItem((Item) entity, false)) {
					itemCount++;
				}
			} else {
				if (canClean(entity)) {
					entity.remove();

					if (entity instanceof LivingEntity) {
						mobCount++;
					} else {
						entityCount++;
					}
				}
			}
		}
	}

	if (cm.cleanItemBroadcast && itemCount > 0) {
		NeverLagUtils.broadcastIfOnline(i18n.tr("item.broadcast", itemCount));
	}

	if (cm.cleanEntityBroadcast) {
		if (mobCount > 0) {
			NeverLagUtils.broadcastIfOnline(i18n.tr("mob", mobCount));
		}
		if (entityCount > 0) {
			NeverLagUtils.broadcastIfOnline(i18n.tr("entity", entityCount));
		}
	}
}
 
开发者ID:jiongjionger,项目名称:NeverLag,代码行数:46,代码来源:EntityCleaner.java

示例7: Cuboid

import org.bukkit.World; //导入方法依赖的package包/类
/**
 * Construct a Cuboid in the given World and xyz co-ordinates
 *
 * @param world - The Cuboid's world
 * @param x1    - X co-ordinate of corner 1
 * @param y1    - Y co-ordinate of corner 1
 * @param z1    - Z co-ordinate of corner 1
 * @param x2    - X co-ordinate of corner 2
 * @param y2    - Y co-ordinate of corner 2
 * @param z2    - Z co-ordinate of corner 2
 */
public Cuboid(World world, int x1, int y1, int z1, int x2, int y2, int z2) {
    this.worldName = world.getName();
    this.x1 = Math.min(x1, x2);
    this.x2 = Math.max(x1, x2);
    this.y1 = Math.min(y1, y2);
    this.y2 = Math.max(y1, y2);
    this.z1 = Math.min(z1, z2);
    this.z2 = Math.max(z1, z2);
}
 
开发者ID:AlphaHelixDev,项目名称:AlphaLibary,代码行数:21,代码来源:Cuboid.java

示例8: Cuboid

import org.bukkit.World; //导入方法依赖的package包/类
/**
 * Construct a Cuboid in the given World and xyz co-ordinates
 *
 * @param world - The Cuboid's world
 * @param x1 - X co-ordinate of corner 1
 * @param y1 - Y co-ordinate of corner 1
 * @param z1 - Z co-ordinate of corner 1
 * @param x2 - X co-ordinate of corner 2
 * @param y2 - Y co-ordinate of corner 2
 * @param z2 - Z co-ordinate of corner 2
 */
public Cuboid(World world, int x1, int y1, int z1, int x2, int y2, int z2) {
    this.worldName = world.getName();
    this.x1 = Math.min(x1, x2);
    this.x2 = Math.max(x1, x2);
    this.y1 = Math.min(y1, y2);
    this.y2 = Math.max(y1, y2);
    this.z1 = Math.min(z1, z2);
    this.z2 = Math.max(z1, z2);
}
 
开发者ID:ijoeleoli,项目名称:ZorahPractice,代码行数:21,代码来源:Cuboid.java

示例9: setWorld

import org.bukkit.World; //导入方法依赖的package包/类
/**
 * Sets the world of the builder
 *
 * @param world world
 * @return builder
 */
public LocationBuilder setWorld(World world) {
    this.world = world.getName();
    return this;
}
 
开发者ID:Shynixn,项目名称:PetBlocks,代码行数:11,代码来源:LocationBuilder.java


注:本文中的org.bukkit.World.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。