當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。