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


Java PlayerChatHelper类代码示例

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


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

示例1: onScrewdriverRightClick

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
@Override
public void onScrewdriverRightClick( byte pSide, EntityPlayer pPlayer, float pX, float pY, float pZ )
{
  if (pPlayer.isSneaking())
  {
    if (mMode == 0)
    {
      incRadiusTierOverride();

      markDirty();
      PlayerChatHelper.SendInfo( pPlayer, String.format( "Machine radius changed to %d Blocks", getRadiusTierOverride() ));
    }
    else
      PlayerChatHelper.SendError( pPlayer, String.format( "Can't change radius; Machine is in TileEntity Mode!" ));
  }
  else
  {
    mMode = (byte) ( mMode == 0x00 ? 0x01 : 0x00 );
    markDirty();
    PlayerChatHelper.SendInfo( pPlayer, String.format( "Switched mode to: %s", mModeStr[mMode] ) );
  }
}
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsCoreMod,代码行数:23,代码来源:GT_MetaTileEntity_WorldAccelerator.java

示例2: SendHelpToPlayer

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
private void SendHelpToPlayer(ICommandSender pCmdSender)
    {
        if (!InGame(pCmdSender))
        {
            PlayerChatHelper.SendPlain(pCmdSender, "[HAZIT] Valid options are: reload|save|listdamagesources|listpotions");            
        }
        else
        {
/*            PlayerChatHelper.SendInfo(pCmdSender, "  /hazarditems addpotion <potionID> <tickDuration> <level>");
            PlayerChatHelper.SendInfo(pCmdSender, "  /hazarditems adddamage <damageSource> <damageAmount>");
            PlayerChatHelper.SendInfo(pCmdSender, "  /hazarditems removeitem [all]");
            PlayerChatHelper.SendInfo(pCmdSender, "* tickDuration is [seconds*20]");
            PlayerChatHelper.SendInfo(pCmdSender, "* damageAmount is a float, where 1.0 equals 1 heart");*/
            PlayerChatHelper.SendInfo(pCmdSender, "/hazarditems reload|save|listdamagesources|listpotions");            
        }
    }
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsCoreMod,代码行数:17,代码来源:HazardousItemsCommand.java

示例3: SendHelpToPlayer

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
private void SendHelpToPlayer( ICommandSender pCmdSender )
{
	if( !InGame( pCmdSender ) )
	{
		PlayerChatHelper.SendPlain( pCmdSender, "Command can only be executed ingame" );
	}
	else
	{
		PlayerChatHelper.SendInfo( pCmdSender, "Check the readme for usage" );
	}
}
 
开发者ID:GTNewHorizons,项目名称:EnhancedLootBags,代码行数:12,代码来源:LootBagCommand.java

示例4: onWrenchRightClick

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
@Override
public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer pPlayer, float aX, float aY, float aZ) {
  incSpeedTierOverride();

  markDirty();
  PlayerChatHelper.SendInfo( pPlayer, String.format( "Machine acceleration changed to x%d", mAccelerateStatic[getSpeedTierOverride()] ));

  return true;
}
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsCoreMod,代码行数:10,代码来源:GT_MetaTileEntity_WorldAccelerator.java

示例5: toggleDeathInfoForPlayer

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
public void toggleDeathInfoForPlayer(EntityPlayer pEP)
{
    UUID tUUID = pEP.getUniqueID();
    if (_mDeathDebugPlayers.contains(tUUID))
    {
        _mDeathDebugPlayers.remove(tUUID);
        PlayerChatHelper.SendInfo(pEP, "Death-Debug is now diabled");
    }
    else
    {
        _mDeathDebugPlayers.add(tUUID);
        PlayerChatHelper.SendInfo(pEP, "Death-Debug is now enabled");
    }
}
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsCoreMod,代码行数:15,代码来源:CustomDropsHandler.java

