當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。