Fixed duplicate stat-id

This commit is contained in:
Kino 2018-12-30 00:09:46 -05:00
parent cdf65499c9
commit ad1a8538a6
2 changed files with 22 additions and 6 deletions

View file

@ -8,6 +8,8 @@ import org.apache.logging.log4j.Logger;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.stats.StatBase;
import net.minecraft.stats.StatList;
import net.minecraft.world.World;
import com.legacy.aether.Aether;
@ -119,7 +121,7 @@ public class EntitiesAether {
IDtoClassMapping.put(Integer.valueOf(entityID), entityClass);
classToIDMapping.put(entityClass, Integer.valueOf(entityID));
stringToIDMapping.put(entityName, Integer.valueOf(entityID));
ItemAetherSpawnEgg.entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID, primaryEggColor, secondaryEggColor));
ItemAetherSpawnEgg.entityEggs.put(Integer.valueOf(entityID), new AetherEggInfo(entityID, primaryEggColor, secondaryEggColor));
}
}
@ -158,4 +160,18 @@ public class EntitiesAether {
return oclass != null ? (String) classToStringMapping.get(oclass) : null;
}
public static class AetherEggInfo
{
public final int spawnedID;
public final int primaryColor;
public final int secondaryColor;
public AetherEggInfo(int spawnedID, int primaryColor, int secondaryColor)
{
this.spawnedID = spawnedID;
this.primaryColor = primaryColor;
this.secondaryColor = secondaryColor;
}
}
}

View file

@ -10,7 +10,6 @@ import net.minecraft.block.BlockLiquid;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList.EntityEggInfo;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
@ -25,6 +24,7 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import com.legacy.aether.entities.EntitiesAether;
import com.legacy.aether.entities.EntitiesAether.AetherEggInfo;
import com.legacy.aether.registry.creative_tabs.AetherCreativeTabs;
import cpw.mods.fml.relauncher.Side;
@ -32,7 +32,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemAetherSpawnEgg extends Item {
public static HashMap<Integer, EntityEggInfo> entityEggs = new LinkedHashMap<Integer, EntityEggInfo>();
public static HashMap<Integer, AetherEggInfo> entityEggs = new LinkedHashMap<Integer, AetherEggInfo>();
@SideOnly(Side.CLIENT)
private IIcon theIcon;
@ -57,7 +57,7 @@ public class ItemAetherSpawnEgg extends Item {
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) {
EntityEggInfo entityegginfo = entityEggs.get(Integer.valueOf(p_82790_1_.getItemDamage()));
AetherEggInfo entityegginfo = entityEggs.get(Integer.valueOf(p_82790_1_.getItemDamage()));
return entityegginfo != null ? (p_82790_2_ == 0 ? entityegginfo.primaryColor : entityegginfo.secondaryColor) : 16777215;
}
@ -176,10 +176,10 @@ public class ItemAetherSpawnEgg extends Item {
@SideOnly(Side.CLIENT)
@SuppressWarnings({"unchecked", "rawtypes"})
public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) {
Iterator<EntityEggInfo> iterator = entityEggs.values().iterator();
Iterator<AetherEggInfo> iterator = entityEggs.values().iterator();
while (iterator.hasNext()) {
EntityEggInfo entityegginfo = iterator.next();
AetherEggInfo entityegginfo = iterator.next();
p_150895_3_.add(new ItemStack(p_150895_1_, 1, entityegginfo.spawnedID));
}
}