當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityLivingBase.getName方法代碼示例

本文整理匯總了Java中net.minecraft.entity.EntityLivingBase.getName方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityLivingBase.getName方法的具體用法?Java EntityLivingBase.getName怎麽用?Java EntityLivingBase.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.entity.EntityLivingBase的用法示例。


在下文中一共展示了EntityLivingBase.getName方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setRootUser

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
void setRootUser(EntityLivingBase player) {
	this.rootUser = player.getName();
	
	Rule playerRule = this.getRuleByNameInternal(this.rootUser);
	
	if (playerRule == null) {
		System.out.println("CREATING ROOT USER OF "+this.rootUser);
		playerRule = new Rule(this.rootUser, Rule.MODE_OWNER);
		this.rules.add(playerRule);
	} else {
		playerRule.mode = Rule.MODE_OWNER;
	}
}
 
開發者ID:astronautlabs,項目名稱:rezolve,代碼行數:14,代碼來源:SecurityServerEntity.java

示例2: statEvent

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
@SubscribeEvent
public void statEvent(LivingDeathEvent event) {

    Entity killer = event.getSource().getEntity();
    EntityLivingBase target = event.getEntityLiving();

    // Thanks again 'SourceCoded' <3
    // Add to statclock weapon
    if (killer != null && killer instanceof EntityPlayer) {

        EntityPlayer player = (EntityPlayer) killer;

        // Attackers weapon
        ItemStack stack = player.getHeldItemMainhand();
        if (stack == null) { return; }

        // Weapon NBT
        NBTTagCompound nbt = stack.getTagCompound();
        if (nbt == null || !nbt.hasKey("Kills")) { return; }

        String name = target.getName();
        name = name + "Kills";
        name = name.replace(" ", "_");

        if (nbt.hasKey(name)) {
            int i = nbt.getInteger(name) + 1;
            nbt.setInteger(name, i);
        }

        setStrange(stack, nbt, event);
    }

}
 
開發者ID:lucidagrande,項目名稱:statclock,代碼行數:34,代碼來源:EventStatclock.java

示例3: createdBy

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
public void createdBy(EntityLivingBase p_189720_1_)
{
    if (!StringUtils.isNullOrEmpty(p_189720_1_.getName()))
    {
        this.author = p_189720_1_.getName();
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:8,代碼來源:TileEntityStructure.java

示例4: setOwner

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
public void setOwner(EntityLivingBase owner) {
	// TODO Auto-generated method stub
	this.owner = owner;
	if (owner instanceof EntityPlayer){
		this.ownerName = owner.getName();
		this.dataManager.set(OWNER_UUID, Optional.of(owner.getUniqueID()));
		this.enablePersistence();
	}
	else if(owner != null)
		this.engMade = true;
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:12,代碼來源:EntityBuilding.java

示例5: setOwner

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
public void setOwner(EntityLivingBase owner) {
	// TODO Auto-generated method stub
	if(owner == null) {
		this.ownerName = null;
		this.dataManager.set(OWNER_UUID, Optional.absent());
	}
	else if (owner instanceof EntityPlayer){
		this.ownerName = owner.getName();
		this.dataManager.set(OWNER_UUID, Optional.of(owner.getUniqueID()));
		this.enablePersistence();
	}
	
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:14,代碼來源:EntityTF2Character.java

示例6: getDeathMessage

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
@Override
public ITextComponent getDeathMessage(EntityLivingBase mob)
{
	return new TextComponentTranslation("death.face", mob.getName(), faceHurt.getLocalizedName());
}
 
開發者ID:einsteinsci,項目名稱:BetterBeginningsReborn,代碼行數:6,代碼來源:DamageSourceFace.java

示例7: getDeathMessage

import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
@Override
public ITextComponent getDeathMessage(EntityLivingBase mob)
{
	return new TextComponentTranslation("death.diffusion", mob.getName());
}
 
開發者ID:einsteinsci,項目名稱:BetterBeginningsReborn,代碼行數:6,代碼來源:DamageSourceDiffusion.java


注:本文中的net.minecraft.entity.EntityLivingBase.getName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。