Okay! Checked with breakpoints and as far as I could tell the map is modified but still no result. What am I doing wrong here?
public static final Map<EntityType<?>, SpawnEggItem> EGG_MAP = Maps.newHashMap();
public static void addSpawnEggs()
{
try
{
Map<EntityType<?>, SpawnEggItem> map = (Map<EntityType<?>, SpawnEggItem>) ObfuscationReflectionHelper.findField(SpawnEggItem.class, "field_195987_b").get(null);
map.keySet().removeIf(Objects::isNull);
map.putAll(EGG_MAP);
}
catch (IllegalAccessException | IllegalArgumentException e)
{
throw new RuntimeException("Failed to spawn eggs to map", e);
}
}