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


Java TranslateUtils类代码示例

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


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

示例1: 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 )
	{
		list.add( "INVALID ARROW: Delete immediately." );
		return;
	}
	
	NBTTagCompound tag = stack.getTagCompound();
	
	if ( tag.getBoolean( "Feather" ) )
	{
		list.add( TranslateUtils.translate( "item.arrow.feathered" ) );
	}
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:17,代码来源:ArrowItem.java

示例2: 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 part = tag.getString( "Part" );
	
	String mat = tag.getString( "Material" );
	
	list.add( TranslateUtils.translate( "item.partCasing.tooltip.part", TranslateUtils.translate( "componentequipment:part." + part ) ) );
	list.add( TranslateUtils.translate( "item.partCasing.tooltip.material", Material.getData( mat ).getFormat() + TranslateUtils.translate( "componentequipment:material." + mat ) ) );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:17,代码来源:PartCasingItem.java

示例3: addInformation

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入依赖的package包/类
@Override
public void addInformation( ItemStack stack, List list )
{
	EquipmentItem item = ( EquipmentItem ) stack.getItem();
	int level = item.equipment.getModifierLevel( stack, type );
	if ( ( level & DAMAGE ) != 0 )
	{
		list.add( PREFIX + EnumChatFormatting.RED + TranslateUtils.translate( "componentequipment:modifier.persistance.damage" ) );
	}
	if ( ( level & TIME ) != 0 )
	{
		list.add( PREFIX + EnumChatFormatting.AQUA + TranslateUtils.translate( "componentequipment:modifier.persistance.time" ) );
	}
	if ( ( level & INVENTORY ) != 0 )
	{
		list.add( PREFIX + EnumChatFormatting.DARK_AQUA + TranslateUtils.translate( "componentequipment:modifier.persistance.inventory" ) );
	}
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:19,代码来源:PersistanceModifier.java

示例4: 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

示例5: draw

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入依赖的package包/类
@Override
public void draw( String section, int page, List< DisplayStack > stacksToDraw )
{
	MaterialData mat = Material.getData( section );

	drawString( 20, 17 + 0 * 20, "baseDur", mat.getBaseDurability() );
	drawString( 20, 17 + 1 * 10, "toolDurMult", mat.getToolMultiplier() );
	drawString( 20, 17 + 2 * 10, "armorDurMult", mat.getArmorDurabilityMultiplier() );

	drawString( 20, 17 + 4 * 10, "speed", mat.getMiningSpeed() );
	drawString( 20, 17 + 5 * 10, "level", mat.getMiningLevel() );
	drawString( 20, 17 + 6 * 10, "damage", mat.getAttackDamage() );

	drawString( 20, 17 + 8 * 10, "totalArmor", mat.getTotalArmor() );
	
	drawString( 20, 17 + 11 * 10, "special", TranslateUtils.translate( "componentequipment:special." + mat.getSpecialAbility() ) );

	stacksToDraw.add( new DisplayStack( gui.guiLeft + 48, gui.guiTop + DocumentationGui.BOOK_HEIGHT - 40, mat.getCraftingMaterials() ) );
	stacksToDraw.add( new DisplayStack( gui.guiLeft + DocumentationGui.BOOK_WIDTH - 48 - 16, gui.guiTop + DocumentationGui.BOOK_HEIGHT - 40, PartItem.getAllStacksOfMaterial( mat.getType() ) ) );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:21,代码来源:MaterialCategory.java

示例6: initGui

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入依赖的package包/类
@Override
public void initGui()
{
	super.initGui();
	
       guiLeft = ( width - BOOK_WIDTH ) / 2;
       guiTop = ( height - BOOK_HEIGHT ) / 2;

       buttonList.add( new GuiButton( GETTING_STARTED_ID, guiLeft - 105, guiTop + 5, 100, 20, TranslateUtils.translate( "gui.componentequipment:docBook.gettingStarted" ) ) );
       buttonList.add( new GuiButton( RECIPES_ID, guiLeft - 105, guiTop + 30, 100, 20, TranslateUtils.translate( "gui.componentequipment:docBook.recipes" ) ) );
       buttonList.add( new GuiButton( MATERIALS_ID, guiLeft - 105, guiTop + 55, 100, 20, TranslateUtils.translate( "gui.componentequipment:docBook.materials" ) ) );
       buttonList.add( new GuiButton( TOOLS_ID, guiLeft - 105, guiTop + 80, 100, 20, TranslateUtils.translate( "gui.componentequipment:docBook.tools" ) ) );
       buttonList.add( new GuiButton( MODIFIERS_ID, guiLeft - 105, guiTop + 105, 100, 20, TranslateUtils.translate( "gui.componentequipment:docBook.modifiers" ) ) );

       buttonList.add( new GuiButton( SCROLL_UP_ID, guiLeft + BOOK_WIDTH + 5, guiTop + 5, 100, 20, TranslateUtils.translate( "gui.componentequipment:docBook.scrollUp" ) ) );
       buttonList.add( new GuiButton( SCROLL_DOWN_ID, guiLeft + BOOK_WIDTH + 5, guiTop + 155, 100, 20, TranslateUtils.translate( "gui.componentequipment:docBook.scrollDown" ) ) );
       
       if ( currCategory == -1 )
       {
       	select( 0 );
       }
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:23,代码来源:DocumentationGui.java

示例7: 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

示例8: 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 part = tag.getString( "Part" );
	String mat = tag.getString( "Material" );
	
	list.add( TranslateUtils.translate( "item.part.tooltip.part", TranslateUtils.translate( "componentequipment:part." + part ) ) );
	list.add( TranslateUtils.translate( "item.part.tooltip.material", Material.getData( mat ).getFormat() + TranslateUtils.translate( "componentequipment:material." + mat ) ) );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:16,代码来源:PartItem.java

示例9: 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

示例10: 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

示例11: drawGuiContainerForegroundLayer

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入依赖的package包/类
@Override
protected void drawGuiContainerForegroundLayer( int param1, int param2 )
{
	ArmorItem armor = ( ArmorItem ) chestplate.getItem();
	
	if ( armor.armor.getModifierLevel( chestplate, "chestBackpack" ) == 1 )
	{
		ClientUtils.drawString( TranslateUtils.translate( "container.backpack" ), 8, 6, 4210752 );
		ClientUtils.drawString( TranslateUtils.translate( "container.inventory" ), 8, ySize - 96 + 2, 4210752 );
	}
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:12,代码来源:BackpackGui.java

示例12: addInformation

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入依赖的package包/类
@Override
public void addInformation( ItemStack stack, EntityPlayer player, List list, boolean par4 )
{
	list.add( TranslateUtils.translate( "item.petWand.tooltip.help.convert" ) );
	list.add( TranslateUtils.translate( "item.petWand.tooltip.help.track" ) );
	list.add( TranslateUtils.translate( "item.petWand.tooltip.help.more" ) );
}
 
开发者ID:spacechase0,项目名称:UsefulPets,代码行数:8,代码来源:PetWandItem.java

示例13: 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

示例14: 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

示例15: initGui

import com.spacechase0.minecraft.spacecore.util.TranslateUtils; //导入依赖的package包/类
@Override
public void initGui()
{
	super.initGui();
	
	buttonList.clear();
	buttonList.add(             new GuiButton( SKILLS_BUTTON_ID,  guiLeft + 8, guiTop + 39, 48, 20, TranslateUtils.translate( "gui.pet.skills" ) ) );
	
	buttonList.add( texButton = new GuiButton( TEXTURE_BUTTON_ID, guiLeft + 8, guiTop - 28, xSize - 16, 20, "<...>" ) );
	updateTextureButton( true );
}
 
开发者ID:spacechase0,项目名称:UsefulPets,代码行数:12,代码来源:PetInventoryGui.java


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