本文整理汇总了Java中net.minecraft.entity.player.EntityPlayer.isSpectator方法的典型用法代码示例。如果您正苦于以下问题:Java EntityPlayer.isSpectator方法的具体用法?Java EntityPlayer.isSpectator怎么用?Java EntityPlayer.isSpectator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.player.EntityPlayer
的用法示例。
在下文中一共展示了EntityPlayer.isSpectator方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateAllPlayersSleepingFlag
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
/**
* Updates the flag that indicates whether or not all players in the world are sleeping.
*/
public void updateAllPlayersSleepingFlag()
{
this.allPlayersSleeping = false;
if (!this.playerEntities.isEmpty())
{
int i = 0;
int j = 0;
for (EntityPlayer entityplayer : this.playerEntities)
{
if (entityplayer.isSpectator())
{
++i;
}
else if (entityplayer.isPlayerSleeping())
{
++j;
}
}
this.allPlayersSleeping = j > 0 && j >= this.playerEntities.size() - i;
}
}
示例2: areAllPlayersAsleep
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public boolean areAllPlayersAsleep()
{
if (this.allPlayersSleeping && !this.isRemote)
{
for (EntityPlayer entityplayer : this.playerEntities)
{
if (entityplayer.isSpectator() || !entityplayer.isPlayerFullyAsleep())
{
return false;
}
}
return true;
}
else
{
return false;
}
}
示例3: areAllPlayersAsleep
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
/**
* Checks if all players in this world are sleeping.
*/
public boolean areAllPlayersAsleep()
{
if (this.allPlayersSleeping && !this.isRemote)
{
for (EntityPlayer entityplayer : this.playerEntities)
{
if (!entityplayer.isSpectator() && !entityplayer.isPlayerFullyAsleep())
{
return false;
}
}
return true;
}
else
{
return false;
}
}
示例4: closeInventory
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public void closeInventory(EntityPlayer player)
{
if (!player.isSpectator() && this.getBlockType() instanceof BlockChest)
{
--this.numPlayersUsing;
this.worldObj.addBlockEvent(this.pos, this.getBlockType(), 1, this.numPlayersUsing);
this.worldObj.notifyNeighborsOfStateChange(this.pos, this.getBlockType());
this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), this.getBlockType());
}
}
示例5: isInvisibleToPlayer
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
/**
* Only used by renderer in EntityLivingBase subclasses.
* Determines if an entity is visible or not to a specfic player, if the entity is normally invisible.
* For EntityLivingBase subclasses, returning false when invisible will render the entity semitransparent.
*/
@SideOnly(Side.CLIENT)
public boolean isInvisibleToPlayer(EntityPlayer player)
{
if (player.isSpectator())
{
return false;
}
else
{
Team team = this.getTeam();
return team != null && player != null && player.getTeam() == team && team.getSeeFriendlyInvisiblesEnabled() ? false : this.isInvisible();
}
}
示例6: openInventory
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public void openInventory(EntityPlayer player)
{
if (!player.isSpectator())
{
if (this.numPlayersUsing < 0)
{
this.numPlayersUsing = 0;
}
++this.numPlayersUsing;
this.worldObj.addBlockEvent(this.pos, this.getBlockType(), 1, this.numPlayersUsing);
this.worldObj.notifyNeighborsOfStateChange(this.pos, this.getBlockType());
this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), this.getBlockType());
}
}
示例7: closeInventory
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public void closeInventory(EntityPlayer player)
{
if (!player.isSpectator())
{
--this.field_190598_h;
this.world.addBlockEvent(this.pos, this.getBlockType(), 1, this.field_190598_h);
if (this.field_190598_h <= 0)
{
this.world.playSound((EntityPlayer)null, this.pos, SoundEvents.field_191261_fA, SoundCategory.BLOCKS, 0.5F, this.world.rand.nextFloat() * 0.1F + 0.9F);
}
}
}
示例8: canInteractWith
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public boolean canInteractWith(EntityPlayer playerIn) {
return !playerIn.isSpectator();
}
示例9: func_75529_b
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
private boolean func_75529_b()
{
List<EntityPlayer> list = this.worldObj.playerEntities;
Iterator iterator = list.iterator();
while (true)
{
if (!iterator.hasNext())
{
return false;
}
EntityPlayer entityplayer = (EntityPlayer)iterator.next();
if (!entityplayer.isSpectator())
{
this.theVillage = this.worldObj.getVillageCollection().getNearestVillage(new BlockPos(entityplayer), 1);
if (this.theVillage != null && this.theVillage.getNumVillageDoors() >= 10 && this.theVillage.getTicksSinceLastDoorAdding() >= 20 && this.theVillage.getNumVillagers() >= 20)
{
BlockPos blockpos = this.theVillage.getCenter();
float f = (float)this.theVillage.getVillageRadius();
boolean flag = false;
for (int i = 0; i < 10; ++i)
{
float f1 = this.worldObj.rand.nextFloat() * (float)Math.PI * 2.0F;
this.field_75532_g = blockpos.getX() + (int)((double)(MathHelper.cos(f1) * f) * 0.9D);
this.field_75538_h = blockpos.getY();
this.field_75539_i = blockpos.getZ() + (int)((double)(MathHelper.sin(f1) * f) * 0.9D);
flag = false;
for (Village village : this.worldObj.getVillageCollection().getVillageList())
{
if (village != this.theVillage && village.func_179866_a(new BlockPos(this.field_75532_g, this.field_75538_h, this.field_75539_i)))
{
flag = true;
break;
}
}
if (!flag)
{
break;
}
}
if (flag)
{
return false;
}
Vec3 vec3 = this.func_179867_a(new BlockPos(this.field_75532_g, this.field_75538_h, this.field_75539_i));
if (vec3 != null)
{
break;
}
}
}
}
this.field_75534_e = 0;
this.field_75533_d = 20;
return true;
}
示例10: onBlockActivated
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY)
{
if (worldIn.isRemote)
{
return true;
}
else if (playerIn.isSpectator())
{
return true;
}
else
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityShulkerBox)
{
EnumFacing enumfacing = (EnumFacing)state.getValue(field_190957_a);
boolean flag;
if (((TileEntityShulkerBox)tileentity).func_190591_p() == TileEntityShulkerBox.AnimationStatus.CLOSED)
{
AxisAlignedBB axisalignedbb = FULL_BLOCK_AABB.addCoord((double)(0.5F * (float)enumfacing.getFrontOffsetX()), (double)(0.5F * (float)enumfacing.getFrontOffsetY()), (double)(0.5F * (float)enumfacing.getFrontOffsetZ())).func_191195_a((double)enumfacing.getFrontOffsetX(), (double)enumfacing.getFrontOffsetY(), (double)enumfacing.getFrontOffsetZ());
flag = !worldIn.collidesWithAnyBlock(axisalignedbb.offset(pos.offset(enumfacing)));
}
else
{
flag = true;
}
if (flag)
{
playerIn.addStat(StatList.field_191272_ae);
playerIn.displayGUIChest((IInventory)tileentity);
}
return true;
}
else
{
return false;
}
}
}
示例11: trySetupSiege
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
private boolean trySetupSiege()
{
List<EntityPlayer> list = this.worldObj.playerEntities;
Iterator iterator = list.iterator();
while (true)
{
if (!iterator.hasNext())
{
return false;
}
EntityPlayer entityplayer = (EntityPlayer)iterator.next();
if (!entityplayer.isSpectator())
{
this.theVillage = this.worldObj.getVillageCollection().getNearestVillage(new BlockPos(entityplayer), 1);
if (this.theVillage != null && this.theVillage.getNumVillageDoors() >= 10 && this.theVillage.getTicksSinceLastDoorAdding() >= 20 && this.theVillage.getNumVillagers() >= 20)
{
BlockPos blockpos = this.theVillage.getCenter();
float f = (float)this.theVillage.getVillageRadius();
boolean flag = false;
for (int i = 0; i < 10; ++i)
{
float f1 = this.worldObj.rand.nextFloat() * ((float)Math.PI * 2F);
this.spawnX = blockpos.getX() + (int)((double)(MathHelper.cos(f1) * f) * 0.9D);
this.spawnY = blockpos.getY();
this.spawnZ = blockpos.getZ() + (int)((double)(MathHelper.sin(f1) * f) * 0.9D);
flag = false;
for (Village village : this.worldObj.getVillageCollection().getVillageList())
{
if (village != this.theVillage && village.isBlockPosWithinSqVillageRadius(new BlockPos(this.spawnX, this.spawnY, this.spawnZ)))
{
flag = true;
break;
}
}
if (!flag)
{
break;
}
}
if (flag)
{
return false;
}
Vec3d vec3d = this.findRandomSpawnPos(new BlockPos(this.spawnX, this.spawnY, this.spawnZ));
if (vec3d != null)
{
break;
}
}
}
}
this.nextSpawnTime = 0;
this.siegeCount = 20;
return true;
}
示例12: isInvisibleToPlayer
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
/**
* Only used by renderer in EntityLivingBase subclasses.
* Determines if an entity is visible or not to a specfic player, if the entity is normally invisible.
* For EntityLivingBase subclasses, returning false when invisible will render the entity semitransparent.
*/
public boolean isInvisibleToPlayer(EntityPlayer player)
{
return player.isSpectator() ? false : this.isInvisible();
}