本文整理匯總了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*/
}
}
示例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;
}
示例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++;
}
}
}
}
示例4: getName
import org.bukkit.World; //導入方法依賴的package包/類
@Override
protected String getName(World world) {
return world.getName();
}
示例5: setWorld
import org.bukkit.World; //導入方法依賴的package包/類
@Override
public IPosition setWorld(World world) {
this.world = world.getName();
return this;
}
示例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));
}
}
}
示例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);
}
示例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);
}
示例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;
}