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


Java ChunkCoordinates类代码示例

本文整理汇总了Java中net.minecraft.util.ChunkCoordinates的典型用法代码示例。如果您正苦于以下问题:Java ChunkCoordinates类的具体用法?Java ChunkCoordinates怎么用?Java ChunkCoordinates使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: handleTileEntities

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
@Override
protected void handleTileEntities(Random rand)
{
    if (!this.chests.isEmpty())
    {
        HashSet<ChunkCoordinates> removeList = new HashSet<ChunkCoordinates>();

        for (ChunkCoordinates coords : this.chests)
        {
            this.worldObj.setBlock(coords.posX, coords.posY, coords.posZ, MarsBlocks.tier2TreasureChest, 0, 3);
            this.worldObj.setTileEntity(coords.posX, coords.posY, coords.posZ, new TileEntityTreasureChestMars());
            removeList.add(coords);
        }

        this.chests.removeAll(removeList);
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:18,代码来源:RoomTreasureMars.java

示例2: addToList

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
public static void addToList(World world, int x, int y, int z, String playerName)
{
    HashMap<Integer, HashSet<ChunkCoordinates>> dimensionMap = ChunkLoadingCallback.chunkLoaderList.get(playerName);

    if (dimensionMap == null)
    {
        dimensionMap = new HashMap<Integer, HashSet<ChunkCoordinates>>();
        ChunkLoadingCallback.chunkLoaderList.put(playerName, dimensionMap);
    }

    HashSet<ChunkCoordinates> chunkLoaders = dimensionMap.get(world.provider.dimensionId);

    if (chunkLoaders == null)
    {
        chunkLoaders = new HashSet<ChunkCoordinates>();
    }

    chunkLoaders.add(new ChunkCoordinates(x, y, z));
    dimensionMap.put(world.provider.dimensionId, chunkLoaders);
    ChunkLoadingCallback.chunkLoaderList.put(playerName, dimensionMap);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:22,代码来源:ChunkLoadingCallback.java

示例3: onPlayerLogin

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
public static void onPlayerLogin(EntityPlayer player)
{
    for (Entry<String, HashMap<Integer, HashSet<ChunkCoordinates>>> playerEntry : ChunkLoadingCallback.chunkLoaderList.entrySet())
    {
        if (player.getGameProfile().getName().equals(playerEntry.getKey()))
        {
            for (Entry<Integer, HashSet<ChunkCoordinates>> dimensionEntry : playerEntry.getValue().entrySet())
            {
                int dimID = dimensionEntry.getKey();

                if (ChunkLoadingCallback.loadOnLogin)
                {
                    MinecraftServer.getServer().worldServerForDimension(dimID);
                }
            }
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:ChunkLoadingCallback.java

示例4: handleTileEntities

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
@Override
protected void handleTileEntities(Random rand)
{
    if (!this.chests.isEmpty())
    {
        HashSet<ChunkCoordinates> removeList = new HashSet<ChunkCoordinates>();

        for (ChunkCoordinates coords : this.chests)
        {
            this.worldObj.setBlock(coords.posX, coords.posY, coords.posZ, GCBlocks.treasureChestTier1, 0, 3);
            this.worldObj.setTileEntity(coords.posX, coords.posY, coords.posZ, new TileEntityTreasureChest(1));
            removeList.add(coords);
        }

        this.chests.removeAll(removeList);
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:18,代码来源:RoomTreasureMoon.java

示例5: getDungeonNear

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
public ChunkCoordinates getDungeonNear(long worldSeed, int i, int j)
{
    final int range = 16;
    for (int x = i - range; x <= i + range; x++)
    {
        for (int z = j - range; z <= j + range; z++)
        {
            if (this.canGenDungeonAtCoords(worldSeed, x, z))
            {
                return new ChunkCoordinates(x * 16 + 8, 0, z * 16 + 8);
            }
        }
    }

    return null;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:17,代码来源:MapGenDungeon.java

示例6: wakeUpPlayer

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
public boolean wakeUpPlayer(EntityPlayerMP player, boolean par1, boolean par2, boolean par3, boolean bypass)
{
    ChunkCoordinates c = player.playerLocation;

    if (c != null)
    {
        EventWakePlayer event = new EventWakePlayer(player, c.posX, c.posY, c.posZ, par1, par2, par3, bypass);
        MinecraftForge.EVENT_BUS.post(event);

        if (bypass || event.result == null || event.result == EntityPlayer.EnumStatus.OK)
        {
            return false;
        }
    }

    return true;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:18,代码来源:PlayerServer.java

示例7: verifyRespawnCoordinates

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
public static ChunkCoordinates verifyRespawnCoordinates(World p_71056_0_, ChunkCoordinates p_71056_1_, boolean p_71056_2_)
{
	IChunkProvider ichunkprovider = p_71056_0_.getChunkProvider();
	ichunkprovider.loadChunk(p_71056_1_.posX - 3 >> 4, p_71056_1_.posZ - 3 >> 4);
	ichunkprovider.loadChunk(p_71056_1_.posX + 3 >> 4, p_71056_1_.posZ - 3 >> 4);
	ichunkprovider.loadChunk(p_71056_1_.posX - 3 >> 4, p_71056_1_.posZ + 3 >> 4);
	ichunkprovider.loadChunk(p_71056_1_.posX + 3 >> 4, p_71056_1_.posZ + 3 >> 4);
	if (p_71056_0_.getBlock(p_71056_1_.posX, p_71056_1_.posY, p_71056_1_.posZ).isBed(p_71056_0_, p_71056_1_.posX, p_71056_1_.posY, p_71056_1_.posZ, null))
	{
		ChunkCoordinates chunkcoordinates1 = p_71056_0_.getBlock(p_71056_1_.posX, p_71056_1_.posY, p_71056_1_.posZ).getBedSpawnPosition(p_71056_0_, p_71056_1_.posX, p_71056_1_.posY, p_71056_1_.posZ, null);
		return chunkcoordinates1;
	}
	Material material = p_71056_0_.getBlock(p_71056_1_.posX, p_71056_1_.posY, p_71056_1_.posZ).getMaterial();
	Material material1 = p_71056_0_.getBlock(p_71056_1_.posX, p_71056_1_.posY + 1, p_71056_1_.posZ).getMaterial();
	boolean flag1 = (!material.isSolid()) && (!material.isLiquid());
	boolean flag2 = (!material1.isSolid()) && (!material1.isLiquid());
	return (p_71056_2_) && (flag1) && (flag2) ? p_71056_1_ : null;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:EntityPlayer.java

示例8: setSpawnChunk

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
public void setSpawnChunk(ChunkCoordinates p_71063_1_, boolean p_71063_2_)
{
	if (this.dimension != 0)
	{
		setSpawnChunk(p_71063_1_, p_71063_2_, this.dimension);
		return;
	}
	if (p_71063_1_ != null)
	{
		this.spawnChunk = new ChunkCoordinates(p_71063_1_);
		this.spawnForced = p_71063_2_;
	}
	else
	{
		this.spawnChunk = null;
		this.spawnForced = false;
	}
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:EntityPlayer.java

示例9: generate

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
@Override
public void generate(Block[] chunk, byte[] meta, int cx, int cz) {
	for (int i = this.posX - 1; i <= this.posX + this.sizeX; i++) {
		for (int k = this.posZ - 1; k <= this.posZ + this.sizeZ; k++) {
			for (int j = this.posY - 1; j <= this.posY + this.sizeY; j++) {
				if (i == this.posX - 1 || i == this.posX + this.sizeX || j == this.posY - 1 || j == this.posY + this.sizeY || k == this.posZ - 1 || k == this.posZ + this.sizeZ) {
					this.placeBlock(chunk, meta, i, j, k, cx, cz, this.dungeonInstance.settings.blockBrick.getFirst(), this.dungeonInstance.settings.blockBrick.getSecond());
				} else {
					if ((i == this.posX || i == this.posX + this.sizeX - 1) && (k == this.posZ || k == this.posZ + this.sizeZ - 1)) {
						this.placeBlock(chunk, meta, i, j, k, cx, cz, Blocks.glowstone, 0);
					} else {
						this.placeBlock(chunk, meta, i, j, k, cx, cz, Blocks.air, 0);
					}
				}
			}
		}
	}
	final int hx = (this.posX + this.posX + this.sizeX) / 2;
	final int hz = (this.posZ + this.posZ + this.sizeZ) / 2;

	if (this.placeBlock(chunk, meta, hx, this.posY, hz, cx, cz, MarsBlocks.tier2TreasureChest, 0)) {
		this.chests.add(new ChunkCoordinates(hx, this.posY, hz));
	}
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:25,代码来源:DungeonRoomTreasure.java

示例10: generate

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
@Override
public void generate(Block[] chunk, byte[] meta, int cx, int cz) {
	for (int i = this.posX - 1; i <= this.posX + this.sizeX; i++) {
		for (int k = this.posZ - 1; k <= this.posZ + this.sizeZ; k++) {
			for (int j = this.posY - 1; j <= this.posY + this.sizeY; j++) {
				if (i == this.posX - 1 || i == this.posX + this.sizeX || j == this.posY - 1 || j == this.posY + this.sizeY || k == this.posZ - 1 || k == this.posZ + this.sizeZ) {
					this.placeBlock(chunk, meta, i, j, k, cx, cz, this.dungeonInstance.settings.blockBrick.getFirst(), this.dungeonInstance.settings.blockBrick.getSecond());
				} else if (i == this.posX && k == this.posZ || i == this.posX + this.sizeX - 1 && k == this.posZ || i == this.posX && k == this.posZ + this.sizeZ - 1 || i == this.posX + this.sizeX - 1 && k == this.posZ + this.sizeZ - 1) {
					this.placeBlock(chunk, meta, i, j, k, cx, cz, Blocks.flowing_lava, 0);
				} else if (j % 3 == 0 && j >= this.posY + 2 && (i == this.posX || i == this.posX + this.sizeX - 1 || k == this.posZ || k == this.posZ + this.sizeZ - 1) || i == this.posX + 1 && k == this.posZ || i == this.posX && k == this.posZ + 1 || i == this.posX + this.sizeX - 2 && k == this.posZ || i == this.posX + this.sizeX - 1 && k == this.posZ + 1 || i == this.posX + 1 && k == this.posZ + this.sizeZ - 1 || i == this.posX && k == this.posZ + this.sizeZ - 2 || i == this.posX + this.sizeX - 2 && k == this.posZ + this.sizeZ - 1 || i == this.posX + this.sizeX - 1 && k == this.posZ + this.sizeZ - 2) {
					this.placeBlock(chunk, meta, i, j, k, cx, cz, Blocks.iron_bars, 0);
				} else if ((i == this.posX + 1 && k == this.posZ + 1 || i == this.posX + this.sizeX - 2 && k == this.posZ + 1 || i == this.posX + 1 && k == this.posZ + this.sizeZ - 2 || i == this.posX + this.sizeX - 2 && k == this.posZ + this.sizeZ - 2) && j % 3 == 0) {
					this.placeBlock(chunk, meta, i, j, k, cx, cz, Blocks.iron_bars, 0);
				} else {
					this.placeBlock(chunk, meta, i, j, k, cx, cz, Blocks.air, 0);
				}
			}
		}
	}

	final int hx = (this.posX + this.posX + this.sizeX) / 2;
	final int hz = (this.posZ + this.posZ + this.sizeZ) / 2;
	this.spawnerCoords = new ChunkCoordinates(hx, this.posY + 2, hz);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:25,代码来源:DungeonRoomBoss.java

示例11: generate

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
@Override
public void generate(Block[] chunk, byte[] meta, int cx, int cz) {
	for (int i = this.posX - 1; i <= this.posX + this.sizeX; i++) {
		for (int j = this.posY - 1; j <= this.posY + this.sizeY; j++) {
			for (int k = this.posZ - 1; k <= this.posZ + this.sizeZ; k++) {
				if (i == this.posX - 1 || i == this.posX + this.sizeX || j == this.posY - 1 || j == this.posY + this.sizeY || k == this.posZ - 1 || k == this.posZ + this.sizeZ) {
					this.placeBlock(chunk, meta, i, j, k, cx, cz, this.dungeonInstance.settings.blockBrick.getFirst(), this.dungeonInstance.settings.blockBrick.getSecond());
				} else {
					this.placeBlock(chunk, meta, i, j, k, cx, cz, Blocks.air, 0);
					if (this.rand.nextFloat() < 0.05F) {
						this.placeBlock(chunk, meta, i, j, k, cx, cz, Blocks.web, 0);
					}
				}
			}
		}
	}
	if (this.placeBlock(chunk, meta, this.posX + 1, this.posY - 1, this.posZ + 1, cx, cz, Blocks.mob_spawner, 0)) {
		this.spawners.add(new ChunkCoordinates(this.posX + 1, this.posY - 1, this.posZ + 1));
	}
	if (this.placeBlock(chunk, meta, this.posX + this.sizeX - 1, this.posY - 1, this.posZ + this.sizeZ - 1, cx, cz, Blocks.mob_spawner, 0)) {
		this.spawners.add(new ChunkCoordinates(this.posX + this.sizeX - 1, this.posY - 1, this.posZ + this.sizeZ - 1));
	}
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:24,代码来源:DungeonRoomSpawner.java

示例12: generate

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
@Override
public void generate(Block[] chunk, byte[] meta, int cx, int cz) {
	for (int i = this.posX - 1; i <= this.posX + this.sizeX; i++) {
		for (int j = this.posY - 1; j <= this.posY + this.sizeY; j++) {
			for (int k = this.posZ - 1; k <= this.posZ + this.sizeZ; k++) {
				if (i == this.posX - 1 || i == this.posX + this.sizeX || j == this.posY - 1 || j == this.posY + this.sizeY || k == this.posZ - 1 || k == this.posZ + this.sizeZ) {
					this.placeBlock(chunk, meta, i, j, k, cx, cz, this.dungeonInstance.settings.blockBrick.getFirst(), this.dungeonInstance.settings.blockBrick.getSecond());
				} else {
					this.placeBlock(chunk, meta, i, j, k, cx, cz, Blocks.air, 0);
				}
			}
		}
	}
	final int hx = (this.posX + this.posX + this.sizeX) / 2;
	final int hz = (this.posZ + this.posZ + this.sizeZ) / 2;
	if (this.placeBlock(chunk, meta, hx, this.posY, hz, cx, cz, Blocks.chest, 0)) {
		this.chests.add(new ChunkCoordinates(hx, this.posY, hz));
	}
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:20,代码来源:DungeonRoomChests.java

示例13: updateAITick

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
/**
 * main AI tick function, replaces updateEntityActionState
 */
protected void updateAITick()
{
    if (--this.homeCheckTimer <= 0)
    {
        this.homeCheckTimer = 70 + this.rand.nextInt(50);
        this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32);

        if (this.villageObj == null)
        {
            this.detachHome();
        }
        else
        {
            ChunkCoordinates chunkcoordinates = this.villageObj.getCenter();
            this.setHomeArea(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, (int)((float)this.villageObj.getVillageRadius() * 0.6F));
        }
    }

    super.updateAITick();
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:24,代码来源:EntityJenGolem.java

示例14: getTrunkBlockPosBySide

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
public ChunkCoordinates getTrunkBlockPosBySide(World world, int x, int y, int z, int side) {
	ChunkCoordinates ret = new ChunkCoordinates(x, y, z);
	
	switch (side) {
	case 5:
		ret.set(x - 1, y, z);
		return ret;
	case 4:
		ret.set(x + 1, y, z);
		return ret;
	case 2:
		ret.set(x, y, z + 1);
		return ret;
	case 3:
		ret.set(x, y, z - 1);
		return ret;
	}
	
	return null;
}
 
开发者ID:Shurgent,项目名称:TFCTech,代码行数:21,代码来源:BlockLatexExtractor.java

示例15: getTrunkBlockPosByRotation

import net.minecraft.util.ChunkCoordinates; //导入依赖的package包/类
public ChunkCoordinates getTrunkBlockPosByRotation(World world, int x, int y, int z, int rotation) {
	ChunkCoordinates ret = new ChunkCoordinates(x, y, z);
	
	switch (rotation) {
	case 1:
		ret.set(x - 1, y, z);
		return ret;
	case 3:
		ret.set(x + 1, y, z);
		return ret;
	case 0:
		ret.set(x, y, z + 1);
		return ret;
	case 2:
		ret.set(x, y, z - 1);
		return ret;
	}
	
	return null;
}
 
开发者ID:Shurgent,项目名称:TFCTech,代码行数:21,代码来源:BlockLatexExtractor.java


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