本文整理汇总了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;
}
}
示例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);
}
}
示例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();
}
}
示例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;
}
示例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();
}
}
示例6: getDeathMessage
import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@Override
public ITextComponent getDeathMessage(EntityLivingBase mob)
{
return new TextComponentTranslation("death.face", mob.getName(), faceHurt.getLocalizedName());
}
示例7: getDeathMessage
import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@Override
public ITextComponent getDeathMessage(EntityLivingBase mob)
{
return new TextComponentTranslation("death.diffusion", mob.getName());
}