本文整理匯總了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());
}