本文整理汇总了Java中net.minecraft.entity.EntityList.EntityEggInfo方法的典型用法代码示例。如果您正苦于以下问题:Java EntityList.EntityEggInfo方法的具体用法?Java EntityList.EntityEggInfo怎么用?Java EntityList.EntityEggInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.EntityList
的用法示例。
在下文中一共展示了EntityList.EntityEggInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChangeForSpawn
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
@Override
public int getChangeForSpawn(SpawnEventDetails details) {
EntityList.EntityEggInfo eggInfo = EntityRegistry.getEntry(details.entity.getClass()).getEgg();
if(eggInfo==null) {
if(DifficultyManager.debugLogSpawns){
LOG.info("Tried to get kills for mob with class "+details.entity.getClass()+", but not spawn egg found. Cannot count kills for this mob for difficulty.");
}
return 0;
}
StatBase stat = eggInfo.killEntityStat;
int killedMobs = PlayerAreaStatAccumulator.getStatForPlayersInArea(type,stat,details.entity,128);
int contribution = (int)(((double)killedMobs * difficultyPerHundredKills) / 100);
if(maxAddedDifficulty>=0){
contribution = Math.min(contribution,maxAddedDifficulty);
}
return contribution;
}
示例2: drawSlot
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn)
{
EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)this.field_148222_l.get(entryID);
String s = I18n.format("entity." + EntityList.getStringFromID(entitylist$entityegginfo.spawnedID) + ".name", new Object[0]);
int i = GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151512_d);
int j = GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151513_e);
String s1 = I18n.format("stat.entityKills", new Object[] {Integer.valueOf(i), s});
String s2 = I18n.format("stat.entityKilledBy", new Object[] {s, Integer.valueOf(j)});
if (i == 0)
{
s1 = I18n.format("stat.entityKills.none", new Object[] {s});
}
if (j == 0)
{
s2 = I18n.format("stat.entityKilledBy.none", new Object[] {s});
}
GuiStats.this.drawString(GuiStats.this.fontRendererObj, s, p_180791_2_ + 2 - 10, p_180791_3_ + 1, 16777215);
GuiStats.this.drawString(GuiStats.this.fontRendererObj, s1, p_180791_2_ + 2, p_180791_3_ + 1 + GuiStats.this.fontRendererObj.FONT_HEIGHT, i == 0 ? 6316128 : 9474192);
GuiStats.this.drawString(GuiStats.this.fontRendererObj, s2, p_180791_2_ + 2, p_180791_3_ + 1 + GuiStats.this.fontRendererObj.FONT_HEIGHT * 2, j == 0 ? 6316128 : 9474192);
}
示例3: onKillEntity
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
/**
* This method gets called when the entity kills another one.
*/
public void onKillEntity(EntityLivingBase entityLivingIn)
{
if (entityLivingIn instanceof IMob)
{
this.triggerAchievement(AchievementList.killEnemy);
}
EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(EntityList.getEntityID(entityLivingIn)));
if (entitylist$entityegginfo != null)
{
this.triggerAchievement(entitylist$entityegginfo.field_151512_d);
}
}
示例4: StatsMobsList
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
public StatsMobsList(Minecraft mcIn)
{
super(mcIn, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, GuiStats.this.fontRendererObj.FONT_HEIGHT * 4);
this.setShowSelectionBox(false);
for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.entityEggs.values())
{
if (GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151512_d) > 0 || GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151513_e) > 0)
{
this.field_148222_l.add(entitylist$entityegginfo);
}
}
}
示例5: getSubItems
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
/**
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
*/
public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems)
{
for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.entityEggs.values())
{
subItems.add(new ItemStack(itemIn, 1, entitylist$entityegginfo.spawnedID));
}
}
示例6: onKillEntity
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
/**
* This method gets called when the entity kills another one.
*/
public void onKillEntity(EntityLivingBase entityLivingIn)
{
if (entityLivingIn instanceof IMob)
{
this.addStat(AchievementList.KILL_ENEMY);
}
EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.ENTITY_EGGS.get(EntityList.func_191301_a(entityLivingIn));
if (entitylist$entityegginfo != null)
{
this.addStat(entitylist$entityegginfo.killEntityStat);
}
}
示例7: getSubItems
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
/**
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
*/
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems)
{
for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.ENTITY_EGGS.values())
{
ItemStack itemstack = new ItemStack(itemIn, 1);
applyEntityIdToItemStack(itemstack, entitylist$entityegginfo.spawnedID);
subItems.add(itemstack);
}
}
示例8: getSubItems
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
/**
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
*/
@SideOnly(Side.CLIENT)
public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems)
{
for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.ENTITY_EGGS.values())
{
ItemStack itemstack = new ItemStack(itemIn, 1);
applyEntityIdToItemStack(itemstack, entitylist$entityegginfo.spawnedID);
subItems.add(itemstack);
}
}
示例9: getStatKillEntity
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
public static StatBase getStatKillEntity(EntityList.EntityEggInfo eggInfo)
{
String s = EntityList.getStringFromID(eggInfo.spawnedID);
return s == null ? null : (new StatBase("stat.killEntity." + s, new ChatComponentTranslation("stat.entityKill", new Object[] {new ChatComponentTranslation("entity." + s + ".name", new Object[0])}))).registerStat();
}
示例10: getStatKillEntity
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
public static StatBase getStatKillEntity(EntityList.EntityEggInfo eggInfo)
{
return eggInfo.spawnedID == null ? null : (new StatBase("stat.killEntity." + eggInfo.spawnedID, new TextComponentTranslation("stat.entityKill", new Object[] {new TextComponentTranslation("entity." + eggInfo.spawnedID + ".name", new Object[0])}))).registerStat();
}
示例11: onDeath
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
/**
* Called when the mob's health reaches 0.
*/
public void onDeath(DamageSource cause)
{
boolean flag = this.world.getGameRules().getBoolean("showDeathMessages");
this.connection.sendPacket(new SPacketCombatEvent(this.getCombatTracker(), SPacketCombatEvent.Event.ENTITY_DIED, flag));
if (flag)
{
Team team = this.getTeam();
if (team != null && team.getDeathMessageVisibility() != Team.EnumVisible.ALWAYS)
{
if (team.getDeathMessageVisibility() == Team.EnumVisible.HIDE_FOR_OTHER_TEAMS)
{
this.mcServer.getPlayerList().sendMessageToAllTeamMembers(this, this.getCombatTracker().getDeathMessage());
}
else if (team.getDeathMessageVisibility() == Team.EnumVisible.HIDE_FOR_OWN_TEAM)
{
this.mcServer.getPlayerList().sendMessageToTeamOrAllPlayers(this, this.getCombatTracker().getDeathMessage());
}
}
else
{
this.mcServer.getPlayerList().sendChatMsg(this.getCombatTracker().getDeathMessage());
}
}
if (!this.world.getGameRules().getBoolean("keepInventory") && !this.isSpectator())
{
this.func_190776_cN();
this.inventory.dropAllItems();
}
for (ScoreObjective scoreobjective : this.world.getScoreboard().getObjectivesFromCriteria(IScoreCriteria.DEATH_COUNT))
{
Score score = this.getWorldScoreboard().getOrCreateScore(this.getName(), scoreobjective);
score.incrementScore();
}
EntityLivingBase entitylivingbase = this.getAttackingEntity();
if (entitylivingbase != null)
{
EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.ENTITY_EGGS.get(EntityList.func_191301_a(entitylivingbase));
if (entitylist$entityegginfo != null)
{
this.addStat(entitylist$entityegginfo.entityKilledByStat);
}
entitylivingbase.addToPlayerScore(this, this.scoreValue);
}
this.addStat(StatList.DEATHS);
this.takeStat(StatList.TIME_SINCE_DEATH);
this.extinguish();
this.setFlag(0, false);
this.getCombatTracker().reset();
}
示例12: onDeath
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
/**
* Called when the mob's health reaches 0.
*/
public void onDeath(DamageSource cause)
{
if (this.worldObj.getGameRules().getBoolean("showDeathMessages"))
{
Team team = this.getTeam();
if (team != null && team.getDeathMessageVisibility() != Team.EnumVisible.ALWAYS)
{
if (team.getDeathMessageVisibility() == Team.EnumVisible.HIDE_FOR_OTHER_TEAMS)
{
this.mcServer.getConfigurationManager().sendMessageToAllTeamMembers(this, this.getCombatTracker().getDeathMessage());
}
else if (team.getDeathMessageVisibility() == Team.EnumVisible.HIDE_FOR_OWN_TEAM)
{
this.mcServer.getConfigurationManager().sendMessageToTeamOrEvryPlayer(this, this.getCombatTracker().getDeathMessage());
}
}
else
{
this.mcServer.getConfigurationManager().sendChatMsg(this.getCombatTracker().getDeathMessage());
}
}
if (!this.worldObj.getGameRules().getBoolean("keepInventory"))
{
this.inventory.dropAllItems();
}
for (ScoreObjective scoreobjective : this.worldObj.getScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.deathCount))
{
Score score = this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective);
score.func_96648_a();
}
EntityLivingBase entitylivingbase = this.func_94060_bK();
if (entitylivingbase != null)
{
EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(EntityList.getEntityID(entitylivingbase)));
if (entitylist$entityegginfo != null)
{
this.triggerAchievement(entitylist$entityegginfo.field_151513_e);
}
entitylivingbase.addToPlayerScore(this, this.scoreValue);
}
this.triggerAchievement(StatList.deathsStat);
this.func_175145_a(StatList.timeSinceDeathStat);
this.getCombatTracker().reset();
}
示例13: getStatEntityKilledBy
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
public static StatBase getStatEntityKilledBy(EntityList.EntityEggInfo eggInfo)
{
String s = EntityList.getStringFromID(eggInfo.spawnedID);
return s == null ? null : (new StatBase("stat.entityKilledBy." + s, new ChatComponentTranslation("stat.entityKilledBy", new Object[] {new ChatComponentTranslation("entity." + s + ".name", new Object[0])}))).registerStat();
}
示例14: getColorFromItemStack
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
public int getColorFromItemStack(ItemStack stack, int renderPass)
{
EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(stack.getMetadata()));
return entitylist$entityegginfo != null ? (renderPass == 0 ? entitylist$entityegginfo.primaryColor : entitylist$entityegginfo.secondaryColor) : 16777215;
}
示例15: getStatEntityKilledBy
import net.minecraft.entity.EntityList; //导入方法依赖的package包/类
public static StatBase getStatEntityKilledBy(EntityList.EntityEggInfo eggInfo)
{
String s = EntityList.func_191302_a(eggInfo.spawnedID);
return s == null ? null : (new StatBase("stat.entityKilledBy." + s, new TextComponentTranslation("stat.entityKilledBy", new Object[] {new TextComponentTranslation("entity." + s + ".name", new Object[0])}))).registerStat();
}