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


Java TranslateUtils.translate方法代码示例

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


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

示例1: updateTextureButton

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
private void updateTextureButton( boolean initial )
{
	if ( initial )
	{
 	int tex = pet.getPetType().textures.indexOf( pet.getTexture() );
 	if ( tex == -1 )
 	{
 		tex = 0;
 	}
 	currTexIndex = tex;
	}
	
	String full = pet.getTexture();
	String file = full.substring( full.lastIndexOf( '/' ) + 1 );
	String filename = file.substring( 0, file.lastIndexOf( '.' ) );
	
	texButton.displayString = TranslateUtils.translate( TranslateUtils.translate( "pet.texture" ), TranslateUtils.translate( "pet.texture." + pet.getPetType().name + "." + filename ) );
}
 
开发者ID:spacechase0,项目名称:UsefulPets,代码行数:19,代码来源:PetInventoryGui.java

示例2: getItemStackDisplayName

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
   public String getItemStackDisplayName( ItemStack stack )
{
	ItemStack dummy = getDummyFor( stack );
	Modifier mod = Modifier.getModifier( stack.getTagCompound().getString( "Modifier" ) );
	if ( mod == null )
	{
		return TranslateUtils.translate( getUnlocalizedName() + ".name", stack.getTagCompound().getString( "Modifier" ) + "?" );
	}
	
	return TranslateUtils.translate( getUnlocalizedName() + ".name", mod.getName( dummy ) );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:13,代码来源:ModifierItem.java

示例3: drawScreen

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
public void drawScreen( int mx, int my, float par3 )
{
	drawDefaultBackground();
	
	String str = TranslateUtils.translate( "gui.pet.tracking" );
	
	GL11.glPushMatrix();
	GL11.glTranslatef( width / 2 - fontRendererObj.getStringWidth( str ), 10, 0 );
	GL11.glScalef( 2.f, 2.f, 2.f );
	ClientUtils.drawString( str, 0, 0, WHITE );
	GL11.glPopMatrix();
	
	if ( data == null )
	{
		return;
	}
	
	Iterator< Entry< UUID, PetData > > it = data.entrySet().iterator();
	for ( int i = 0; it.hasNext(); ++i )
	{
		Entry< UUID, PetData > entry = it.next();
		
		UUID id = entry.getKey();
		PetData pet = entry.getValue();
		
		int y = 50 + ( i * 16 );
		
		ClientUtils.drawString( TranslateUtils.translate( pet.name ), 50, y, WHITE );
		ClientUtils.drawString( TranslateUtils.translate( "gui.pet.tracking.level", pet.level ), 130, y, WHITE );
		ClientUtils.drawString( TranslateUtils.translate( "gui.pet.tracking.dim", pet.dim ), 200, y, WHITE );
		ClientUtils.drawString( TranslateUtils.translate( "gui.pet.tracking.pos", pet.pos.x, pet.pos.y, pet.pos.z ), 275, y, WHITE );
	}
}
 
开发者ID:spacechase0,项目名称:UsefulPets,代码行数:35,代码来源:PetTrackingGui.java

示例4: getName

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
public String getName( ItemStack stack )
{
	EquipmentItem item = ( EquipmentItem ) stack.getItem();
	if ( ender )
	{
		return TranslateUtils.translate( "componentequipment:modifier.enderBackpack.name" );
	}
	else
	{
		return TranslateUtils.translate( "componentequipment:modifier.chestBackpack.name" ) + " " + TranslateUtils.translate( "enchantment.level." + item.equipment.getModifierLevel( stack, type ) );
	}
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:14,代码来源:BackpackModifier.java

示例5: addInformation

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
public void addInformation( ItemStack stack, EntityPlayer player, List list, boolean par4 )
{
	if ( stack.getTagCompound() == null ) return;
	NBTTagCompound pet = stack.getTagCompound().getCompoundTag( "Pet" );
	
	if ( player.capabilities.isCreativeMode )
	{
		list.add( TranslateUtils.translate( "item.domesticEgg.tooltip.creative" ) );
		list.add( "" );
	}
	
	if ( !pet.hasKey( "Type" ) )
	{
		list.add( TranslateUtils.translate( "item.domesticEgg.tooltip.holding", "n/a" ) );
		return;
	}
	String type = pet.getString( "Type" );
	String typeStr = TranslateUtils.translate( "entity.pet." + type );

	list.add( TranslateUtils.translate( "item.domesticEgg.tooltip.holding", typeStr ) );
	if ( pet.hasKey( "CustomName" ) )
	{
		list.add( TranslateUtils.translate( "item.domesticEgg.tooltip.name", pet.getString( "CustomName" ) ) );
	}
	list.add( TranslateUtils.translate( "item.domesticEgg.tooltip.level", pet.getInteger( "Level" ) ) );
}
 
开发者ID:spacechase0,项目名称:UsefulPets,代码行数:28,代码来源:PetEggItem.java

示例6: addInformation

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
public void addInformation( ItemStack stack, EntityPlayer player, List list, boolean par4 )
{
	if ( stack == null || stack.getTagCompound() == null )
	{
		return;
	}
	
	NBTTagCompound tag = stack.getTagCompound();
	
	String[] parts = equipment.getBaseData( type ).getParts();
	for ( int i = 0; i < parts.length; ++i )
	{
		String part = parts[ i ];
		if ( part.equals( "head" ) )
		{
			part = type + "Head";
		}
		else if ( part.endsWith( "Left" ) )
		{
			part = part.substring( 0, part.indexOf( "Left" ) );
		}
		else if ( part.endsWith( "Right" ) )
		{
			part = part.substring( 0, part.indexOf( "Right" ) );
		}
		String matRaw = tag.getString( parts[ i ] );
		MaterialData matObj = Material.getData( matRaw );
		
		String title = TranslateUtils.translate( "componentequipment:part." + part );
		String mat = TranslateUtils.translate( "componentequipment:material." + matRaw );
		
		list.add( TranslateUtils.translate( "item.equipment.tooltip.part", title, matObj.getFormat() + mat ) );
		if ( equipment.getCasing( stack, parts[ i ] ) != null )
		{
			matRaw = equipment.getCasing( stack, parts[ i ] );
			matObj = Material.getData( matRaw );
			mat = TranslateUtils.translate( "componentequipment:material." + matRaw );
			
			list.add( "   " + TranslateUtils.translate( "item.equipment.tooltip.partCasing", matObj.getFormat() + mat ) );
		}
	}
	
	list.add( "" );
	
	list.add( TranslateUtils.translate( "item.equipment.tooltip.modifiers" ) );
	
	List< String > mods = equipment.getModifiers( stack );
	Iterator< String > it = mods.iterator();
	while ( it.hasNext() )
	{
		String modStr = it.next();
		Modifier mod = Modifier.getModifier( modStr );
		
		String name = ( mod != null ) ? mod.getName( stack ) : ( "\"" + modStr + "\"?" );
		list.add( "   - " + mod.getFormat( stack ) + name );
		mod.addInformation( stack, list );
	}
	
	list.add( "   " + TranslateUtils.translate( "item.equipment.tooltip.remaining", equipment.getModifiersRemaining( stack ) ) );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:62,代码来源:EquipmentItem.java

示例7: getName

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
public String getName( ItemStack stack )
{
	EquipmentItem item = ( EquipmentItem ) stack.getItem();
	return TranslateUtils.translate( "componentequipment:modifier.cheapRepair.name" ) + " " + TranslateUtils.translate( "enchantment.level." + item.equipment.getModifierLevel( stack, type ) );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:7,代码来源:CheaperRepairModifier.java

示例8: getName

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
public String getName( ItemStack stack )
{
	EquipmentItem item = ( EquipmentItem ) stack.getItem();
	return TranslateUtils.translate( "componentequipment:modifier.waterWalk.name" ) + " " + TranslateUtils.translate( "enchantment.level." + item.equipment.getModifierLevel( stack, type ) );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:7,代码来源:WaterWalkModifier.java

示例9: getName

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
public String getName( ItemStack stack )
{
	EquipmentItem item = ( EquipmentItem ) stack.getItem();
	return TranslateUtils.translate( "componentequipment:modifier.selfRepair.name" ) + " " + TranslateUtils.translate( "enchantment.level." + item.equipment.getModifierLevel( stack, type ) );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:7,代码来源:SelfRepairModifier.java

示例10: getName

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
public String getName( ItemStack stack )
{
	return TranslateUtils.translate( "componentequipment:modifier." + type + ".name" );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:6,代码来源:ExtraModifier.java

示例11: getName

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
public String getName( ItemStack stack )
{
	EquipmentItem item = ( EquipmentItem ) stack.getItem();
	return TranslateUtils.translate( "componentequipment:modifier.lifeSteal.name" ) + " " + TranslateUtils.translate( "enchantment.level." + item.equipment.getModifierLevel( stack, type ) );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:7,代码来源:LifeStealModifier.java

示例12: getName

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
public String getName( ItemStack stack )
{
	EquipmentItem item = ( EquipmentItem ) stack.getItem();
	return TranslateUtils.translate( "componentequipment:modifier." + type + ".name" ) + " " + TranslateUtils.translate( "enchantment.level." + item.equipment.getModifierLevel( stack, type ) );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:7,代码来源:ItemAttributeModifier.java

示例13: getName

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
public String getName( ItemStack stack )
{
	return TranslateUtils.translate( "componentequipment:modifier.persistance.name" );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:6,代码来源:PersistanceModifier.java

示例14: getName

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
public String getName( ItemStack stack )
{
	EquipmentItem item = ( EquipmentItem ) stack.getItem();
	return TranslateUtils.translate( "componentequipment:modifier.walkSlope.name" );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:7,代码来源:WalkSlopeModifier.java

示例15: getName

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入方法依赖的package包/类
@Override
public String getName( ItemStack stack )
{
	return TranslateUtils.translate( "componentequipment:modifier.portableJukebox.name" );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:6,代码来源:PortableJukeboxModifier.java


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