本文整理汇总了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;
}