本文整理汇总了Java中net.minecraft.world.World.getSpawnPoint方法的典型用法代码示例。如果您正苦于以下问题:Java World.getSpawnPoint方法的具体用法?Java World.getSpawnPoint怎么用?Java World.getSpawnPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.World
的用法示例。
在下文中一共展示了World.getSpawnPoint方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAreaLevel
import net.minecraft.world.World; //导入方法依赖的package包/类
private static int getAreaLevel(World world, ChunkPos pos)
{
ChunkPos spawnChunk = new ChunkPos(world.getSpawnPoint());
double distance = Math.sqrt(Math.pow(pos.x - spawnChunk.x, 2) + Math.pow(pos.z - spawnChunk.z, 2));
return (int) (distance / 10 + 1);
}
示例2: EntityPlayer
import net.minecraft.world.World; //导入方法依赖的package包/类
public EntityPlayer(World worldIn, GameProfile gameProfileIn)
{
super(worldIn);
this.entityUniqueID = getUUID(gameProfileIn);
this.gameProfile = gameProfileIn;
this.inventoryContainer = new ContainerPlayer(this.inventory, !worldIn.isRemote, this);
this.openContainer = this.inventoryContainer;
BlockPos blockpos = worldIn.getSpawnPoint();
this.setLocationAndAngles((double)blockpos.getX() + 0.5D, (double)(blockpos.getY() + 1), (double)blockpos.getZ() + 0.5D, 0.0F, 0.0F);
this.field_70741_aB = 180.0F;
this.fireResistance = 20;
}
示例3: isBlockProtected
import net.minecraft.world.World; //导入方法依赖的package包/类
public boolean isBlockProtected(World worldIn, BlockPos pos, EntityPlayer playerIn)
{
if (worldIn.provider.getDimensionId() != 0)
{
return false;
}
else if (this.getConfigurationManager().getOppedPlayers().isEmpty())
{
return false;
}
else if (this.getConfigurationManager().canSendCommands(playerIn.getGameProfile()))
{
return false;
}
else if (this.getSpawnProtectionSize() <= 0)
{
return false;
}
else
{
BlockPos blockpos = worldIn.getSpawnPoint();
int i = MathHelper.abs_int(pos.getX() - blockpos.getX());
int j = MathHelper.abs_int(pos.getZ() - blockpos.getZ());
int k = Math.max(i, j);
return k <= this.getSpawnProtectionSize();
}
}
示例4: EntityPlayer
import net.minecraft.world.World; //导入方法依赖的package包/类
public EntityPlayer(World worldIn, GameProfile gameProfileIn)
{
super(worldIn);
this.setUniqueId(getUUID(gameProfileIn));
this.gameProfile = gameProfileIn;
this.inventoryContainer = new ContainerPlayer(this.inventory, !worldIn.isRemote, this);
this.openContainer = this.inventoryContainer;
BlockPos blockpos = worldIn.getSpawnPoint();
this.setLocationAndAngles((double)blockpos.getX() + 0.5D, (double)(blockpos.getY() + 1), (double)blockpos.getZ() + 0.5D, 0.0F, 0.0F);
this.unused180 = 180.0F;
}
示例5: decorate
import net.minecraft.world.World; //导入方法依赖的package包/类
public void decorate(World worldIn, Random random, Biome biome, BlockPos pos)
{
BlockPos blockpos = worldIn.getSpawnPoint();
int i = 16;
double d0 = blockpos.distanceSq(pos.add(8, blockpos.getY(), 8));
if (d0 <= 1024.0D)
{
BlockPos blockpos1 = new BlockPos(blockpos.getX() - 16, blockpos.getY() - 1, blockpos.getZ() - 16);
BlockPos blockpos2 = new BlockPos(blockpos.getX() + 16, blockpos.getY() - 1, blockpos.getZ() + 16);
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(blockpos1);
for (int j = pos.getZ(); j < pos.getZ() + 16; ++j)
{
for (int k = pos.getX(); k < pos.getX() + 16; ++k)
{
if (j >= blockpos1.getZ() && j <= blockpos2.getZ() && k >= blockpos1.getX() && k <= blockpos2.getX())
{
blockpos$mutableblockpos.setPos(k, blockpos$mutableblockpos.getY(), j);
if (blockpos.getX() == k && blockpos.getZ() == j)
{
worldIn.setBlockState(blockpos$mutableblockpos, Blocks.COBBLESTONE.getDefaultState(), 2);
}
else
{
worldIn.setBlockState(blockpos$mutableblockpos, Blocks.STONE.getDefaultState(), 2);
}
}
}
}
}
}
示例6: EntityPlayer
import net.minecraft.world.World; //导入方法依赖的package包/类
public EntityPlayer(World worldIn, GameProfile gameProfileIn)
{
super(worldIn);
this.setUniqueId(getUUID(gameProfileIn));
this.gameProfile = gameProfileIn;
this.inventoryContainer = new ContainerPlayer(this.inventory, !worldIn.isRemote, this);
this.openContainer = this.inventoryContainer;
BlockPos blockpos = worldIn.getSpawnPoint();
this.setLocationAndAngles((double)blockpos.getX() + 0.5D, (double)(blockpos.getY() + 1), (double)blockpos.getZ() + 0.5D, 0.0F, 0.0F);
this.unused180 = 180.0F;
this.fireResistance = 20;
}
示例7: isBlockProtected
import net.minecraft.world.World; //导入方法依赖的package包/类
public boolean isBlockProtected(World worldIn, BlockPos pos, EntityPlayer playerIn)
{
if (worldIn.provider.getDimension() != 0)
{
return false;
}
else if (this.getPlayerList().getOppedPlayers().isEmpty())
{
return false;
}
else if (this.getPlayerList().canSendCommands(playerIn.getGameProfile()))
{
return false;
}
else if (this.getSpawnProtectionSize() <= 0)
{
return false;
}
else
{
BlockPos blockpos = worldIn.getSpawnPoint();
int i = MathHelper.abs_int(pos.getX() - blockpos.getX());
int j = MathHelper.abs_int(pos.getZ() - blockpos.getZ());
int k = Math.max(i, j);
return k <= this.getSpawnProtectionSize();
}
}
示例8: updateCompass
import net.minecraft.world.World; //导入方法依赖的package包/类
/**
* Updates the compass based on the given x,z coords and camera direction
*/
public void updateCompass(World worldIn, double p_94241_2_, double p_94241_4_, double p_94241_6_, boolean p_94241_8_, boolean p_94241_9_)
{
if (!this.framesTextureData.isEmpty())
{
double d0 = 0.0D;
if (worldIn != null && !p_94241_8_)
{
BlockPos blockpos = worldIn.getSpawnPoint();
double d1 = (double)blockpos.getX() - p_94241_2_;
double d2 = (double)blockpos.getZ() - p_94241_4_;
p_94241_6_ = p_94241_6_ % 360.0D;
d0 = -((p_94241_6_ - 90.0D) * Math.PI / 180.0D - Math.atan2(d2, d1));
if (!worldIn.provider.isSurfaceWorld())
{
d0 = Math.random() * Math.PI * 2.0D;
}
}
if (p_94241_9_)
{
this.currentAngle = d0;
}
else
{
double d3;
for (d3 = d0 - this.currentAngle; d3 < -Math.PI; d3 += (Math.PI * 2D))
{
;
}
while (d3 >= Math.PI)
{
d3 -= (Math.PI * 2D);
}
d3 = MathHelper.clamp_double(d3, -1.0D, 1.0D);
this.angleDelta += d3 * 0.1D;
this.angleDelta *= 0.8D;
this.currentAngle += this.angleDelta;
}
int i;
for (i = (int)((this.currentAngle / (Math.PI * 2D) + 1.0D) * (double)this.framesTextureData.size()) % this.framesTextureData.size(); i < 0; i = (i + this.framesTextureData.size()) % this.framesTextureData.size())
{
;
}
if (i != this.frameCounter)
{
this.frameCounter = i;
TextureUtil.uploadTextureMipmap((int[][])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false);
}
}
}
示例9: updateCompass
import net.minecraft.world.World; //导入方法依赖的package包/类
/**
* Updates the compass based on the given x,z coords and camera direction
*/
public void updateCompass(World worldIn, double p_94241_2_, double p_94241_4_, double p_94241_6_, boolean p_94241_8_, boolean p_94241_9_)
{
if (!this.framesTextureData.isEmpty())
{
double d0 = 0.0D;
if (worldIn != null && !p_94241_8_)
{
BlockPos blockpos = worldIn.getSpawnPoint();
double d1 = (double)blockpos.getX() - p_94241_2_;
double d2 = (double)blockpos.getZ() - p_94241_4_;
p_94241_6_ = p_94241_6_ % 360.0D;
d0 = -((p_94241_6_ - 90.0D) * Math.PI / 180.0D - Math.atan2(d2, d1));
if (!worldIn.provider.isSurfaceWorld())
{
d0 = Math.random() * Math.PI * 2.0D;
}
}
if (p_94241_9_)
{
this.currentAngle = d0;
}
else
{
double d3;
for (d3 = d0 - this.currentAngle; d3 < -Math.PI; d3 += (Math.PI * 2D))
{
;
}
while (d3 >= Math.PI)
{
d3 -= (Math.PI * 2D);
}
d3 = MathHelper.clamp_double(d3, -1.0D, 1.0D);
this.angleDelta += d3 * 0.1D;
this.angleDelta *= 0.8D;
this.currentAngle += this.angleDelta;
}
int i;
for (i = (int)((this.currentAngle / (Math.PI * 2D) + 1.0D) * (double)this.framesTextureData.size()) % this.framesTextureData.size(); i < 0; i = (i + this.framesTextureData.size()) % this.framesTextureData.size())
{
;
}
if (i != this.frameCounter)
{
this.frameCounter = i;
if (Config.isShaders())
{
ShadersTex.uploadTexSub((int[][])((int[][])this.framesTextureData.get(this.frameCounter)), this.width, this.height, this.originX, this.originY, false, false);
}
else
{
TextureUtil.uploadTextureMipmap((int[][])((int[][])this.framesTextureData.get(this.frameCounter)), this.width, this.height, this.originX, this.originY, false, false);
}
}
}
}