示例6: processCommand

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
@Override
public void processCommand(ICommandSender pCmdSender, String[] pArgs)
{
    if (pArgs.length == 0)
    {
        if (InGame(pCmdSender)) {
            PlayerChatHelper.SendError(pCmdSender, "Syntax error. Type /customfuels help for help");
        } else {
            PlayerChatHelper.SendPlain(pCmdSender, "[CFLS] Syntax error. Type /customfuels help for help");
        }
        return;
    }
    else if ("help".equalsIgnoreCase(pArgs[0]))
    {
        SendHelpToPlayer(pCmdSender);
    }
    else if ("reload".equalsIgnoreCase(pArgs[0]))
    {
        boolean tFlag = MainRegistry.Module_CustomFuels.ReloadCustomFuels();
        if (!tFlag)
        {
            if (!InGame(pCmdSender)) {
                PlayerChatHelper.SendPlain(pCmdSender, "[CFLS] Reload failed. Check your log for syntax errors");
            } else {
                PlayerChatHelper.SendWarn(pCmdSender, "Reload failed. Check your log for syntax errors");
            }
        }
        else
        {
            if (!InGame(pCmdSender)) {
                PlayerChatHelper.SendPlain(pCmdSender, "[CFLS] Reload done. New config is activated");
            } else {
                PlayerChatHelper.SendInfo(pCmdSender, "Reload done. New config is activated");
            }
        }
    }
    else {
        SendHelpToPlayer(pCmdSender);
    }
}
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsCoreMod,代码行数:41,代码来源:CustomFuelsCommand.java

示例7: SendHelpToPlayer

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
private void SendHelpToPlayer(ICommandSender pCmdSender)
{
    if (!InGame(pCmdSender))
    {
        PlayerChatHelper.SendPlain(pCmdSender, "[CFLS] Valid options are: reload");            
    }
    else
    {
        PlayerChatHelper.SendInfo(pCmdSender, "/customfuels reload");            
    }
}
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsCoreMod,代码行数:12,代码来源:CustomFuelsCommand.java

示例8: SendPotionsToPlayer

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
/**
 * Send a list of all valid potions to the command sender
 * @param pCmdSender
 */
private void SendPotionsToPlayer(ICommandSender pCmdSender)
{
    if (!InGame(pCmdSender)) {
        PlayerChatHelper.SendPlain(pCmdSender, "[HAZIT] List of known Potions; Name(ID)");
    } else {
        PlayerChatHelper.SendInfo(pCmdSender, "List of known Potions; Name(ID)");
    }
    
    StringBuilder tMsg = new StringBuilder(32);
    for (Potion p : Potion.potionTypes)
    {
        if (p == null) {
            continue;
        }

        if (tMsg.length()>0) {
            tMsg.append(", ");
        }
        String t = String.format("%s(%d)", p.getName(), p.id);
        if (tMsg.length() + t.length() > 50)
        {
            if (!InGame(pCmdSender)) {
                PlayerChatHelper.SendPlain(pCmdSender, tMsg.toString());
            } else {
                PlayerChatHelper.SendInfo(pCmdSender, tMsg.toString());
            }
            tMsg=new StringBuilder(t);
        } else {
            tMsg.append(t);
        }
    }
    if (!InGame(pCmdSender)) {
        PlayerChatHelper.SendPlain(pCmdSender, "[HAZIT] End of list");
    } else {
        PlayerChatHelper.SendInfo(pCmdSender, "End of list");
    }
}
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsCoreMod,代码行数:42,代码来源:HazardousItemsCommand.java

