当前位置: 首页>>代码示例>>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;未经允许,请勿转载。