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


Java TranslateUtils.chat方法代码示例

本文整理汇总了Java中com.spacechase0.minecraft.spacecore.util.TranslateUtils.chat方法的典型用法代码示例。如果您正苦于以下问题:Java TranslateUtils.chat方法的具体用法?Java TranslateUtils.chat怎么用?Java TranslateUtils.chat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.spacechase0.minecraft.spacecore.util.TranslateUtils的用法示例。


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

示例1: openGui

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
protected void openGui( World world, int x, int y, int z, EntityPlayer player )
{
	int result = checkStructure( world, x, y, z, true );
	
	if ( result != OKAY )
	{
		String str = "";
		switch ( result )
		{
			case BAD_FLOOR: str = "badfloor"; break;
			case BAD_PILLAR: str = "badpillar"; break;
			case NO_BEACON: str = "nobeacon"; break;
		}
		
		TranslateUtils.chat( player, "componentequipment.persistiumInfuser." + str );
	}
	else
	{
    	PersistiumInfuserTileEntity infuser = ( PersistiumInfuserTileEntity ) world.getTileEntity( x, y, z );
    	player.openGui( ComponentEquipment.instance, ComponentEquipment.PERSISTIUM_INFUSER_GUI_ID, world, x, y, z );
	}
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:24,代码来源:PersistiumInfuserBlock.java

示例2: itemInteractionForEntity

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
  public boolean itemInteractionForEntity( ItemStack stack, EntityPlayer player, EntityLivingBase entity )
  {
if ( !( entity instanceof PetEntity ) ) return false;
      if ( stack.getTagCompound() != null && stack.getTagCompound().hasKey( "Pet" ) ) return false;
      
      if ( !player.worldObj.isRemote )
      {
       if ( !( ( PetEntity ) entity ).func_152113_b().equals( player.getUniqueID().toString() ) )
       {
       	TranslateUtils.chat( player, "chat.pet.notYours" );
       }
       
       NBTTagCompound pet = new NBTTagCompound();
       entity.writeEntityToNBT( pet );
       
       NBTTagCompound tag = stack.getTagCompound();
       if ( tag == null )
       {
       	tag = new NBTTagCompound();
       }
       tag.setTag( "Pet", pet );
       stack.setTagCompound( tag );
       
       UsefulPets.instance.petData.removePetData( player.getUniqueID().toString(), entity.getPersistentID() );
       entity.worldObj.removeEntity( entity );
      }
      
      return true;
  }
 
开发者ID:spacechase0,项目名称:UsefulPets,代码行数:31,代码来源:PetEggItem.java

示例3: onBlockActivated

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
   public boolean onBlockActivated( World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9 )
{
	if ( world.getBlockMetadata( x, y, z ) != IngotItem.PERSISTIUM )
	{
		return false;
	}
	
	if ( !player.isSneaking() )
	{
		return false;
	}
	
	int result = PersistiumInfuserBlock.checkStructure( world, x, y, z, false );
	if ( result == PersistiumInfuserBlock.OKAY )
	{
		// Sound for server but particles for client? Weird :P
		if ( world.isRemote )
		{
			for ( int i = 0; i < 3; ++i )
			{
				world.spawnParticle( "hugeexplosion", x + 0.5, y + 1.5, z + 0.5, 0, 0, 0 );
			}
		}
		else
		{
            world.playSoundEffect( x, y, z, "ambient.weather.thunder", 20000.0F, 0.8f + ( world.rand.nextFloat() * 0.2f ) );
            world.playSoundEffect( x, y, z, "random.explode", 3.5f, 0.5f + ( world.rand.nextFloat() * 0.2f ) );
			PersistiumInfuserBlock.createStructure( world, x, y, z );
		}
	}
	else if ( !world.isRemote )
	{
		String str = "";
		switch ( result )
		{
			case PersistiumInfuserBlock.BAD_FLOOR: str = "badfloor"; break;
			case PersistiumInfuserBlock.BAD_PILLAR: str = "badpillar"; break;
			case PersistiumInfuserBlock.NO_BEACON: str = "nobeacon"; break;
		}
		
		TranslateUtils.chat( player, "componentequipment.persistiumInfuser." + str );
	}
	
	return true;
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:47,代码来源:IngotBlock.java


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