本文整理匯總了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);
}
}
示例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);
}
示例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);
}
}
}
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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));
}
}
示例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);
}
示例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));
}
}
示例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));
}
}
示例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();
}
示例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;
}
示例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;
}