示例9: processCommand

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
@Override
public void processCommand(ICommandSender pCmdSender, String[] pArgs)
{
    try
    {
        if (!InGame(pCmdSender))
        {
            PlayerChatHelper.SendPlain(pCmdSender, "You have to execute this command ingame");
            return;
        }
        
        EntityPlayer tEp = (EntityPlayer) pCmdSender;
        ItemStack inHand = null;
        if (tEp != null)
        {
            inHand = tEp.getCurrentEquippedItem();
            if (inHand == null)
            {
                PlayerChatHelper.SendPlain(pCmdSender, "Pickup an item first");
                return;
            }
        }

        GameRegistry.UniqueIdentifier UID = GameRegistry.findUniqueIdentifierFor(inHand.getItem());
        
        PlayerChatHelper.SendPlain(pCmdSender, "== Item info");
        PlayerChatHelper.SendPlain(pCmdSender, String.format("Unloc.Name:  [%s]", inHand.getUnlocalizedName()));
        PlayerChatHelper.SendPlain(pCmdSender, String.format("ItemName:  [%s]", UID.toString()));
        PlayerChatHelper.SendPlain(pCmdSender, String.format("ItemMeta:  [%s]", inHand.getItemDamage()));
        PlayerChatHelper.SendPlain(pCmdSender, String.format("FluidContainer:  [%s]", getFluidContainerContents(inHand)));
        PlayerChatHelper.SendPlain(pCmdSender, String.format("ClassName:  [%s]", inHand.getItem().getClass().toString()));
        PlayerChatHelper.SendPlain(pCmdSender, String.format("ItemNBT:  [%s]", inHand.stackTagCompound));
        
    } catch (Exception e)
    {
        e.printStackTrace();
        PlayerChatHelper.SendError(pCmdSender, "Unknown error occoured");
    }
}
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsCoreMod,代码行数:40,代码来源:ItemInHandInfoCommand.java

示例10: SendHelpToPlayer

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
private void SendHelpToPlayer(ICommandSender pCmdSender)
{
    if (!InGame(pCmdSender))
    {
        PlayerChatHelper.SendPlain(pCmdSender, "Command can only be executed ingame");            
    }
    else
    {
        PlayerChatHelper.SendInfo(pCmdSender, "/iih");            
    }
}
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsCoreMod,代码行数:12,代码来源:ItemInHandInfoCommand.java

示例11: processCommand

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
@Override
public void processCommand(ICommandSender pCmdSender, String[] pArgs)
{
    if (pArgs.length == 0)
    {
        if (InGame(pCmdSender)) {
            PlayerChatHelper.SendError(pCmdSender, "Syntax error. Type /customtooltips help for help");
        } else {
            PlayerChatHelper.SendPlain(pCmdSender, "[CTT] Syntax error. Type /customtooltips help for help");
        }
        return;
    }
    else if ("help".equalsIgnoreCase(pArgs[0]))
    {
        SendHelpToPlayer(pCmdSender);
    }
    else if ("reload".equalsIgnoreCase(pArgs[0]))
    {
        boolean tFlag = MainRegistry.Module_CustomToolTips.reload();
        if (!tFlag)
        {
            if (!InGame(pCmdSender)) {
                PlayerChatHelper.SendPlain(pCmdSender, "[CTT] Reload failed. Check your log for syntax errors");
            } else {
                PlayerChatHelper.SendWarn(pCmdSender, "Reload failed. Check your log for syntax errors");
            }
        }
        else
        {
            if (!InGame(pCmdSender)) {
                PlayerChatHelper.SendPlain(pCmdSender, "[CTT] Reload done. New config is activated");
            } else {
                PlayerChatHelper.SendInfo(pCmdSender, "Reload done. New config is activated");
            }
        }
    }
    else {
        SendHelpToPlayer(pCmdSender);
    }
}
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsCoreMod,代码行数:41,代码来源:CustomToolTipsCommand.java

示例12: SendHelpToPlayer

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
private void SendHelpToPlayer(ICommandSender pCmdSender)
{
    if (!InGame(pCmdSender))
    {
        PlayerChatHelper.SendPlain(pCmdSender, "[CTT] Valid options are: reload");            
    }
    else
    {
        PlayerChatHelper.SendInfo(pCmdSender, "/customtooltips reload");            
    }
}
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsCoreMod,代码行数:12,代码来源:CustomToolTipsCommand.java

示例13: SendHelpToPlayer

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
private void SendHelpToPlayer( ICommandSender pCmdSender )
{
  if( !InGame( pCmdSender ) )
  {
    PlayerChatHelper.SendPlain( pCmdSender, "Command can only be executed ingame" );
  }
  else
  {
    PlayerChatHelper.SendInfo( pCmdSender, "/gtnhdebug" );
  }
}
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsCoreMod,代码行数:12,代码来源:AllPurposeDebugCommand.java

示例14: SendHelpToPlayer

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
private void SendHelpToPlayer( ICommandSender pCmdSender )
{
  if( !InGame( pCmdSender ) )
  {
    PlayerChatHelper.SendPlain( pCmdSender, "[CDRP] Valid options are: reload" );
  }
  else
  {
    PlayerChatHelper.SendInfo( pCmdSender, "/customdrops reload|toggleinfo" );
  }
}
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsCoreMod,代码行数:12,代码来源:CustomDropsCommand.java

示例15: onItemRightClick

import eu.usrv.yamcore.auxiliary.PlayerChatHelper; //导入依赖的package包/类
@Override
public ItemStack onItemRightClick( ItemStack pStack, World pWorld, EntityPlayer pPlayer )
{
	if( !pWorld.isRemote )
	{
		if( pPlayer.capabilities.isCreativeMode && pPlayer.isSneaking() )
		{
			pPlayer.openGui( EnhancedLootBags.instance, GuiHandler.GUI_LOOTBAG, pWorld, (int) pPlayer.posX, (int) pPlayer.posY, (int) pPlayer.posZ );
			return pStack;
		}

		int tGroupID = pStack.getItemDamage();
		int tFortuneLevel = EnchantmentHelper.getEnchantmentLevel( Enchantment.fortune.effectId, pStack );
		LootGroup tGrp = _mLGHandler.getMergedGroupFromID( tGroupID, tFortuneLevel );
		if( tGrp != null )
		{
			int q = tGrp.getMinItems();
			if( tGrp.getMaxItems() > tGrp.getMinItems() )
				q = pWorld.rand.nextInt( tGrp.getMaxItems() ) + 1;

			// _mLogger.info(String.format("MinMax %d / %d", tGrp.mMinItems, tGrp.mMaxItems));
			while( q > 0 )
			{
				// _mLogger.info(String.format("q: %d", q));
				List<ItemStack> isList = getRandomLootItems( pPlayer, tGrp );
				if (isList.isEmpty())
				{
				  PlayerChatHelper.SendNotifyWarning( pPlayer, StatHelper.get( "string.try_again" ) );
				  return pStack;
				}
				q -= isList.size();
				// _mLogger.info(String.format("NewQ: %d", q));

				for( ItemStack tStack : isList )
				{
					try
					{
						EntityItem eti = new EntityItem( pWorld, pPlayer.posX, pPlayer.posY, pPlayer.posZ, tStack.copy() );
						eti.delayBeforeCanPickup = 0;
						pWorld.spawnEntityInWorld( eti );
					}
					catch( Exception e )
					{
						_mLogger.error( "Unable to spawn dropitem in world" );
						e.printStackTrace();
					}
				}
			}

			pWorld.playSoundAtEntity( pPlayer, String.format( "%s:lootbag_open", EnhancedLootBags.MODID ), 0.75F, 1.0F );
			pStack.stackSize -= 1;
		}
		else
		{
			PlayerChatHelper.SendNotifyWarning( pPlayer, StatHelper.get( "string.sorry_damaged" ) );
		}
	}
	return pStack;
}
 
开发者ID:GTNewHorizons,项目名称:EnhancedLootBags,代码行数:60,代码来源:ItemLootBag.java


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